MCPcopy Index your code
hub / github.com/coder/coder / ToolResultToPart

Function ToolResultToPart

coderd/x/chatd/chatprompt/chatprompt.go:847–849  ·  view source on GitHub ↗

ToolResultToPart converts a tool call ID, raw result, error flag, and media flag into a ChatMessagePart. This is the minimal conversion used both during streaming and when reading from the database.

(toolCallID, toolName string, result json.RawMessage, isError bool, isMedia bool)

Source from the content-addressed store, hash-verified

845// conversion used both during streaming and when reading from the
846// database.
847func ToolResultToPart(toolCallID, toolName string, result json.RawMessage, isError bool, isMedia bool) codersdk.ChatMessagePart {
848 return codersdk.ChatMessageToolResult(toolCallID, toolName, result, isError, isMedia)
849}
850
851// toolResultContentToPart converts a fantasy ToolResultContent into a
852// ChatMessagePart.

Callers 1

toolResultContentToPartFunction · 0.85

Calls 1

ChatMessageToolResultFunction · 0.92

Tested by

no test coverage detected