MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / anthropicImageToDataUrl

Function anthropicImageToDataUrl

tools/model-gateway/server.mjs:641–653  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

639}
640
641function anthropicImageToDataUrl(block) {
642 const source = block?.source
643 if (!source) {
644 return null
645 }
646 if (source.type === 'base64' && source.data && source.media_type) {
647 return `data:${source.media_type};base64,${source.data}`
648 }
649 if (source.type === 'url' && source.url) {
650 return source.url
651 }
652 return null
653}
654
655function mapToolChoice(toolChoice) {
656 if (!toolChoice) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected