I am trying to use PDFSearchTool with below conf:
pdf_search_tool = PDFSearchTool(
pdf=‘abc.pdf’,
config= {
“llm”: {
“provider”: “azure_openai”,
“config”: {
“api_key”: “xxx”,
“model”: “gpt-4o”,
“temperature”: 0.75,
“max_tokens”: 1024,
“deployment_name”: “xxx”
}
},
“embedder”: {
“provider”: “azure_openai”,
“config”: {
“api_key”: “xxx”,
“model”: “text-embedding-ada-002”,
“deployment_name”: “xxx”
}
}
}
)
This gives me below error:
File “.venv/lib/python3.12/site-packages/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py”, line 31, in init
super().init(**kwargs)
File “.venv/lib/python3.12/site-packages/pydantic/main.py”, line 212, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for PDFSearchTool
Value error, As of openai>=1.0.0, Azure endpoints should be specified via the azure_endpoint
param not openai_api_base
(or alias base_url
). [type=value_error, input_value={‘deployment’: 'text-embe…one, ‘model_kwargs’: {}}, input_type=dict]
For further information visit Redirecting...
An error occurred while running the crew: Command ‘[‘uv’, ‘run’, ‘run_crew’]’ returned non-zero exit status 1.
Here are my env variables:
OPENAI_API_KEY=“”
OPENAI_API_BASE=“”
OPENAI_API_MODEL=“”
OPENAI_API_VERSION=“”
OPENAI_API_TYPE=“azure”
AZURE_OPENAI_ENDPOINT=“”
AZURE_OPENAI_KEY=“”
crewai version:
crewai 0.76.2
crewai-tools 0.13.2