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 AI endpoint issues #2006

Merged
merged 14 commits into from
Nov 25, 2024
Merged

Fix various AI endpoint issues #2006

merged 14 commits into from
Nov 25, 2024

Conversation

anth-volk
Copy link
Collaborator

Fixes #1995
Fixes #2003
Fixes #2004
Fixes #2005

Testing today implies that #1995 was a series of spurious issues on Anthropic's end. However, we clearly need better error handling in these cases. This PR aims to accomplish that by doing the following:

  • Migrating our AI endpoints over to the new API structure of routes, services, and (where necessary) jobs
  • Re-enabling streaming by overriding Google App Engine deployments' default behavior of buffering all responses in 64k blocks (described here whenever a user accesses an AI endpoint

The migration of these endpoints to the new structure also builds in a greater number of basic safety features, like try/catch blocks and more opinionated error responses.

This PR will be accompanied by one on the front end to properly handle error responses/connection errors and display error components in these cases.

@anth-volk anth-volk requested a review from MaxGhenis November 21, 2024 23:23
@anth-volk
Copy link
Collaborator Author

Will fix tests tomorrow

Copy link
Collaborator

@MaxGhenis MaxGhenis left a comment

Choose a reason for hiding this comment

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

policyengine_api/routes/simulation_analysis_routes.py Outdated Show resolved Hide resolved
tests/python/test_simulation_analysis.py Outdated Show resolved Hide resolved
policyengine_api/services/ai_analysis_service.py Outdated Show resolved Hide resolved
@MaxGhenis MaxGhenis merged commit 0da8871 into master Nov 25, 2024
4 checks passed
@MaxGhenis MaxGhenis deleted the fix/1995-ai-issues branch November 25, 2024 21:55
@anth-volk anth-volk mentioned this pull request Nov 26, 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
2 participants