ChatToolCall Class

Represents a tool (function) call made by the assistant as part of a ChatMessage.

Inheritance

Object

ChatToolCall

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class ChatToolCall

Constructors

ChatToolCallLink to this section

Represents a tool (function) call made by the assistant as part of a ChatMessage.

Declaration
public ChatToolCall()

Properties

ApprovalRequestLink to this section

Gets or sets the approval request when the tool is an ApprovalRequiredAIFunction.

Declaration
public Microsoft.Extensions.AI.ToolApprovalRequestContent ApprovalRequest { get; set; }
Property Value
Type Description
Microsoft.Extensions.AI.ToolApprovalRequestContentGets or sets the approval request when the tool is an ApprovalRequiredAIFunction.

ApprovalResponseLink to this section

Gets or sets the user's answer to ApprovalRequest.

Declaration
public Microsoft.Extensions.AI.ToolApprovalResponseContent ApprovalResponse { get; set; }
Property Value
Type Description
Microsoft.Extensions.AI.ToolApprovalResponseContentGets or sets the user's answer to ApprovalRequest.

ArgumentsLink to this section

Gets or sets the arguments the model passed to the tool.

Declaration
public IDictionary<string, object> Arguments { get; set; }
Property Value
Type Description
IDictionary<string, object>Gets or sets the arguments the model passed to the tool.

CallIdLink to this section

Gets or sets the identifier of the call assigned by the model.

Declaration
public string CallId { get; set; }
Property Value
Type Description
stringGets or sets the identifier of the call assigned by the model.

ExceptionLink to this section

Gets or sets the exception thrown by the tool, if any.

Declaration
public Exception Exception { get; set; }
Property Value
Type Description
ExceptionGets or sets the exception thrown by the tool, if any.

FormattedArgumentsLink to this section

Gets the arguments formatted as name: value pairs for display.

Declaration
public string FormattedArguments { get; }
Type Description
stringGets the arguments formatted as name: value pairs for display.

FormattedArgumentsJsonLink to this section

Gets the arguments formatted as indented JSON for display.

Declaration
public string FormattedArgumentsJson { get; }
Property Value
Type Description
stringGets the arguments formatted as indented JSON for display.

FormattedResultLink to this section

Gets the result formatted for display: indented JSON for structured results, the text itself for strings.

Declaration
public string FormattedResult { get; }
Property Value
Type Description
stringGets the result formatted for display: indented JSON for structured results, the text itself for strings.

NameLink to this section

Gets or sets the name of the tool.

Declaration
public string Name { get; set; }
Property Value
Type Description
stringGets or sets the name of the tool.

ResultLink to this section

Gets or sets the result returned by the tool. Functions created with AIFunctionFactory return a JsonElement.

Declaration
public object Result { get; set; }
Property Value
Type Description
objectGets or sets the result returned by the tool. Functions created with AIFunctionFactory return a JsonElement.

StatusLink to this section

Gets or sets the status of the call.

Declaration
public ChatToolCallStatus Status { get; set; }
Property Value
Type Description
ChatToolCallStatusGets or sets the status of the call.

TextPositionLink to this section

Gets or sets the position of the call in Content: the number of characters the assistant had written when it made the call. GetParts uses it to keep text and tool calls in the order they were produced. Defaults to 0, which places the call before the text.

Declaration
public int TextPosition { get; set; }
Property Value
Type Description
intGets or sets the position of the call in Content: the number of characters the assistant had written when it made the call. GetParts uses it to keep text and tool calls in the order they were produced. Defaults to 0, which places the call before the text.

Methods

GetResultLink to this section

Deserializes Result to T. Returns default when there is no result.

Declaration
public T GetResult(Text.Json.JsonSerializerOptions options)
Parameters
Type Name Description
Text.Json.JsonSerializerOptions options Optional serializer options. Defaults to DefaultOptions.
Returns
Type Description
T
An error has occurred. This app may no longer respond until reloaded. Reload 🗙