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

Azure OpenAI: 'NoneType' object has no attribute 'tool_calls' #688

Closed
maik-parloa opened this issue Aug 30, 2024 · 0 comments · Fixed by #705
Closed

Azure OpenAI: 'NoneType' object has no attribute 'tool_calls' #688

maik-parloa opened this issue Aug 30, 2024 · 0 comments · Fixed by #705

Comments

@maik-parloa
Copy link

The OpenAI plugin currently leads to issues when using Azure OpenAI with content filtering active. The issue seems to be related to langgenius/dify#5790

The following exception is triggered reproducibly:

AttributeError: 'NoneType' object has no attribute 'tool_calls'

I tested working around by adopting the Dify patch (effectively return None conditionally) and it seems to resolve the limitation:

    def _parse_choice(self, choice: Choice) -> llm.ChatChunk | None:
        delta = choice.delta

        if delta is None:
            return None
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 a pull request may close this issue.

1 participant