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

Add Anthropic (non-streaming) Support #193

Merged
merged 19 commits into from
Dec 11, 2024
Merged

Add Anthropic (non-streaming) Support #193

merged 19 commits into from
Dec 11, 2024

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Dec 9, 2024

Starts work on #63, #63 needs streaming support before closure.

Notable other, non-anthropic related changes made here:

  • Some cleanup for openai and groq
  • Made the live test question easier

Things deferred to future PR:

  • Biggest thing: Stream support for Anthropic (might come after an internal streaming refactor)
  • Adding a TypedDict of common messages.create args like temperature and max_tokens that's configurable at the run level for the user.
  • Anthropic bedrock and vertexai clients
  • I think now that we've added 3+ model sources we can do some consolidation of shared logic + documentation improvements.

Notes:

  • I was surprised that the completion API had been deprecated, so I'm using the messages API.

@sydney-runkle sydney-runkle marked this pull request as draft December 9, 2024 15:31
Copy link

cloudflare-workers-and-pages bot commented Dec 9, 2024

Deploying pydantic-ai with  Cloudflare Pages  Cloudflare Pages

Latest commit: 928efb5
Status: ✅  Deploy successful!
Preview URL: https://ab767e50.pydantic-ai.pages.dev
Branch Preview URL: https://anthropic-support.pydantic-ai.pages.dev

View logs

Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

The style guide flagged several spelling errors that seemed like false positives. We skipped posting inline suggestions for the following words:

  • Groq

@sydney-runkle sydney-runkle added the new models Support for new model(s) label Dec 10, 2024
@sydney-runkle sydney-runkle marked this pull request as ready for review December 10, 2024 16:38
@sydney-runkle sydney-runkle changed the title Draft: Add Anthropic Support Add Anthropic (non-streaming) Support Dec 10, 2024
@sydney-runkle sydney-runkle enabled auto-merge (squash) December 11, 2024 20:03
@dmontagu
Copy link
Contributor

I think let's merge this now to get in front of merge conflicts, but @samuelcolvin should probably look through before the next release.

@sydney-runkle sydney-runkle merged commit 01565f5 into main Dec 11, 2024
15 checks passed
@sydney-runkle sydney-runkle deleted the anthropic-support branch December 11, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new models Support for new model(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants