MCPcopy Create free account
hub / github.com/coder/coder / safeAsToolResultPart

Function safeAsToolResultPart

coderd/x/chatd/chatprompt/chatprompt.go:51–61  ·  view source on GitHub ↗
(part fantasy.MessagePart)

Source from the content-addressed store, hash-verified

49}
50
51func safeAsToolResultPart(part fantasy.MessagePart) (fantasy.ToolResultPart, bool) {
52 var zero fantasy.ToolResultPart
53 if part == nil {
54 return zero, false
55 }
56 if value, ok := part.(*fantasy.ToolResultPart); ok && value == nil {
57 return zero, false
58 }
59 type toolResultPart = fantasy.ToolResultPart
60 return fantasy.AsMessagePart[toolResultPart](part)
61}
62
63// FileData holds resolved file content for LLM prompt building.
64type FileData struct {

Callers 2

injectMissingToolResultsFunction · 0.85
injectMissingToolUsesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected