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

Function WithAttachments

coderd/x/chatd/chattool/attachment.go:136–146  ·  view source on GitHub ↗

WithAttachments stores durable attachment metadata on a tool response so the persistence layer can promote the files into assistant chat attachments.

(
	response fantasy.ToolResponse,
	attachments ...AttachmentMetadata,
)

Source from the content-addressed store, hash-verified

134// WithAttachments stores durable attachment metadata on a tool response so the
135// persistence layer can promote the files into assistant chat attachments.
136func WithAttachments(
137 response fantasy.ToolResponse,
138 attachments ...AttachmentMetadata,
139) fantasy.ToolResponse {
140 if len(attachments) == 0 {
141 return response
142 }
143 return fantasy.WithResponseMetadata(response, attachmentResponseMetadata{
144 Attachments: attachments,
145 })
146}
147
148// AttachmentsFromMetadata decodes durable attachment metadata from a tool
149// response so the persistence layer can promote them into assistant file parts.

Calls

no outgoing calls