StripInternal removes internal-only fields that must not be sent to API clients. Call before publishing via REST or SSE. Note: ArgsDelta, ResultDelta, and ResultReset are intentionally preserved. They are streaming-only fields consumed by the frontend via SSE message_part events. ArgsDelta is produ
()
| 353 | // chatloop; ResultDelta and ResultReset are produced by the advisor |
| 354 | // streaming callbacks in chatd. |
| 355 | func (p *ChatMessagePart) StripInternal() { |
| 356 | p.ProviderMetadata = nil |
| 357 | if p.FileID.Valid { |
| 358 | p.Data = nil |
| 359 | } |
| 360 | p.ContextFileContent = "" |
| 361 | p.ContextFileOS = "" |
| 362 | p.ContextFileDirectory = "" |
| 363 | p.SkillDir = "" |
| 364 | p.ContextFileSkillMetaFile = "" |
| 365 | } |
| 366 | |
| 367 | // ChatMessageText builds a text chat message part. |
| 368 | func ChatMessageText(text string) ChatMessagePart { |
no outgoing calls