langchain-anthropic
This package contains the LangChain integration for Anthropic's generative models.
Installation
pip install -U langchain-anthropic
Chat Models
Anthropic recommends using their chat models over text completions.
You can see their recommended models here.
To use, you should have an Anthropic API key configured. Initialize the model as:
from langchain_anthropic import ChatAnthropic
from langchain_core.messages import AIMessage, HumanMessage
model = ChatAnthropic(model="claude-3-opus-20240229", temperature=0, max_tokens=1024)
Define the input message
message = HumanMessage(content="What is the capital of France?")
Generate a response using the model
response = model.invoke([message])
For a more detailed walkthrough see here.
LLMs (Legacy)
You can use the Claude 2 models for text completions.
from langchain_anthropic import AnthropicLLM
model = AnthropicLLM(model="claude-2.1", temperature=0, max_tokens=1024)
response = model.invoke("The best restaurant in San Francisco is: ")
Metadata
Release files for gigachain-anthropic 0.1.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gigachain_anthropic-0.1.23.tar.gz | 20.2 kB | Without provenance | Details for gigachain_anthropic-0.1.23.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gigachain_anthropic-0.1.23-py3-none-any.whl | Python 3 | none | any | Details for gigachain_anthropic-0.1.23-py3-none-any.whl |
Total release size: 41.8 kB
Release files / gigachain_anthropic-0.1.23.tar.gz
| Download URL | gigachain_anthropic-0.1.23.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
204efb0c3f36baa285dff2d528682587ba7ca85e76feb636ca0a6f972e815800
|
|
BLAKE2b-256 checksum How to use checksums |
939c831e49985afb9044c5eadea8eb7747bd7ae3cbc5642093834e070b22fba0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.5 Darwin/23.5.0
|
Release files / gigachain_anthropic-0.1.23-py3-none-any.whl
| Download URL | gigachain_anthropic-0.1.23-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9be99a8817ed266a49e22625f49798e02d2db769d56c406d7195077134a2ace
|
|
BLAKE2b-256 checksum How to use checksums |
4a8812685b94a3e90bb64963b92b210b5b1ce40b152fbac9c4f54b177b57e3d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.5 Darwin/23.5.0
|
Security for gigachain-anthropic 0.1.23
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.