Skip to content

Variable: DocumentSourceType

@providerprotocol/ai


@providerprotocol/ai / @providerprotocol/ai / DocumentSourceType

const DocumentSourceType: object

Defined in: src/types/content.ts:128

Document source type constants.

readonly Base64: "base64" = 'base64'

Base64-encoded document data (for PDFs)

readonly Text: "text" = 'text'

Plain text document content

readonly Url: "url" = 'url'

URL reference to document (for PDFs)

import { DocumentSourceType } from 'upp';
if (source.type === DocumentSourceType.Base64) {
// Handle base64 encoded document (PDF)
} else if (source.type === DocumentSourceType.Url) {
// Handle URL reference (PDF)
} else if (source.type === DocumentSourceType.Text) {
// Handle plain text document
}