fix: ensure images read by agent dont count against quota (#22168)
This commit is contained in:
parent
3729fd5706
commit
8b9b9ad31e
2 changed files with 22 additions and 4 deletions
|
|
@ -25,6 +25,8 @@ interface FetchDecompressionError extends Error {
|
|||
}
|
||||
|
||||
export namespace MessageV2 {
|
||||
export const SYNTHETIC_ATTACHMENT_PROMPT = "Attached image(s) from tool result:"
|
||||
|
||||
export function isMedia(mime: string) {
|
||||
return mime.startsWith("image/") || mime === "application/pdf"
|
||||
}
|
||||
|
|
@ -808,7 +810,7 @@ export namespace MessageV2 {
|
|||
parts: [
|
||||
{
|
||||
type: "text" as const,
|
||||
text: "Attached image(s) from tool result:",
|
||||
text: SYNTHETIC_ATTACHMENT_PROMPT,
|
||||
},
|
||||
...media.map((attachment) => ({
|
||||
type: "file" as const,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue