FunctionInvokingChatClient.TerminateOnUnknownCalls Property
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.
Gets or sets a value indicating whether a request to call an unknown function should terminate the function calling loop.
public:
property bool TerminateOnUnknownCalls { bool get(); void set(bool value); };
public bool TerminateOnUnknownCalls { get; set; }
member this.TerminateOnUnknownCalls : bool with get, set
Public Property TerminateOnUnknownCalls As Boolean
Property Value
true to terminate the function calling loop and return the response if a request to call a tool
that isn't available to the FunctionInvokingChatClient is received; false to create and send a
function result message to the inner client stating that the tool couldn't be found. The default is false.
Remarks
When false, call requests to any tools that aren't available to the FunctionInvokingChatClient will result in a response message automatically being created and returned to the inner client stating that the tool couldn't be found. This behavior can help in cases where a model hallucinates a function, but it's problematic if the model has been made aware of the existence of tools outside of the normal mechanisms, and requests one of those. AdditionalTools can be used to help with that. But if instead the consumer wants to know about all function call requests that the client can't handle, TerminateOnUnknownCalls can be set to true. Upon receiving a request to call a function that the FunctionInvokingChatClient doesn't know about, it will terminate the function calling loop and return the response, leaving the handling of the function call requests to the consumer of the client.
AITools that the FunctionInvokingChatClient is aware of (for example, because they're in Tools or AdditionalTools) but that aren't AIFunctions aren't considered unknown, just not invocable. Any requests to a non-invocable tool will also result in the function calling loop terminating, regardless of TerminateOnUnknownCalls.