Skip to content

Rewrite Gateway documentation page#229

Merged
anbuzin merged 1 commit into
mainfrom
docs-v0.4-gateway
Jul 22, 2026
Merged

Rewrite Gateway documentation page#229
anbuzin merged 1 commit into
mainfrom
docs-v0.4-gateway

Conversation

@anbuzin

@anbuzin anbuzin commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@anbuzin
anbuzin requested a review from msullivan July 20, 2026 23:14
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-python Ready Ready Preview, Comment Jul 20, 2026 11:14pm

@anbuzin anbuzin added the internal No user-facing change; excluded from release notes label Jul 20, 2026
Comment on lines +394 to +414
### Use Python function tools

Pass function tools to `ai.stream` or an agent:

```python
@ai.tool
async def get_weather(city: str) -> str:
"""Get the weather for a city."""
return f"The weather in {city} is sunny."


async with ai.stream(
model,
messages,
tools=[get_weather.tool],
) as stream:
...
```

`ai.stream` sends the tool schema and returns tool calls. Use `ai.Agent` when
the SDK should execute the Python function and continue the model loop.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it worth duplicating this kind of stuff?

@anbuzin
anbuzin merged commit 18cbe5f into main Jul 22, 2026
8 of 9 checks passed
@anbuzin
anbuzin deleted the docs-v0.4-gateway branch July 22, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal No user-facing change; excluded from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants