Skip to content

Commit f49197c

Browse files
authored
Move docstring warning of model settings as a comment (#2146)
1 parent f9d90aa commit f49197c

File tree

9 files changed

+18
-26
lines changed

9 files changed

+18
-26
lines changed

pydantic_ai_slim/pydantic_ai/models/anthropic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@
9090

9191

9292
class AnthropicModelSettings(ModelSettings, total=False):
93-
"""Settings used for an Anthropic model request.
93+
"""Settings used for an Anthropic model request."""
9494

95-
ALL FIELDS MUST BE `anthropic_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
96-
"""
95+
# ALL FIELDS MUST BE `anthropic_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
9796

9897
anthropic_metadata: BetaMetadataParam
9998
"""An object describing metadata about the request.

pydantic_ai_slim/pydantic_ai/models/bedrock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@
133133
class BedrockModelSettings(ModelSettings, total=False):
134134
"""Settings for Bedrock models.
135135
136-
ALL FIELDS MUST BE `bedrock_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
137-
138136
See [the Bedrock Converse API docs](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html#API_runtime_Converse_RequestSyntax) for a full list.
139137
See [the boto3 implementation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-runtime/client/converse.html) of the Bedrock Converse API.
140138
"""
141139

140+
# ALL FIELDS MUST BE `bedrock_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
141+
142142
bedrock_guardrail_config: GuardrailConfigurationTypeDef
143143
"""Content moderation and safety settings for Bedrock API requests.
144144

pydantic_ai_slim/pydantic_ai/models/cohere.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,9 @@
8383

8484

8585
class CohereModelSettings(ModelSettings, total=False):
86-
"""Settings used for a Cohere model request.
86+
"""Settings used for a Cohere model request."""
8787

88-
ALL FIELDS MUST BE `cohere_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
89-
"""
88+
# ALL FIELDS MUST BE `cohere_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
9089

9190
# This class is a placeholder for any future cohere-specific settings
9291

pydantic_ai_slim/pydantic_ai/models/gemini.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@
7474

7575

7676
class GeminiModelSettings(ModelSettings, total=False):
77-
"""Settings used for a Gemini model request.
77+
"""Settings used for a Gemini model request."""
7878

79-
ALL FIELDS MUST BE `gemini_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
80-
"""
79+
# ALL FIELDS MUST BE `gemini_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
8180

8281
gemini_safety_settings: list[GeminiSafetySettings]
8382
"""Safety settings options for Gemini model request."""

pydantic_ai_slim/pydantic_ai/models/google.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@
9898

9999

100100
class GoogleModelSettings(ModelSettings, total=False):
101-
"""Settings used for a Gemini model request.
101+
"""Settings used for a Gemini model request."""
102102

103-
ALL FIELDS MUST BE `gemini_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
104-
"""
103+
# ALL FIELDS MUST BE `gemini_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
105104

106105
google_safety_settings: list[SafetySettingDict]
107106
"""The safety settings to use for the model.

pydantic_ai_slim/pydantic_ai/models/groq.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@
9393

9494

9595
class GroqModelSettings(ModelSettings, total=False):
96-
"""Settings used for a Groq model request.
96+
"""Settings used for a Groq model request."""
9797

98-
ALL FIELDS MUST BE `groq_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
99-
"""
98+
# ALL FIELDS MUST BE `groq_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
10099

101100
groq_reasoning_format: Literal['hidden', 'raw', 'parsed']
102101

pydantic_ai_slim/pydantic_ai/models/mcp_sampling.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616

1717

1818
class MCPSamplingModelSettings(ModelSettings, total=False):
19-
"""Settings used for an MCP Sampling model request.
19+
"""Settings used for an MCP Sampling model request."""
2020

21-
ALL FIELDS MUST BE `mcp_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
22-
"""
21+
# ALL FIELDS MUST BE `mcp_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
2322

2423
mcp_model_preferences: ModelPreferences
2524
"""Model preferences to use for MCP Sampling."""

pydantic_ai_slim/pydantic_ai/models/mistral.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,9 @@
9696

9797

9898
class MistralModelSettings(ModelSettings, total=False):
99-
"""Settings used for a Mistral model request.
99+
"""Settings used for a Mistral model request."""
100100

101-
ALL FIELDS MUST BE `mistral_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
102-
"""
101+
# ALL FIELDS MUST BE `mistral_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
103102

104103
# This class is a placeholder for any future mistral-specific settings
105104

pydantic_ai_slim/pydantic_ai/models/openai.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,9 @@
9696

9797

9898
class OpenAIModelSettings(ModelSettings, total=False):
99-
"""Settings used for an OpenAI model request.
99+
"""Settings used for an OpenAI model request."""
100100

101-
ALL FIELDS MUST BE `openai_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
102-
"""
101+
# ALL FIELDS MUST BE `openai_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.
103102

104103
openai_reasoning_effort: ReasoningEffort
105104
"""Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

0 commit comments

Comments
 (0)