# PDFSearchTool with Azure OpenAI

**URL:** <https://community.crewai.com/t/pdfsearchtool-with-azure-openai/2468>\
**Category:** CrewAI Community Support\
**Tags:** tools\_issues\
**Created:** [January 4, 2025, 12:21pm UTC](https://community.crewai.com/t/pdfsearchtool-with-azure-openai/2468 "2025-01-04T12:21:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qaissul](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/qaissul/32/1812_2.png) [@Qaissul](https://community.crewai.com/u/Qaissul)\
**Post date:** [January 4, 2025, 12:21pm UTC](https://community.crewai.com/t/pdfsearchtool-with-azure-openai/2468/1 "2025-01-04T12:21:26Z")

</div>

Hello there,  
I have an issue when trying to use the PDFSearchTool with Azure OpenAI.  
Here is my code:

```
pdf_search_tool = PDFSearchTool(
config=dict( 
    llm=dict(
        provider="azure_openai", 
        config=dict(
            model=f"azure/{deployment_name}", 
            api_key=api_key,
            base_url=azure_endpoint, 
        ), 
    ),
    embedder=dict( 
        provider="azure_openai", 
        config=dict(
            model="azure/xxx_embedding_model", 
            api_key = api_key, 
            api_base=azure_endpoint # HERE I tried multiple (s. below)
        ),
    ),
),
pdf='myPDFfile.pdf'

```

)

With the code above I get the following error:  
BaseEmbedderConfig. **init** () got an unexpected keyword argument ‘base\_url’  
File

Alnternatively, I also used azure\_endpoint with the error:  
Key ‘config’ error:  
Wrong key ‘azure\_endpoint’ in {‘model’: ‘azure/xxx.openai.azure.com/’})

I also tried api\_base with the error:  
Value error, Must provide one of the `base_url` or `azure_endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable [type=value\_error, input\_value={‘deployment’: None, 'htt…one, ‘model\_kwargs’: {}}, input\_type=dict]

My ChatModel seems to work but my embedding not… Can anyone help?

---

<div class="post-metadata">

**Author:** ![matt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/matt/32/3_2.png) [@matt](https://community.crewai.com/u/matt)\
**Post date:** [January 5, 2025, 12:23am UTC](https://community.crewai.com/t/pdfsearchtool-with-azure-openai/2468/2 "2025-01-05T00:23:18Z")

</div>

> **[Configuring Azure OpenAI with CrewAI: A Comprehensive Guide](https://blog.crewai.com/configuring-azure-openai-with-crewai-a-comprehensive-guide/)**
>
> A step-by-step guide to set up and configure Azure OpenAI within CrewAI framework for your AI Agents.

See if this helps

---

<div class="post-metadata">

**Author:** ![Qaissul](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/qaissul/32/1812_2.png) [@Qaissul](https://community.crewai.com/u/Qaissul)\
**Post date:** [January 7, 2025, 1:10pm UTC](https://community.crewai.com/t/pdfsearchtool-with-azure-openai/2468/3 "2025-01-07T13:10:23Z")

</div>

Dear matt, thanks for the answer. The Configuration of Azure OpenAI works as I can run crews without any tools successfully. So the question is related to the configuration of PDFSearchTool (especially for the embedder) as the documentation ([PDF RAG Search - CrewAI](https://docs.crewai.com/tools/pdfsearchtool)) or any other article in the web did not help… Thanks and advance!
