Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: various patches for Azure support + strip Box #982

Merged
merged 5 commits into from
Feb 9, 2024
Merged

Conversation

cpacker
Copy link
Collaborator

@cpacker cpacker commented Feb 9, 2024

Please describe the purpose of this pull request.

Fixes a few bugs with Azure in the v0.3 release:

  • (azure) credentials were not being properly saved after being read during memgpt configure
  • patch the credentials file (MemGPTCredentials) to contain the full set of Azure creds
    • A few were missing, eg embedding_deployment
  • fix a key error that would occur during first message verification (with Azure only)
    • it looks like OpenAI (+LocalLLMs) return None for function_call, whereas Azure doesn't even return the field, which is why only Azure would throw a key error

As part of this PR, I refactored the repo to strip dependency on Box and instead use Pydantic models. This had already partially happened for local LLMs (used to return Box types, but now return Pydantic models), but now this is also the case for the OpenAI and Azure OpenAI calls.

TODOs for follow-up PRs:

  • Strip Box from requirements
  • Add better output during "Thinking..." to illustrate what's going on with message verification

How to test

Run memgpt configure to set up Azure, then run memgpt run (no runtime errors = success)

Have you tested this PR?

Yes, was able to reproduce the error in #980 + verify the patch

@cpacker cpacker linked an issue Feb 9, 2024 that may be closed by this pull request
2 tasks
@cpacker cpacker changed the title fix: Patch azure fix: various patches for Azure support Feb 9, 2024
@cpacker cpacker changed the title fix: various patches for Azure support fix: various patches for Azure support + strip Box Feb 9, 2024
Copy link
Collaborator

@sarahwooders sarahwooders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@cpacker cpacker merged commit 3546f9d into main Feb 9, 2024
5 checks passed
@sarahwooders sarahwooders deleted the patch-azure branch February 12, 2024 22:27
norton120 pushed a commit to norton120/MemGPT that referenced this pull request Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure OpenAI: KeyError: 'function_call'
2 participants