MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / formatImagesIntoBlocks

Function formatImagesIntoBlocks

src/core/prompts/responses.ts:205–217  ·  view source on GitHub ↗
(images?: string[])

Source from the content-addressed store, hash-verified

203
204// to avoid circular dependency
205const formatImagesIntoBlocks = (images?: string[]): Anthropic.ImageBlockParam[] => {
206 return images
207 ? images.map((dataUrl) => {
208 // data:image/png;base64,base64string
209 const [rest, base64] = dataUrl.split(",")
210 const mimeType = rest.split(":")[1].split(";")[0]
211 return {
212 type: "image",
213 source: { type: "base64", media_type: mimeType, data: base64 },
214 } as Anthropic.ImageBlockParam
215 })
216 : []
217}
218
219const toolUseInstructionsReminderNative = `# Reminder: Instructions for Tool Use
220

Callers 1

responses.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected