Skip to content

Handle Anthropic messages as if they were chat/completions #19

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

Merged
merged 14 commits into from
Jun 5, 2025

Conversation

nullfunc
Copy link

@nullfunc nullfunc commented May 28, 2025

Description of changes:

Update gateway to handler chat/complete for gemini and anthropic. For anthropic, the request message is transformed to one claude will understand. The REST endpoint will also point to the specific model's. The response is transformed into an openai chat/completion response format to the UI does not need to handle Anthropic Claude models differently.

The app.py entry point is also cleaned up, the GCP message handling is put into it's own file. This should help facilitate upstream changes from the project repo this gateway was forked from.

@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME May 28, 2025 05:35 — with GitHub Actions Inactive
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME May 28, 2025 05:35 — with GitHub Actions Inactive
@nullfunc nullfunc requested a review from jordanstephens May 28, 2025 05:38
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME May 29, 2025 22:27 — with GitHub Actions Inactive
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME May 29, 2025 23:17 — with GitHub Actions Inactive
@nullfunc nullfunc changed the title update to target URL creation Handle Anthropic messages as if they were chat/completions May 29, 2025
@nullfunc
Copy link
Author

@jordanstephens please have a look. updated from our discussion earlier.

Co-authored-by: Jordan Stephens <jordan@stephens.io>
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME May 30, 2025 00:41 — with GitHub Actions Inactive
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME May 30, 2025 04:13 — with GitHub Actions Inactive
@nullfunc nullfunc requested a review from jordanstephens May 30, 2025 04:14
@nullfunc nullfunc marked this pull request as ready for review May 30, 2025 17:33
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME May 30, 2025 21:52 — with GitHub Actions Inactive
Copy link
Member

@jordanstephens jordanstephens left a comment

Choose a reason for hiding this comment

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

Two quick thoughts

Co-authored-by: Jordan Stephens <jordan@stephens.io>
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME June 3, 2025 00:09 — with GitHub Actions Inactive
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME June 3, 2025 00:11 — with GitHub Actions Inactive
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME June 3, 2025 01:52 — with GitHub Actions Inactive
@nullfunc nullfunc requested a review from jordanstephens June 5, 2025 19:08
Copy link
Member

@jordanstephens jordanstephens left a comment

Choose a reason for hiding this comment

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

just a couple small naming suggestions

Co-authored-by: Jordan Stephens <jordan@stephens.io>
@nullfunc nullfunc temporarily deployed to AWS_ROLE_TO_ASSUME June 5, 2025 21:11 — with GitHub Actions Inactive
@nullfunc nullfunc merged commit cbeac45 into defang Jun 5, 2025
3 checks passed
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.

2 participants