Agent Level Knowledge not working with Azure OpenAI

I am using Azure OpenAI and have build a really basic agent, just copied the documentation, and am trying to add a knowledge source to it using CrewDoclingSource as seen below:

llm = LLM(
    model="azure/gpt-4o-global",
    api_version="2024-10-21",
	api_key="key",
	base_url="https://ai-subdomain.openai.azure.com/"
)

nelson_source = CrewDoclingSource(
    file_paths=['/talks.docx'],
)

researcher = Agent(
    role="Researcher",
    goal="Conduct thorough research and analysis on AI and AI agents",
    backstory="You're an expert researcher, specialized in technology, software engineering, AI, and startups. You work as a freelancer and are currently researching for a new client.",
    allow_delegation=False,
    llm=llm,
    verbose=True,
    knowledge_sources=[
        		nelson_source
    		]
)

(Note my code has the actual api key in LLM)

If I don’t put the knowledge source the crew runs just fine, and if I do knowledge at the crew level it works fine, but if I try to add the knowledge to the agent directly I get an error:

pydantic_core._pydantic_core.ValidationError: 1 validation error for Agent
Value error, Invalid Knowledge Configuration: Please provide an OpenAI API key. You can get one at https://platform.openai.com/account/api-keys [type=value_error, input_value={‘role’: ‘Researcher’, 'g…t 0x00000246E2CD7F80>)]}, input_type=dict]
For further information visit Redirecting...

It seems to want to understand the knowledge base by using regular OpenAI even though I am using Azure OpenAI. I have tried adding llm inside the docling source, I have tried adding embedding to the crew, I have tried adding a fake OpenAI api key, I have tried it in the crew class format and the individual object format seen above.

I am just kind of at a loss and wondering if agent level knowledge is only supported by regular OpenAI and thats just the way it is, or if I am doing something wrong. Any guidance would be appreciated.

Try running the following code and be sure there is not a default OPENAI key still lurking in your ENV

image

also I see two other potential issues. I do not see CrewDoclingSource as one of the tools available - however if I search for it there is an example code returned. Have you tried one of the other tools listed here:

Tools - CrewAI

For example the combo of:
docs_tool = DirectoryReadTool(directory='./blog-posts')
file_tool = FileReadTool()

There are notes that some of the tools assume OPENAI, but can be customized to use a different source of LLM such as Azure. For example, here you can see how a Web tool was customized to a specific LLM:

Website RAG Search - CrewAI

Good luck and I will try some things on this end to recreate the error.