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

Anthropic Endpoint Support #923

Merged
merged 1 commit into from Mar 15, 2024
Merged

Conversation

Saghen
Copy link
Contributor

@Saghen Saghen commented Mar 11, 2024

Adds support for Anthropic via their official SDK and the newer Messages API. Left a todo regarding the preprompt which I passed to Anthropic via their system prompt option, rather than passing it in during buildPrompt. Let me know which would be preferable
https://github.com/huggingface/chat-ui/pull/923/files#diff-ef33885c5572e45b8c3ba8c5d6b489b258dc0a3fdd7bef12556481f71f5cd45fR53-R54

@nsarrazin nsarrazin self-requested a review March 12, 2024 09:02
@julien-c
Copy link
Member

cool addition!

@ptrandev
Copy link

ok go off king

Copy link
Collaborator

@nsarrazin nsarrazin left a comment

Choose a reason for hiding this comment

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

Tested it locally, works pretty well! I've left some comments on things that would make it more aligned with the way we do things for other inference endpoints, let me know if you need any help!

src/lib/server/endpoints/anthropic/endpointAnthropic.ts Outdated Show resolved Hide resolved
src/lib/server/endpoints/anthropic/endpointAnthropic.ts Outdated Show resolved Hide resolved
src/lib/server/endpoints/anthropic/endpointAnthropic.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@Saghen
Copy link
Contributor Author

Saghen commented Mar 14, 2024

Thanks! Made the changes and rebased onto main

@Saghen Saghen requested a review from nsarrazin March 14, 2024 23:27
Copy link
Collaborator

@nsarrazin nsarrazin left a comment

Choose a reason for hiding this comment

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

Works great! Thanks for the contribution 🚀

@nsarrazin nsarrazin merged commit 5a31018 into huggingface:main Mar 15, 2024
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.

None yet

4 participants