The image-to-text endpoint allows you to analyze an image and ask questions about its content via the WetroCloud API.

Request Example

from wetro import Wetrocloud

# Initialize the Wetrocloud client
client = Wetrocloud(api_key="your_api_key")

# Extract text from an image and answer questions about it
ocr_response = client.image_to_text(
    image_url = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQBQcwHfud1w3RN25Wgys6Btt_Y-4mPrD2kg&s",
    request_query="What animal is this?"
)
print(ocr_response)

Response Example

{
    "response": "This is a dog, specifically a Labrador Retriever.",
    "tokens": 1594,
    "success": true
}
FieldDescription
responseConversational response to the query.
tokensNumber of tokens used for processing.
successIndicates whether the query was successful.