🐛 Describe the bug
Description
AzureOpenAIStructuredLLM in mem0/llms/azure_openai_structured.py calls self._parse_response(response, tools) on line 91 of generate_response(), but the method is never defined in the class or in LLMBase.
This causes AttributeError: 'AzureOpenAIStructuredLLM' object has no attribute '_parse_response' every time generate_response() is called.
Steps to reproduce
python
from mem0.configs.llms.azure import AzureOpenAIConfig
from mem0.llms.azure_openai_structured import AzureOpenAIStructuredLLM
config = AzureOpenAIConfig(model="gpt-4o", azure_kwargs={...})
llm = AzureOpenAIStructuredLLM(config=config)
llm.generate_response(messages=[{"role": "user", "content": "hello"}])
Expected behavior
Should return the LLM response.
Actual behavior
AttributeError: 'AzureOpenAIStructuredLLM' object has no attribute '_parse_response'
Note
AzureOpenAILLM in azure_openai.py has _parse_response defined correctly. It appears to have been missed when creating the structured variant.
Additional issue
There's also a duplicate if tools: block in generate_response() (lines 84-88)
Raise a PR #4165
🐛 Describe the bug
Description
AzureOpenAIStructuredLLMinmem0/llms/azure_openai_structured.pycallsself._parse_response(response, tools)on line 91 ofgenerate_response(), but the method is never defined in the class or inLLMBase.This causes
AttributeError: 'AzureOpenAIStructuredLLM' object has no attribute '_parse_response'every timegenerate_response()is called.Steps to reproduce
python
from mem0.configs.llms.azure import AzureOpenAIConfig
from mem0.llms.azure_openai_structured import AzureOpenAIStructuredLLM
config = AzureOpenAIConfig(model="gpt-4o", azure_kwargs={...})
llm = AzureOpenAIStructuredLLM(config=config)
llm.generate_response(messages=[{"role": "user", "content": "hello"}])
Expected behavior
Should return the LLM response.
Actual behavior
AttributeError: 'AzureOpenAIStructuredLLM' object has no attribute '_parse_response'Note
AzureOpenAILLMinazure_openai.pyhas_parse_responsedefined correctly. It appears to have been missed when creating the structured variant.Additional issue
There's also a duplicate
if tools:block ingenerate_response()(lines 84-88)Raise a PR #4165