guardrails-ai / guardrails

Adding guardrails to large language models.
https://www.guardrailsai.com/docs
Apache License 2.0
4.05k stars 307 forks source link

[feat] Anthropic LLM provider #366

Closed irgolic closed 9 months ago

irgolic commented 1 year ago

Description We should add Anthropic Claude as an option to llm_providers.py

Why is this needed People are asking for it https://discord.com/channels/1085077079697150023/1156932083856449626

Implementation details Here's an example shared by a user https://gist.github.com/tv-ankur/1b2ffdf7ef3c639f62d9c1298082cfcb

End result Easy, intuitive, well-documented way to use Anthropic with guardrails

whatnick commented 1 year ago

Will this essentially involve a new lightweight wrapper implementing the calling conventions of :

With an associated try/except import to enable the anthropic API. Will attempt a PR on this unless the use with the gist gets there first.

irgolic commented 1 year ago

Hey @whatnick, that's correct. Thanks for helping, we'll review the PR if you put it through!