Server Configuration
Describes the environment variables required to run the server.
Name | Required | Description | Default |
---|---|---|---|
SAVE_RESULTS | No | Whether to save OCR results | false |
GOOGLE_APPLICATION_CREDENTIALS | Yes | Path to Google application credentials JSON file |
Schema
Prompts
Interactive templates invoked by user choice
Name | Description |
---|---|
No prompts |
Resources
Contextual data attached and managed by the client
Name | Description |
---|---|
No resources |
Tools
Functions exposed to the LLM to take actions
Name | Description |
---|---|
ocr | Perform Optical Character Recognition (OCR) on the provided image file.
Args:
path (str): The absolute file path to the image on which OCR will be performed.
Returns:
str: The extracted text from the image.
Raises:
Exception: If an error occurs during the OCR process, it will be logged.
Notes:
- The function uses Google Cloud Vision API for text detection.
- If SAVE_RESULTS is enabled, the OCR results will be saved as a JSON file
in the same directory as the input image, with the same name but a .json extension. |