mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Bug Fix: Add missing _parse_response to AzureOpenAIStructuredLLM

Open hayescode opened this issue 6 months ago • 5 comments

Description

AzureOpenAILLM has the self._parse_response() method for parsing structured outputs, but this class is not used when using structured outputs, instead AzureOpenAIStructuredLLM is used but it's missing self._parse_response() so the generate_response() fails in the return on line 69. This PR simply copies the self._parse_response() method over and now it works as intended.

The same issue existed in regular OpenAI structured outputs so I have fixed it in the same way as the Azure version.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • [ x ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Refactor (does not change functionality, e.g. code style improvements, linting)
  • [ ] Documentation update

How Has This Been Tested?

forked repo

Checklist:

  • [ x ] My code follows the style guidelines of this project
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas
  • [ x ] I have made corresponding changes to the documentation
  • [ x ] My changes generate no new warnings
  • [ x ] I have added tests that prove my fix is effective or that my feature works
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] Any dependent changes have been merged and published in downstream modules
  • [ x ] I have checked my code and corrected any misspellings

Maintainer Checklist

  • [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
  • [ ] Made sure Checks passed

hayescode avatar May 14 '25 20:05 hayescode

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 14 '25 20:05 CLAassistant

@Dev-Khant @whysosaket for visibility. Also blocked by this, ty

lancerts avatar May 16 '25 19:05 lancerts

@Dev-Khant is there anything I need to do here? It says checks failed but that I don't have access to fix it.

hayescode avatar May 21 '25 03:05 hayescode

Is there any progress? The Azure API is currently not usable.

mrbaowei avatar May 23 '25 02:05 mrbaowei

@Dev-Khant can you please review this for inclusion into the next release?

hayescode avatar Jun 12 '25 14:06 hayescode

Hey @hayescode thanks for this PR. Can you please fix the failing tests to get things started? Thanks!

parshvadaftari avatar Sep 24 '25 18:09 parshvadaftari