Share via


OpenAIPluginCollectionExtensions.TryGetFunctionAndArguments Method

Definition

Overloads

TryGetFunctionAndArguments(IReadOnlyKernelPluginCollection, ChatCompletionsFunctionToolCall, KernelFunction, KernelArguments)

Given an OpenAIFunctionToolCall object, tries to retrieve the corresponding KernelFunction and populate KernelArguments with its parameters.

TryGetFunctionAndArguments(IReadOnlyKernelPluginCollection, OpenAIFunctionToolCall, KernelFunction, KernelArguments)

Given an OpenAIFunctionToolCall object, tries to retrieve the corresponding KernelFunction and populate KernelArguments with its parameters.

TryGetFunctionAndArguments(IReadOnlyKernelPluginCollection, ChatCompletionsFunctionToolCall, KernelFunction, KernelArguments)

Given an OpenAIFunctionToolCall object, tries to retrieve the corresponding KernelFunction and populate KernelArguments with its parameters.

public static bool TryGetFunctionAndArguments (this Microsoft.SemanticKernel.IReadOnlyKernelPluginCollection plugins, Azure.AI.OpenAI.ChatCompletionsFunctionToolCall functionToolCall, out Microsoft.SemanticKernel.KernelFunction? function, out Microsoft.SemanticKernel.KernelArguments? arguments);
static member TryGetFunctionAndArguments : Microsoft.SemanticKernel.IReadOnlyKernelPluginCollection * Azure.AI.OpenAI.ChatCompletionsFunctionToolCall * KernelFunction * KernelArguments -> bool
<Extension()>
Public Function TryGetFunctionAndArguments (plugins As IReadOnlyKernelPluginCollection, functionToolCall As ChatCompletionsFunctionToolCall, ByRef function As KernelFunction, ByRef arguments As KernelArguments) As Boolean

Parameters

plugins
IReadOnlyKernelPluginCollection

The plugins.

functionToolCall
Azure.AI.OpenAI.ChatCompletionsFunctionToolCall

The OpenAIFunctionToolCall object.

function
KernelFunction

When this method returns, the function that was retrieved if one with the specified name was found; otherwise, null

arguments
KernelArguments

When this method returns, the arguments for the function; otherwise, null

Returns

true if the function was found; otherwise, false.

Applies to

TryGetFunctionAndArguments(IReadOnlyKernelPluginCollection, OpenAIFunctionToolCall, KernelFunction, KernelArguments)

Given an OpenAIFunctionToolCall object, tries to retrieve the corresponding KernelFunction and populate KernelArguments with its parameters.

public static bool TryGetFunctionAndArguments (this Microsoft.SemanticKernel.IReadOnlyKernelPluginCollection plugins, Microsoft.SemanticKernel.Connectors.OpenAI.OpenAIFunctionToolCall functionToolCall, out Microsoft.SemanticKernel.KernelFunction? function, out Microsoft.SemanticKernel.KernelArguments? arguments);
static member TryGetFunctionAndArguments : Microsoft.SemanticKernel.IReadOnlyKernelPluginCollection * Microsoft.SemanticKernel.Connectors.OpenAI.OpenAIFunctionToolCall * KernelFunction * KernelArguments -> bool
<Extension()>
Public Function TryGetFunctionAndArguments (plugins As IReadOnlyKernelPluginCollection, functionToolCall As OpenAIFunctionToolCall, ByRef function As KernelFunction, ByRef arguments As KernelArguments) As Boolean

Parameters

plugins
IReadOnlyKernelPluginCollection

The plugins.

functionToolCall
OpenAIFunctionToolCall

The OpenAIFunctionToolCall object.

function
KernelFunction

When this method returns, the function that was retrieved if one with the specified name was found; otherwise, null

arguments
KernelArguments

When this method returns, the arguments for the function; otherwise, null

Returns

true if the function was found; otherwise, false.

Applies to