Skip to main content

extract_text

Method
This is a method of the VisionAgent class in the vision_agent module.
Extract text from an image (OCR-like functionality).

Signature

def extract_text(image: str, detail: Optional[str], model: Optional[str]) -> str

Parameters

image
str
required
Image URL or local file path
detail
Optional
Detail level (low, high, auto) - recommend “high” for text
model
Optional
Override model for this call **kwargs: Additional parameters

Returns

Returns
str
Extracted text

Usage

agent = VisionAgent()
    text = agent.extract_text("document.png", detail="high")
    print(text)