(mediaType string)
| 1330 | } |
| 1331 | |
| 1332 | func formatMissingAttachmentText(mediaType string) string { |
| 1333 | const missingAttachmentBody = "[missing-attachment] The user attached a file here, but the content has expired and is no longer available." |
| 1334 | const missingAttachmentAction = " If you need to inspect it, ask the user to re-upload." |
| 1335 | |
| 1336 | if parsedMediaType, _, err := mime.ParseMediaType(mediaType); err == nil { |
| 1337 | mediaType = parsedMediaType |
| 1338 | } |
| 1339 | mediaType = strings.TrimSpace(mediaType) |
| 1340 | if mediaType == "" || mediaType == "application/octet-stream" { |
| 1341 | return missingAttachmentBody + missingAttachmentAction |
| 1342 | } |
| 1343 | return fmt.Sprintf( |
| 1344 | "%s Reported MIME type: %s.%s", |
| 1345 | missingAttachmentBody, |
| 1346 | mediaType, |
| 1347 | missingAttachmentAction, |
| 1348 | ) |
| 1349 | } |
| 1350 | |
| 1351 | // fileReferencePartToText formats a file-reference SDK part as |
| 1352 | // plain text for LLM consumption. LLMs don't understand |
no outgoing calls
no test coverage detected