Find answers from the community

Updated 9 months ago

im using the azureopenai and getting

At a glance

A community member is using the AzureOpenAI library and encountering an error: the 'AzureOpenAI' object has no attribute 'achat_with_tools'. They are using the FunctionCallingAgentWorker and StructuredPlannerAgent classes, and are unsure if the StructuredPlannerAgent is available for AzureOpenAI.

In the comments, another community member suggests updating the azure package by running 'pip install -U llama-index-llms-azure-openai'. The original poster confirms that this resolved the issue, and thanks the other community member.

im using the azureopenai and getting this error: 'AzureOpenAI' object has no attribute 'achat_with_tools'. Code is below:
Plain Text
# INDEXING_SERVICE.llm is AzureOpenAI gpt-35-turbo-16k 
# data_tool is a QueryEngineTool
worker = FunctionCallingAgentWorker.from_tools(
    [data_tool], verbose=True, llm=INDEXING_SERVICE.llm
)
agent = StructuredPlannerAgent(worker, tools=[data_tool], verbose=True, llm=INDEXING_SERVICE.llm)

r = agent.chat('Whats the ip information for customer0?')


I dont see the function achat_with_tools on the class AzureOpenAI. Is the StructuredPlannerAgent not available at all for the AzureOpenAI?
W
I
2 comments
Try updating your azure package see if this works:
pip install -U llama-index-llms-azure-openai
Updated that and llama-index-llms-openai and it started working. Thanks a ton
Add a reply
Sign up and join the conversation on Discord