Represents a tool (function) call made by the assistant as part of a ChatMessage.
Object
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class ChatToolCallRepresents a tool (function) call made by the assistant as part of a ChatMessage.
public ChatToolCall()Gets or sets the approval request when the tool is an ApprovalRequiredAIFunction.
public Microsoft.Extensions.AI.ToolApprovalRequestContent ApprovalRequest { get; set; }
| Type | Description |
|---|---|
| Microsoft.Extensions.AI.ToolApprovalRequestContent | Gets or sets the approval request when the tool is an ApprovalRequiredAIFunction. |
Gets or sets the user's answer to ApprovalRequest.
public Microsoft.Extensions.AI.ToolApprovalResponseContent ApprovalResponse { get; set; }
| Type | Description |
|---|---|
| Microsoft.Extensions.AI.ToolApprovalResponseContent | Gets or sets the user's answer to ApprovalRequest. |
Gets or sets the arguments the model passed to the tool.
public IDictionary<string, object> Arguments { get; set; }
| Type | Description |
|---|---|
| IDictionary<string, object> | Gets or sets the arguments the model passed to the tool. |
Gets or sets the identifier of the call assigned by the model.
public string CallId { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the identifier of the call assigned by the model. |
Gets or sets the exception thrown by the tool, if any.
public Exception Exception { get; set; }
| Type | Description |
|---|---|
| Exception | Gets or sets the exception thrown by the tool, if any. |
Gets the arguments formatted as name: value pairs for display.
public string FormattedArguments { get; }
| Type | Description |
|---|---|
| string | Gets the arguments formatted as name: value pairs for display. |
Gets the arguments formatted as indented JSON for display.
public string FormattedArgumentsJson { get; }
| Type | Description |
|---|---|
| string | Gets the arguments formatted as indented JSON for display. |
Gets the result formatted for display: indented JSON for structured results, the text itself for strings.
public string FormattedResult { get; }
| Type | Description |
|---|---|
| string | Gets the result formatted for display: indented JSON for structured results, the text itself for strings. |
Gets or sets the name of the tool.
public string Name { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the name of the tool. |
Gets or sets the result returned by the tool. Functions created with AIFunctionFactory return a JsonElement.
public object Result { get; set; }
| Type | Description |
|---|---|
| object | Gets or sets the result returned by the tool. Functions created with AIFunctionFactory return a JsonElement. |
Gets or sets the status of the call.
public ChatToolCallStatus Status { get; set; }
| Type | Description |
|---|---|
| ChatToolCallStatus | Gets or sets the status of the call. |
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.
public int TextPosition { get; set; }
| Type | Description |
|---|---|
| int | 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. |
Deserializes Result to T. Returns default when there is no result.
public T GetResult(Text.Json.JsonSerializerOptions options)
| Type | Name | Description |
|---|---|---|
| Text.Json.JsonSerializerOptions | options | Optional serializer options. Defaults to DefaultOptions. |
| Type | Description |
|---|---|
| T |