Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use RunContext more widely #500

Merged
merged 2 commits into from
Dec 19, 2024
Merged

use RunContext more widely #500

merged 2 commits into from
Dec 19, 2024

Conversation

samuelcolvin
Copy link
Member

Also add model to RunContext.

This was part of my new agent handoff work, but I decided to spit it out.

Copy link

cloudflare-workers-and-pages bot commented Dec 19, 2024

Deploying pydantic-ai with  Cloudflare Pages  Cloudflare Pages

Latest commit: 39508d9
Status: ✅  Deploy successful!
Preview URL: https://f99a7f1c.pydantic-ai.pages.dev
Branch Preview URL: https://reuse-run-ctx.pydantic-ai.pages.dev

View logs

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Just one quick nit, otherwise lgtm

tool_call: _messages.ToolCallPart | None,
messages: list[_messages.ModelMessage],
run_ctx: RunContext[AgentDeps],
Copy link
Member

Choose a reason for hiding this comment

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

We call this ctx in our examples, should we be consistent and to that here?

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe we could just fully use run_context?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, probably run_context internally is good.

@samuelcolvin samuelcolvin merged commit e454bcd into main Dec 19, 2024
14 checks passed
@samuelcolvin samuelcolvin deleted the reuse-run_ctx branch December 19, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants