(file: A2AFileInput)
| 237 | } |
| 238 | |
| 239 | function filePart(file: A2AFileInput): Part { |
| 240 | return { |
| 241 | content: { $case: 'raw', value: Buffer.from(file.bytes) }, |
| 242 | metadata: undefined, |
| 243 | filename: file.name, |
| 244 | mediaType: file.mediaType, |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | /** Construct a user `Message` with a text part plus optional data and file parts. */ |
| 249 | export function buildUserMessage(opts: { |