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

chore: Handle overloaded error in anthropic streaming response #741

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

narengogi
Copy link
Collaborator

@narengogi narengogi commented Nov 11, 2024

Title:

  • Anthropic throws errors DURING streaming

When receiving a streaming response via >SSE, it’s possible that an error can occur after returning a 200 response, in which case >error handling wouldn’t follow these standard mechanisms.
https://docs.anthropic.com/en/api/errors

Related Issues: (optional)

Note:
This change technically ignores the exception from anthropic during streaming and terminates the stream. But we're not losing any information, we're putting stop reason error (not openai compliant)
This is because if OpenAI stream has an exception it terminates abruptly and does not give an error chunk

@narengogi narengogi marked this pull request as draft November 11, 2024 10:06
@narengogi narengogi force-pushed the chore/anthropic-stream-overloaded-error branch from 8b166a9 to 38bb170 Compare November 11, 2024 10:22
@narengogi narengogi marked this pull request as ready for review November 11, 2024 10:23
@narengogi narengogi force-pushed the chore/anthropic-stream-overloaded-error branch from 90fb5ad to ef039be Compare November 11, 2024 11:04
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.

1 participant