MCPcopy Create free account
hub / github.com/anomalyco/opencode / documentBlock

Function documentBlock

packages/llm/src/protocols/utils/bedrock-media.ts:52–58  ·  view source on GitHub ↗
(part: MediaPart, format: DocumentFormat, bytes: string)

Source from the content-addressed store, hash-verified

50} as const satisfies Record<string, DocumentFormat>
51
52const documentBlock = (part: MediaPart, format: DocumentFormat, bytes: string): DocumentBlock => ({
53 document: {
54 format,
55 name: part.filename ?? `document.${format}`,
56 source: { bytes },
57 },
58})
59
60// Route by MIME. Known image/document formats lower into a typed block; anything
61// else fails with a clear error instead of silently degrading to a malformed

Callers 1

bedrock-media.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected