MCPcopy Index your code
hub / github.com/anomalyco/opencode / formatContentTypes

Function formatContentTypes

packages/llm/src/protocols/shared.ts:285–289  ·  view source on GitHub ↗
(types: ReadonlyArray<ContentType>)

Source from the content-addressed store, hash-verified

283type ContentType = ContentPart["type"]
284
285const formatContentTypes = (types: ReadonlyArray<ContentType>) => {
286 if (types.length <= 1) return types[0] ?? ""
287 if (types.length === 2) return `${types[0]} and ${types[1]}`
288 return `${types.slice(0, -1).join(", ")}, and ${types.at(-1)}`
289}
290
291export const supportsContent = <const Type extends ContentType>(
292 part: ContentPart,

Callers 1

unsupportedContentFunction · 0.85

Calls 1

atMethod · 0.80

Tested by

no test coverage detected