langchain-amazon-nova
Official LangChain integration for Amazon Nova models.
Amazon Nova is a family of state-of-the-art foundation models from Amazon that includes text, multimodal, and image generation capabilities. This integration provides access to Nova models through LangChain's standardized chat model interface.
Installation
pip install -U langchain-amazon-nova
Or using uv:
uv add langchain-amazon-nova
Quick Start
from langchain_amazon_nova import ChatAmazonNova
# Initialize the model
model = ChatAmazonNova(
model="nova-pro-v1",
temperature=0.7,
)
# Use it like any LangChain chat model
response = model.invoke("What is the capital of France?")
print(response.content)
Environment Setup
Set your Nova API credentials:
export NOVA_API_KEY="your-api-key"
export NOVA_BASE_URL="https://api.nova.amazon.com/v1"
Documentation
For detailed API documentation and additional parameters, see: https://nova.amazon.com/dev/documentation
Supported Models
Amazon Nova offers several model variants:
- nova-micro-v1: Fast, efficient text model (128K context)
- nova-lite-v1: Lightweight multimodal model (300K context)
- nova-pro-v1: Balanced multimodal model (300K context)
- nova-premier-v1: Most capable multimodal model (300K context)
Features
- Text Generation: All models support text completion
- Streaming: Token-by-token streaming responses
- Async Support: Native async/await support
- Tool Calling: Function calling capabilities (most models)
- Multimodal Input: Image and video understanding (lite, pro, premier)
Example Usage
Basic Chat
from langchain_amazon_nova import ChatAmazonNova
model = ChatAmazonNova(model="nova-pro-v1")
messages = [
("system", "You are a helpful assistant."),
("human", "Explain quantum computing in simple terms."),
]
response = model.invoke(messages)
print(response.content)
Streaming
for chunk in model.stream(messages):
print(chunk.content, end="", flush=True)
Tool Calling
from pydantic import BaseModel, Field
class GetWeather(BaseModel):
'''Get weather for a location.'''
location: str = Field(description="City name")
model_with_tools = model.bind_tools([GetWeather])
response = model_with_tools.invoke("What's the weather in Tokyo?")
print(response.tool_calls)
Async
import asyncio
async def main():
response = await model.ainvoke(messages)
print(response.content)
asyncio.run(main())
📖 Documentation
- Integration Guide - Complete usage guide
- API Reference - Detailed API documentation
- Amazon Nova Docs - Official Nova documentation
📕 Releases & Versioning
See our Releases and Versioning policies.
💁 Contributing
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
For detailed information on how to contribute, see the Contributing Guide.
Metadata
Release files for langchain-amazon-nova 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_amazon_nova-1.0.1.tar.gz | 91.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_amazon_nova-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 105.2 kB
Release files / langchain_amazon_nova-1.0.1.tar.gz
| Download URL | langchain_amazon_nova-1.0.1.tar.gz |
|---|---|
| Size | 91.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a283bfadbae8f688c33bb841493f312167561f16f303e307f4d87a1813c5f54c
|
|
BLAKE2b-256 checksum How to use checksums |
f61ae1a6a7d196bbaffc4e62ba25228973aa6a9ff07ed132731c576527641589
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / langchain_amazon_nova-1.0.1-py3-none-any.whl
| Download URL | langchain_amazon_nova-1.0.1-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e9e5dbcb5e748bc056519b6a331c89ebb764d7ea37f09886144b61727e99f0e
|
|
BLAKE2b-256 checksum How to use checksums |
42f934ef5ec38eb1520b890fa382e418a8937d0198e3612e0e2b997594736ac2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|