Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ celerybeat.pid
# Environments
.env
.envrc
.venv
.venv*
env/
venv/
ENV/
Expand Down
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2026 Vercel, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
6 changes: 3 additions & 3 deletions examples/fastapi-vite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ behind user confirmation before execution.

## Stack

- **Backend:** FastAPI + vercel-ai-sdk (Python 3.12)
- **Backend:** FastAPI + AI SDK for Python (Python 3.12)
- **Frontend:** Vite + React + AI SDK UI + AI Elements

## Human-in-the-Loop
Expand Down Expand Up @@ -55,8 +55,8 @@ The frontend dev server proxies `/api` requests to the backend at `localhost:800

## Environment Variables

| Variable | Description |
|----------|-------------|
| Variable | Description |
| -------------------- | ------------------------- |
| `AI_GATEWAY_API_KEY` | Vercel AI Gateway API key |

## Storage
Expand Down
2 changes: 1 addition & 1 deletion examples/fastapi-vite/backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ description = "Chat demo using Python Vercel AI SDK with FastAPI"
requires-python = ">=3.12"
dependencies = [
"fastapi[standard]>=0.128.1",
"vercel-ai-sdk>=0.0.1.dev5",
"ai>=0.0.1.dev5",
]
6 changes: 3 additions & 3 deletions examples/fastapi-vite/backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/fastapi-vite/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export default function App() {
<div className="flex h-screen flex-col bg-background">
<header className="border-b px-4 py-3">
<div className="mx-auto w-full max-w-3xl">
<h1 className="text-lg font-semibold">Python AI SDK Chat Demo</h1>
<h1 className="text-lg font-semibold">AI SDK Python Chat Demo</h1>
<p className="text-sm text-muted-foreground">
Powered by vercel-ai-sdk + FastAPI
Powered by AI SDK for Python and FastAPI
</p>
</div>
</header>
Expand Down
4 changes: 2 additions & 2 deletions examples/multiagent-textual/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ description = "Multi-agent hook resolution demo with Textual TUI"
requires-python = ">=3.12"
dependencies = [
"fastapi[standard]>=0.128.1",
"vercel-ai-sdk",
"ai",
"textual>=3.0",
"websockets>=15.0",
]

[tool.uv.sources]
vercel-ai-sdk = { path = "../..", editable = true }
ai = { path = "../..", editable = true }
6 changes: 3 additions & 3 deletions examples/multiagent-textual/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/temporal-direct/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = "0.1.0"
description = "Durable agent with a custom loop — every I/O call is a Temporal activity"
requires-python = ">=3.12"
dependencies = [
"vercel-ai-sdk",
"ai",
"temporalio>=1.9.0",
]

[tool.uv.sources]
vercel-ai-sdk = { path = "../..", editable = true }
ai = { path = "../..", editable = true }
6 changes: 3 additions & 3 deletions examples/temporal-direct/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 38 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
[project]
name = "vercel-ai-sdk"
version = "0.0.1.dev10"
description = "The AI Toolkit for Python"
name = "ai"
dynamic = ["version"]
description = "AI Agent Framework for Python"
license = "Apache-2.0"
license-files = ["LICENSE"]
readme = "README.md"
authors = [
{ name = "Andrey Buzin", email = "andrey.buzin@vercel.com" }
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python",
"Topic :: Internet",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
requires-python = ">=3.12"
dependencies = [
"anthropic>=0.83.0",
Expand All @@ -19,11 +39,19 @@ dependencies = [
]

[build-system]
requires = ["uv_build>=0.9.21,<0.12.0"]
build-backend = "uv_build"
requires = ["hatchling", "uv-dynamic-versioning>=0.7.0"]
build-backend = "hatchling.build"

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.version]
source = "uv-dynamic-versioning"

[tool.uv.build-backend]
module-name = "ai"
[tool.uv-dynamic-versioning]
vcs = "git"
style = "pep440"
bump = true

[dependency-groups]
dev = [
Expand All @@ -38,12 +66,12 @@ dev = [
]

[tool.mypy]
python_version = "3.13"
python_version = "3.12"
strict = true
plugins = ["pydantic.mypy"]

[tool.pyright]
pythonVersion = "3.13"
pythonVersion = "3.12"
typeCheckingMode = "standard"
reportMissingTypeStubs = false
reportUnusedCallResult = false
Expand All @@ -53,7 +81,7 @@ asyncio_mode = "auto"
testpaths = ["tests"]

[tool.ruff]
target-version = "py313"
target-version = "py312"
src = ["src"]

[tool.ruff.lint]
Expand Down
4 changes: 2 additions & 2 deletions skills/ai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Python `ai` module — models, agents, hooks, MCP, structured outpu
# ai

```bash
uv add vercel-ai-sdk
uv add ai
```

```python
Expand Down Expand Up @@ -66,7 +66,7 @@ Serialize: `msg.model_dump()`. Restore: `ai.messages.Message.model_validate(data

## Streaming tools

A regular `@ai.tool` returns the tool result directly. An async-generator tool yields intermediate values that stream to the consumer as `ai.events.PartialToolCallResult` events; an *aggregator* decides what the model sees as the final result.
A regular `@ai.tool` returns the tool result directly. An async-generator tool yields intermediate values that stream to the consumer as `ai.events.PartialToolCallResult` events; an _aggregator_ decides what the model sees as the final result.

Declare the aggregator via the return-type annotation:

Expand Down
101 changes: 50 additions & 51 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading