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

Function ChatMessageToolResult

codersdk/chats.go:391–400  ·  view source on GitHub ↗

ChatMessageToolResult builds a tool-result chat message part. The isMedia flag marks the result as carrying binary media content (e.g. a screenshot) so that round-trip reconstruction preserves the media type instead of sending raw base64 as text tokens.

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

Source from the content-addressed store, hash-verified

389// (e.g. a screenshot) so that round-trip reconstruction preserves
390// the media type instead of sending raw base64 as text tokens.
391func ChatMessageToolResult(toolCallID, toolName string, result json.RawMessage, isError bool, isMedia bool) ChatMessagePart {
392 return ChatMessagePart{
393 Type: ChatMessagePartTypeToolResult,
394 ToolCallID: toolCallID,
395 ToolName: toolName,
396 Result: result,
397 IsError: isError,
398 IsMedia: isMedia,
399 }
400}
401
402// ChatMessageFile builds a file chat message part.
403func ChatMessageFile(fileID uuid.UUID, mediaType string, name string) ChatMessagePart {

Calls

no outgoing calls