Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultMaxFiles = 20 DefaultMaxTotalBytes = int64(50_000_000) DefaultMaxPDFBytes = int64(25_000_000) DefaultMaxExtractedChars = 200_000 )
Variables ¶
This section is empty.
Functions ¶
func ExtractPDFText ¶
ExtractPDFText performs a best-effort text extraction for simple PDFs without external binaries. It scans raw and Flate-compressed streams for PDF string drawing operators. Complex/encrypted/scanned PDFs may still require native PDF model input or OCR.
func ImageMimeFromExt ¶
func IsInlineTextFile ¶
func SniffImageMime ¶
Types ¶
type AttachedFile ¶
type ResolvedUserInput ¶
type ResolvedUserInput struct {
Text string
Attachments []ai.ContentBlock
Warnings []string
Attached []AttachedFile
}
func ResolveUserInput ¶
func ResolveUserInput(text string, opts Options) ResolvedUserInput
ResolveUserInput finds local file references in user text, inlines readable text files, and returns image/PDF content blocks plus warnings for anything that looked like a reference but could not be used.
Click to show internal directories.
Click to hide internal directories.