Extract Text • AI Agent SDK
extract_text: Extract text from an image (OCR-like functionality).
extract_text
Method
</div>
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]) -> strParameters
ParamField
strImage URL or local file path
ParamField
Optional[str]Detail level (low, high, auto) – recommend “high” for text
ParamField
Optional[str]Override model for this call **kwargs: Additional parameters
Returns
ResponseField
strExtracted text
Usage
agent = VisionAgent()
text = agent.extract_text("document.png", detail="high")
print(text)Uses
analyze
Source
View on GitHubpraisonaiagents/agent/vision_agent.py at line 355