Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RoleUser represents a user message. A message with this role would only contain text or resource content. RoleUser Role = "user" // RoleAssistant represents an assistant message. A message with this role would contain // all types of content but resource. RoleAssistant Role = "assistant" // ContentTypeText represents text content. ContentTypeText ContentType = "text" // ContentTypeResource represents a resource content. ContentTypeResource ContentType = "resource" // ContentTypeCallTool represents a call to a tool. ContentTypeCallTool ContentType = "call_tool" // ContentTypeToolResult represents the result of a tool call. ContentTypeToolResult ContentType = "tool_result" )
Variables ¶
This section is empty.
Functions ¶
func RenderContents ¶
RenderContents renders contents into a markdown string.
Types ¶
type Chat ¶
Chat represents a conversation container in the chat system. It provides basic identification and labeling capabilities for organizing message threads.
type Content ¶
type Content struct { Type ContentType // Text would be filled if Type is ContentTypeText. Text string // ResourceContents would be filled if Type is ContentTypeResource. ResourceContents []mcp.ResourceContents // ToolName would be filled if Type is ContentTypeCallTool. ToolName string // ToolInput would be filled if Type is ContentTypeCallTool. ToolInput json.RawMessage // ToolResult would be filled if Type is ContentTypeToolResult. The value would be either tool result or error. ToolResult json.RawMessage // CallToolID would be filled if Type is ContentTypeCallTool or ContentTypeToolResult. CallToolID string // CallToolFailed is a flag indicating if the call tool failed. // This flag would be set to true if the call tool failed and Type is ContentTypeToolResult. CallToolFailed bool }
Content is a message content with its type.
Click to show internal directories.
Click to hide internal directories.