Table of Contents

Class ToolCallResult

Namespace
RDCore.SDK.Assistant
Assembly
RDCore.SDK.Protocol.dll

What a call of a tool answers: a text for an assistant to read, and the same result as structured data where the tool has an OutputSchema.

public record ToolCallResult : IEquatable<ToolCallResult>
Inheritance
ToolCallResult
Implements
Derived
Inherited Members

Remarks

Text in a result that comes from the workspace (comments, strings, names) is data the code holds, and a result says it as such.

Properties

Content

What the call answers, for an assistant to read.

public IReadOnlyList<ToolContent> Content { get; init; }

Property Value

IReadOnlyList<ToolContent>

IsError

Whether the tool refused the call: Content says why.

public bool IsError { get; init; }

Property Value

bool

StructuredContent

The result as data, as the tool's OutputSchema describes it; null for a result in text alone, and for a refusal.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public JsonObject? StructuredContent { get; init; }

Property Value

JsonObject

Methods

Of(string, JsonObject?)

A result in text alone.

public static ToolCallResult Of(string text, JsonObject? structured = null)

Parameters

text string

What the call answers.

structured JsonObject

The same result as data; null for none.

Returns

ToolCallResult

The result.

Refusal(string)

A refusal: the call did nothing, for the reason given.

public static ToolCallResult Refusal(string reason)

Parameters

reason string

Why, for an assistant to read.

Returns

ToolCallResult

The result.