Skip to content

Use contextvars for tracking the MCP sampling model #2117

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

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

dmontagu
Copy link
Contributor

@dmontagu dmontagu commented Jul 2, 2025

Right now, we set a global attribute instead of contextually overriding the sampling model. But I don't see any reason we need to do that, and doing this will make it easier to make some desirable changes in @DouweM's toolsets work, not to mention probably just behaves better if the same MCP server is used across contexts etc.

Copy link

github-actions bot commented Jul 2, 2025

Docs Preview

commit: 623d6f6
Preview URL: https://0a8986bd-pydantic-ai-previews.pydantic.workers.dev

@DouweM DouweM merged commit 49658f3 into main Jul 2, 2025
18 checks passed
@DouweM DouweM deleted the dmontagu/fix-run-mcp-servers branch July 2, 2025 22:38
DouweM added a commit that referenced this pull request Jul 4, 2025
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