Knowledge_sources is not working in crewai both in Agent and Crew level using Azure OpenAI

Hi,

I am trying to add knowledge_sources both at Agent and crew level it gives me this error. Any one have faced same issue using Azure and how you able to resolve it.

[ERROR]: Failed to upsert documents: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’

[WARNING]: Failed to init knowledge: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’

Below is my code

from crewai import Agent, Task, Crew, Process, LLM
from crewai.knowledge.source.string_knowledge_source import StringKnowledgeSource
import os
from dotenv import load_dotenv

load_dotenv()

AZURE_EMBEDDER = os.environ.get(‘AZURE_OPENAI_EMBEDDER_NAME’)
AZURE_OPENAI_API_KEY=os.environ[‘AZURE_OPENAI_API_KEY’]
AZURE_API_BASE = os.environ.get(“AZURE_API_BASE”)
AZURE_OPENAI_VERSION = os.environ.get(“AZURE_OPENAI_VERSION”)
AZURE_OPENAI_DEPLOYED_MODEL_NAME = os.environ.get(“AZURE_OPENAI_DEPLOYED_MODEL_NAME”)

llm = LLM(
api_key=AZURE_OPENAI_API_KEY,
api_version=AZURE_OPENAI_VERSION,
model=AZURE_OPENAI_DEPLOYED_MODEL_NAME,
base_url=AZURE_API_BASE
)

content = “Users name is John. He is 38 years old and lives in Orlando.”
string_source = StringKnowledgeSource(
content=content,
)

embedder={
“provider”: “azure”,
“config”: {
“api_key”: AZURE_OPENAI_API_KEY,
“api_base”: AZURE_API_BASE,
“api_version”: AZURE_OPENAI_VERSION,
“model_name”: AZURE_EMBEDDER
}
}

agent = Agent(
role=“About User”,
goal=“You know everything about the user.”,
backstory=“You are a master at understanding people and their preferences.”,
verbose=True,
allow_delegation=False,
llm=llm
)

task = Task(
description=“Answer the following questions about the user: {question}”,
expected_output=“An answer to the question.”,
agent=agent,
)

crew = Crew(
agents=[agent],
tasks=[task],
verbose=True,
process=Process.sequential,
knowledge_sources=[string_source],
embedder=embedder,
)

result = crew.kickoff(
inputs={
“question”: “What city does John live in and how old is he?”
}
)

[ERROR]: Failed to upsert documents: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’

[WARNING]: Failed to init knowledge: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’

Agent: About User

Task: Answer the following questions about the user: What city does John live in and how old is he?

Agent: About User

Final Answer:

Unfortunately, I do not have sufficient information about John, including his city of residence and age. Without additional details, I cannot provide a specific answer to these questions.