Skip to content

Azure OpenAI KeyError on 500 #609

@KyleKing

Description

@KyleKing

Describe the bug

Currently, 500 errors from Azure OpenAI do not return a dictionary with key "error". This leads to a generic APIError/KeyError when it could attempt to return the message from the instead, which is more useful for end users

To Reproduce

Any request to Azure OpenAI that fails because of a non-specific Server Error

Example response:

{ "activityId": "123-123-123", "message": "Internal server error", "statusCode": 500 }

Code snippets

No response

OS

Linux

Python version

3.11.3

Library version

v0.28.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed in v1Issues addressed by the v1 beta

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions