AIFunctionFactory.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Create(Delegate, AIFunctionFactoryCreateOptions) |
Creates an AIFunction instance for a method, specified via a delegate. |
Create(MethodInfo, Object, AIFunctionFactoryCreateOptions) |
Creates an AIFunction instance for a method, specified via an MethodInfo instance and an optional target object if the method is an instance method. |
Create(Delegate, String, String, JsonSerializerOptions) |
Creates an AIFunction instance for a method, specified via a delegate. |
Create(MethodInfo, Object, String, String, JsonSerializerOptions) |
Creates an AIFunction instance for a method, specified via an MethodInfo instance and an optional target object if the method is an instance method. |
Create(Delegate, AIFunctionFactoryCreateOptions)
Creates an AIFunction instance for a method, specified via a delegate.
public:
static Microsoft::Extensions::AI::AIFunction ^ Create(Delegate ^ method, Microsoft::Extensions::AI::AIFunctionFactoryCreateOptions ^ options);
public static Microsoft.Extensions.AI.AIFunction Create (Delegate method, Microsoft.Extensions.AI.AIFunctionFactoryCreateOptions? options);
static member Create : Delegate * Microsoft.Extensions.AI.AIFunctionFactoryCreateOptions -> Microsoft.Extensions.AI.AIFunction
Public Shared Function Create (method As Delegate, options As AIFunctionFactoryCreateOptions) As AIFunction
Parameters
- method
- Delegate
The method to be represented via the created AIFunction.
- options
- AIFunctionFactoryCreateOptions
Metadata to use to override defaults inferred from method
.
Returns
The created AIFunction for invoking method
.
Applies to
Create(MethodInfo, Object, AIFunctionFactoryCreateOptions)
Creates an AIFunction instance for a method, specified via an MethodInfo instance and an optional target object if the method is an instance method.
public:
static Microsoft::Extensions::AI::AIFunction ^ Create(System::Reflection::MethodInfo ^ method, System::Object ^ target, Microsoft::Extensions::AI::AIFunctionFactoryCreateOptions ^ options);
public static Microsoft.Extensions.AI.AIFunction Create (System.Reflection.MethodInfo method, object? target, Microsoft.Extensions.AI.AIFunctionFactoryCreateOptions? options);
static member Create : System.Reflection.MethodInfo * obj * Microsoft.Extensions.AI.AIFunctionFactoryCreateOptions -> Microsoft.Extensions.AI.AIFunction
Public Shared Function Create (method As MethodInfo, target As Object, options As AIFunctionFactoryCreateOptions) As AIFunction
Parameters
- method
- MethodInfo
The method to be represented via the created AIFunction.
- target
- Object
The target object for the method
if it represents an instance method.
This should be null
if and only if method
is a static method.
- options
- AIFunctionFactoryCreateOptions
Metadata to use to override defaults inferred from method
.
Returns
The created AIFunction for invoking method
.
Applies to
Create(Delegate, String, String, JsonSerializerOptions)
Creates an AIFunction instance for a method, specified via a delegate.
public static Microsoft.Extensions.AI.AIFunction Create (Delegate method, string? name = default, string? description = default, System.Text.Json.JsonSerializerOptions? serializerOptions = default);
static member Create : Delegate * string * string * System.Text.Json.JsonSerializerOptions -> Microsoft.Extensions.AI.AIFunction
Public Shared Function Create (method As Delegate, Optional name As String = Nothing, Optional description As String = Nothing, Optional serializerOptions As JsonSerializerOptions = Nothing) As AIFunction
Parameters
- method
- Delegate
The method to be represented via the created AIFunction.
- name
- String
The name to use for the AIFunction.
- description
- String
The description to use for the AIFunction.
- serializerOptions
- JsonSerializerOptions
The JsonSerializerOptions used to marshal function parameters and any return value.
Returns
The created AIFunction for invoking method
.
Applies to
Create(MethodInfo, Object, String, String, JsonSerializerOptions)
Creates an AIFunction instance for a method, specified via an MethodInfo instance and an optional target object if the method is an instance method.
public static Microsoft.Extensions.AI.AIFunction Create (System.Reflection.MethodInfo method, object? target, string? name = default, string? description = default, System.Text.Json.JsonSerializerOptions? serializerOptions = default);
static member Create : System.Reflection.MethodInfo * obj * string * string * System.Text.Json.JsonSerializerOptions -> Microsoft.Extensions.AI.AIFunction
Public Shared Function Create (method As MethodInfo, target As Object, Optional name As String = Nothing, Optional description As String = Nothing, Optional serializerOptions As JsonSerializerOptions = Nothing) As AIFunction
Parameters
- method
- MethodInfo
The method to be represented via the created AIFunction.
- target
- Object
The target object for the method
if it represents an instance method.
This should be null
if and only if method
is a static method.
- name
- String
The name to use for the AIFunction.
- description
- String
The description to use for the AIFunction.
- serializerOptions
- JsonSerializerOptions
The JsonSerializerOptions used to marshal function parameters and return value.
Returns
The created AIFunction for invoking method
.