MCPcopy Create free account
hub / github.com/Effect-TS/effect / getDocumentMetadata

Function getDocumentMetadata

packages/ai/anthropic/src/AnthropicLanguageModel.ts:1678–1690  ·  view source on GitHub ↗
(part: Prompt.FilePart)

Source from the content-addressed store, hash-verified

1676): typeof Generated.CacheControlEphemeral.Encoded | undefined => part.options.anthropic?.cacheControl
1677
1678const getDocumentMetadata = (part: Prompt.FilePart): {
1679 readonly title: string | undefined
1680 readonly context: string | undefined
1681} | undefined => {
1682 const options = part.options.anthropic
1683 if (Predicate.isNotUndefined(options)) {
1684 return {
1685 title: options.documentTitle,
1686 context: options.documentContext
1687 }
1688 }
1689 return undefined
1690}
1691
1692const shouldEnableCitations = (part: Prompt.FilePart): boolean => part.options.anthropic?.citations?.enabled ?? false
1693

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected