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(autofix): Retry stream from where it left off #1675

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kddubey
Copy link

@kddubey kddubey commented Dec 28, 2024

Fix #1671.

Investigation found that backoff would address almost all of the overloaded errors.

Decided (see Notes at bottom of this notebook) to store the partial completion, and pass it as a new assistant message which the Anthropic API will continue generating.

Problems with this solution

Doesn't work when tools are provided. From the bottom of the test notebook:

BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}

Can result in wrong newline generation when generating markdown. I didn't see formatting errors in code though. See the "Notes" section in the test notebook.

Note: prolly doesn't gel well w/ #1650

@kddubey kddubey changed the title feat(autofix): Retry stream from where it left off fix(autofix): Retry stream from where it left off Jan 3, 2025
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.

(autofix): Investigate/implement exponential backoff for streaming vertex ai calls
1 participant