Variable: DocumentSourceType
@providerprotocol/ai / @providerprotocol/ai / DocumentSourceType
Variable: DocumentSourceType
Section titled “Variable: DocumentSourceType”
constDocumentSourceType:object
Defined in: src/types/content.ts:128
Document source type constants.
Type Declaration
Section titled “Type Declaration”Base64
Section titled “Base64”
readonlyBase64:"base64"='base64'
Base64-encoded document data (for PDFs)
readonlyText:"text"='text'
Plain text document content
readonlyUrl:"url"='url'
URL reference to document (for PDFs)
Example
Section titled “Example”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}