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, )
| 134 | // WithAttachments stores durable attachment metadata on a tool response so the |
| 135 | // persistence layer can promote the files into assistant chat attachments. |
| 136 | func 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. |
no outgoing calls