Class ToolMessage
API don't send these anymore. It is only used to send the tool outputs from the 'client' side.
public class ToolMessage : Message, IPromptWithFiles, IPrompt, IModeratable
- Inheritance
-
objectToolMessage
- Implements
- Inherited Members
- Extension Methods
Constructors
ToolMessage()
public ToolMessage()
ToolMessage(MessageContent)
public ToolMessage(MessageContent content)
Parameters
contentMessageContent
ToolMessage(string, string)
public ToolMessage(string toolCallId, string result)
Parameters
toolCallIdstringresultstring
Properties
Role
The role of the messages author.
Role is abstract and overridden in derived classes to enforce consistency.
This avoids relying on constructor or deserialization logic to set the role.
JSON.NET does not call parameterized constructors or set get-only properties during deserialization.
public override ChatRole Role { get; }
Property Value
ToolCallId
Required. The ID of the tool call that produced this output.
public string ToolCallId { get; set; }
Property Value
- string
Operators
implicit operator string(ToolMessage)
public static implicit operator string(ToolMessage message)
Parameters
messageToolMessage
Returns
- string