3 types derived from AIFunctionDeclaration
Microsoft.Extensions.AI.Abstractions (3)
Functions\AIFunction.cs (1)
14
public abstract class AIFunction :
AIFunctionDeclaration
Functions\AIFunctionFactory.cs (1)
495
AIFunctionDeclaration
Functions\DelegatingAIFunctionDeclaration.cs (1)
16
internal class DelegatingAIFunctionDeclaration :
AIFunctionDeclaration
// could be made public in the future if there's demand
67 references to AIFunctionDeclaration
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClient.cs (1)
43
/// If a requested function is an <see cref="
AIFunctionDeclaration
"/> but not an <see cref="AIFunction"/>, the
Microsoft.Extensions.AI.Abstractions (27)
Functions\AIFunction.cs (3)
49
/// <summary>Creates a <see cref="
AIFunctionDeclaration
"/> representation of this <see cref="AIFunction"/> that can't be invoked.</summary>
52
/// <see cref="AIFunction"/> derives from <see cref="
AIFunctionDeclaration
"/>, layering on the ability to invoke the function in addition
55
public
AIFunctionDeclaration
AsDeclarationOnly() => new NonInvocableAIFunction(this);
Functions\AIFunctionDeclaration.cs (3)
13
/// <see cref="
AIFunctionDeclaration
"/> is the base class for <see cref="AIFunction"/>, which
15
/// for <see cref="
AIFunctionDeclaration
"/> to determine whether they can be described as functions,
20
/// <summary>Initializes a new instance of the <see cref="
AIFunctionDeclaration
"/> class.</summary>
Functions\AIFunctionFactory.cs (10)
52
/// <see cref="
AIFunctionDeclaration
.JsonSchema"/>. There are a few exceptions to this:
134
/// <see cref="
AIFunctionDeclaration
.JsonSchema"/>. There are a few exceptions to this:
215
/// <see cref="
AIFunctionDeclaration
.JsonSchema"/>. There are a few exceptions to this:
307
/// <see cref="
AIFunctionDeclaration
.JsonSchema"/>. There are a few exceptions to this:
401
/// <see cref="
AIFunctionDeclaration
.JsonSchema"/>. There are a few exceptions to this:
470
/// <summary>Creates an <see cref="
AIFunctionDeclaration
"/> using the specified parameters as the implementation of its corresponding properties.</summary>
475
/// <returns>The created <see cref="
AIFunctionDeclaration
"/> that describes a function.</returns>
478
/// <see cref="CreateDeclaration"/> creates an <see cref="
AIFunctionDeclaration
"/> that can be used to describe a function
479
/// but not invoke it. To create an invocable <see cref="AIFunction"/>, use Create. A non-invocable <see cref="
AIFunctionDeclaration
"/>
482
public static
AIFunctionDeclaration
CreateDeclaration(
Functions\AIFunctionFactoryOptions.cs (2)
110
/// Gets or sets a value indicating whether a schema should be created for the function's result type, if possible, and included as <see cref="
AIFunctionDeclaration
.ReturnJsonSchema" />.
117
/// When set to <see langword="true"/>, results in the produced <see cref="
AIFunctionDeclaration
.ReturnJsonSchema"/> to always be <see langword="null"/>.
Functions\DelegatingAIFunctionDeclaration.cs (4)
14
/// Provides an optional base class for an <see cref="
AIFunctionDeclaration
"/> that passes through calls to another instance.
23
protected DelegatingAIFunctionDeclaration(
AIFunctionDeclaration
innerFunction)
28
/// <summary>Gets the inner <see cref="
AIFunctionDeclaration
" />.</summary>
29
protected
AIFunctionDeclaration
InnerFunction { get; }
Utilities\AIJsonSchemaTransformCache.cs (5)
27
private readonly ConditionalWeakTable<
AIFunctionDeclaration
, object> _functionSchemaCache = new();
30
private readonly ConditionalWeakTable<
AIFunctionDeclaration
, object>.CreateValueCallback _functionSchemaCreateValueCallback;
63
GetOrCreateTransformedSchema((
AIFunctionDeclaration
)function);
66
/// Gets or creates a transformed JSON schema for the specified <see cref="
AIFunctionDeclaration
"/> instance.
70
public JsonElement GetOrCreateTransformedSchema(
AIFunctionDeclaration
function)
Microsoft.Extensions.AI.AzureAIInference (2)
AzureAIInferenceChatClient.cs (2)
346
if (tool is
AIFunctionDeclaration
af)
413
private static ChatCompletionsToolDefinition ToAzureAIChatTool(
AIFunctionDeclaration
aiFunction)
Microsoft.Extensions.AI.Evaluation.Quality (17)
AIToolExtensions.cs (2)
22
foreach (
AIFunctionDeclaration
function in toolDefinitions.OfType<
AIFunctionDeclaration
>())
IntentResolutionEvaluator.cs (1)
28
/// defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
IntentResolutionEvaluatorContext.cs (4)
22
/// defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
39
/// are defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions will be ignored.
58
/// are defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions will be ignored.
84
/// are defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
TaskAdherenceEvaluator.cs (1)
27
/// defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
TaskAdherenceEvaluatorContext.cs (4)
23
/// defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
40
/// are defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions will be ignored.
59
/// are defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions will be ignored.
86
/// defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
ToolCallAccuracyEvaluator.cs (1)
28
/// defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
ToolCallAccuracyEvaluatorContext.cs (4)
24
/// defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
41
/// are defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions will be ignored.
60
/// are defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions will be ignored.
88
/// are defined as <see cref="
AIFunctionDeclaration
"/>s. Any other <see cref="AITool"/> definitions that are supplied via
Microsoft.Extensions.AI.OpenAI (17)
MicrosoftExtensionsAIAssistantsExtensions.cs (2)
13
/// <summary>Creates an OpenAI <see cref="FunctionToolDefinition"/> from an <see cref="
AIFunctionDeclaration
"/>.</summary>
17
public static FunctionToolDefinition AsOpenAIAssistantsFunctionToolDefinition(this
AIFunctionDeclaration
function) =>
MicrosoftExtensionsAIChatExtensions.cs (2)
22
/// <summary>Creates an OpenAI <see cref="ChatTool"/> from an <see cref="
AIFunctionDeclaration
"/>.</summary>
26
public static ChatTool AsOpenAIChatTool(this
AIFunctionDeclaration
function) =>
MicrosoftExtensionsAIRealtimeExtensions.cs (2)
13
/// <summary>Creates an OpenAI <see cref="ConversationFunctionTool"/> from an <see cref="
AIFunctionDeclaration
"/>.</summary>
17
public static ConversationFunctionTool AsOpenAIConversationFunctionTool(this
AIFunctionDeclaration
function) =>
MicrosoftExtensionsAIResponsesExtensions.cs (2)
17
/// <summary>Creates an OpenAI <see cref="ResponseTool"/> from an <see cref="
AIFunctionDeclaration
"/>.</summary>
21
public static FunctionTool AsOpenAIResponseTool(this
AIFunctionDeclaration
function) =>
OpenAIAssistantsChatClient.cs (2)
280
internal static FunctionToolDefinition ToOpenAIAssistantsFunctionToolDefinition(
AIFunctionDeclaration
aiFunction, ChatOptions? options = null)
342
case
AIFunctionDeclaration
aiFunction:
OpenAIChatClient.cs (2)
94
internal static ChatTool ToOpenAIChatTool(
AIFunctionDeclaration
aiFunction, ChatOptions? options = null)
557
if (tool is
AIFunctionDeclaration
af)
OpenAIClientExtensions.cs (2)
180
/// <summary>Extracts from an <see cref="
AIFunctionDeclaration
"/> the parameters and strictness setting for use with OpenAI's APIs.</summary>
181
internal static BinaryData ToOpenAIFunctionParameters(
AIFunctionDeclaration
aiFunction, bool? strict)
OpenAIRealtimeConversationClient.cs (1)
11
public static ConversationFunctionTool ToOpenAIConversationFunctionTool(
AIFunctionDeclaration
aiFunction, ChatOptions? options = null)
OpenAIResponsesChatClient.cs (2)
349
internal static FunctionTool ToResponseTool(
AIFunctionDeclaration
aiFunction, ChatOptions? options = null)
412
case
AIFunctionDeclaration
aiFunction:
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
1123
var
declarationOnly = AIFunctionFactory.Create(() => "unused", "DefOnly").AsDeclarationOnly();
1149
var
defOnly = AIFunctionFactory.Create(() => "unused", "DefOnly").AsDeclarationOnly();
Functions\AIFunctionFactoryTest.cs (1)
939
AIFunctionDeclaration
f = AIFunctionFactory.CreateDeclaration("something", "amazing", schema);