* Normalize the message input to extract content and optional id. * Trims string content automatically.
(input: string | MultimodalContent)
| 798 | * Trims string content automatically. |
| 799 | */ |
| 800 | private normalizeMessageInput(input: string | MultimodalContent): { |
| 801 | content: string | Array<ContentPart> |
| 802 | id?: string |
| 803 | } { |
| 804 | if (typeof input === 'string') { |
| 805 | return { content: input.trim() } |
| 806 | } |
| 807 | return { content: input.content, id: input.id } |
| 808 | } |
| 809 | |
| 810 | /** |
| 811 | * Append a message and stream the response |