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

Basic ModelSettings logic #227

Merged
merged 19 commits into from
Dec 13, 2024
Merged

Basic ModelSettings logic #227

merged 19 commits into from
Dec 13, 2024

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Dec 12, 2024

This PR adds support for a model_settings argument to run calls, as well as Agent initialization to specify model settings like temperature, timeout, etc. We anticipate further developing this structure in the future with more specs.

In the future, we'd consider adding a model_specific key to aid in specifying settings for specific models, like anthropic or openai

Copy link

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

Deploying pydantic-ai with  Cloudflare Pages  Cloudflare Pages

Latest commit: 266435a
Status: ✅  Deploy successful!
Preview URL: https://280caba5.pydantic-ai.pages.dev
Branch Preview URL: https://model-runtime-config.pydantic-ai.pages.dev

View logs

@sydney-runkle sydney-runkle changed the title Basic ModelRequestSettings logic Basic ModelSettings logic Dec 12, 2024
Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

The style guide flagged several spelling errors that seemed like false positives. We skipped posting inline suggestions for the following words:

  • [Ii]nherited_members

docs/agents.md Outdated Show resolved Hide resolved
Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 1 total issue(s) found.

docs/agents.md Outdated Show resolved Hide resolved
sydney-runkle and others added 3 commits December 12, 2024 14:27
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

Otherwise looking good. we need to add docs, and make sure all models are respecting all relevant settings.

pydantic_ai_slim/pydantic_ai/agent.py Outdated Show resolved Hide resolved
pydantic_ai_slim/pydantic_ai/agent.py Outdated Show resolved Hide resolved
pydantic_ai_slim/pydantic_ai/agent.py Show resolved Hide resolved
pydantic_ai_slim/pydantic_ai/agent.py Show resolved Hide resolved
pydantic_ai_slim/pydantic_ai/agent.py Outdated Show resolved Hide resolved
pydantic_ai_slim/pydantic_ai/models/anthropic.py Outdated Show resolved Hide resolved
pydantic_ai_slim/pydantic_ai/settings.py Outdated Show resolved Hide resolved
pydantic_ai_slim/pydantic_ai/models/function.py Outdated Show resolved Hide resolved
tests/test_agent.py Outdated Show resolved Hide resolved
pydantic_ai_slim/pydantic_ai/settings.py Outdated Show resolved Hide resolved
@sydney-runkle
Copy link
Member Author

@samuelcolvin,

What docs would you like me to add beyond the existing conceptual and API docs?

Apologies, I had an outdated comment in the description indicating docs were still needed, but I added some late yesterday.

@dmontagu dmontagu merged commit 7d27c42 into main Dec 13, 2024
15 checks passed
@dmontagu dmontagu deleted the model-runtime-config branch December 13, 2024 23:06
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.

3 participants