Skip to content

Commit 5d2b372

Browse files
free-form -> freeform
1 parent 7c96803 commit 5d2b372

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

pydantic_ai_slim/pydantic_ai/agent/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ async def spam(ctx: RunContext[str], y: float) -> float:
10681068
schema_generator: The JSON schema generator class to use for this tool. Defaults to `GenerateToolJsonSchema`.
10691069
strict: Whether to enforce JSON schema compliance (only affects OpenAI).
10701070
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
1071-
text_format: Used to invoke the function using free-form function calling (only affects OpenAI).
1071+
text_format: Used to invoke the function using freeform function calling (only affects OpenAI).
10721072
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
10731073
requires_approval: Whether this tool requires human-in-the-loop approval. Defaults to False.
10741074
See the [tools documentation](../deferred-tools.md#human-in-the-loop-tool-approval) for more info.
@@ -1172,7 +1172,7 @@ async def spam(ctx: RunContext[str]) -> float:
11721172
schema_generator: The JSON schema generator class to use for this tool. Defaults to `GenerateToolJsonSchema`.
11731173
strict: Whether to enforce JSON schema compliance (only affects OpenAI).
11741174
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
1175-
text_format: Used to invoke the function using free-form function calling (only affects OpenAI).
1175+
text_format: Used to invoke the function using freeform function calling (only affects OpenAI).
11761176
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
11771177
requires_approval: Whether this tool requires human-in-the-loop approval. Defaults to False.
11781178
See the [tools documentation](../deferred-tools.md#human-in-the-loop-tool-approval) for more info.

pydantic_ai_slim/pydantic_ai/models/openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ def _map_tool_definition(self, f: ToolDefinition) -> responses.FunctionToolParam
10241024
)
10251025
if not f.only_takes_string_argument:
10261026
raise UserError(
1027-
f'`{f.name}` is set as a free-form function but does not take a single string argument.'
1027+
f'`{f.name}` is set as a freeform function but does not take a single string argument.'
10281028
)
10291029
if f.text_format == 'text':
10301030
format: CustomToolInputFormat = {'type': 'text'}

pydantic_ai_slim/pydantic_ai/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class Vehicle(BaseModel):
110110
strict: bool | None
111111
"""Whether to use strict mode for the tool."""
112112
text_format: Literal['text'] | FunctionTextFormat | None = None
113-
"""Whether to invoke the function with free-form function calling for tool calls."""
113+
"""Whether to invoke the function with freeform function calling for tool calls."""
114114

115115
def __init__(
116116
self,

pydantic_ai_slim/pydantic_ai/tools.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ class DeferredToolResults:
220220

221221
@dataclass
222222
class FunctionTextFormat:
223-
"""Used to invoke the function with free-form function calling for tool calls.
223+
"""Used to invoke the function with freeform function calling for tool calls.
224224
225-
This class encapsulates the settings related to free-form function calling
225+
This class encapsulates the settings related to freeform function calling
226226
as well as constraining the function call argument to a specific grammar.
227227
The function must take a single string argument.
228228
@@ -232,15 +232,15 @@ class FunctionTextFormat:
232232
"""
233233

234234
syntax: Literal['lark', 'regex']
235-
"""The syntax type for the grammar to constrain the free-form function call.
235+
"""The syntax type for the grammar to constrain the freeform function call.
236236
237237
For 'lark' the grammar attribute contains the lark grammar that the text must
238238
conform to.
239239
For 'regex' the grammar attribute contains the regex pattern that the text must
240240
conform to.
241241
"""
242242
grammar: str
243-
"""The grammar to constrain the free-form function call.
243+
"""The grammar to constrain the freeform function call.
244244
245245
When the syntax is 'lark' this attribute contains the lark grammar that the text must
246246
conform to.
@@ -382,7 +382,7 @@ async def prep_my_tool(
382382
schema_generator: The JSON schema generator class to use. Defaults to `GenerateToolJsonSchema`.
383383
strict: Whether to enforce JSON schema compliance (only affects OpenAI).
384384
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
385-
text_format: Used to invoke the function using free-form function calling (only affects OpenAI).
385+
text_format: Used to invoke the function using freeform function calling (only affects OpenAI).
386386
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
387387
requires_approval: Whether this tool requires human-in-the-loop approval. Defaults to False.
388388
See the [tools documentation](../deferred-tools.md#human-in-the-loop-tool-approval) for more info.
@@ -526,7 +526,7 @@ class ToolDefinition:
526526
"""
527527

528528
text_format: Literal['text'] | FunctionTextFormat | None = None
529-
"""Whether to invoke the function with free-form function calling for tool calls.
529+
"""Whether to invoke the function with freeform function calling for tool calls.
530530
531531
Setting this to a format while using a supported model prevents parallel tool calling
532532
in exchange for passing raw text payloads to your custom tool without wrapping the data in JSON.
@@ -557,7 +557,7 @@ def only_takes_string_argument(self) -> bool:
557557
@property
558558
def single_string_argument_name(self) -> str | None:
559559
# returns the name of the single argument that is a string
560-
# used for free-form function calling
560+
# used for freeform function calling
561561
# will return None if there is more or less than one argument,
562562
# or if the argument is not a string
563563
schema = self.parameters_json_schema

pydantic_ai_slim/pydantic_ai/toolsets/function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ async def spam(ctx: RunContext[str], y: float) -> float:
164164
If `None`, the default value is determined by the toolset.
165165
strict: Whether to enforce JSON schema compliance (only affects OpenAI).
166166
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
167-
text_format: Used to invoke the function using free-form function calling (only affects OpenAI).
167+
text_format: Used to invoke the function using freeform function calling (only affects OpenAI).
168168
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
169169
requires_approval: Whether this tool requires human-in-the-loop approval. Defaults to False.
170170
See the [tools documentation](../deferred-tools.md#human-in-the-loop-tool-approval) for more info.
@@ -229,7 +229,7 @@ def add_function(
229229
If `None`, the default value is determined by the toolset.
230230
strict: Whether to enforce JSON schema compliance (only affects OpenAI).
231231
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
232-
text_format: Used to invoke the function using free-form function calling (only affects OpenAI).
232+
text_format: Used to invoke the function using freeform function calling (only affects OpenAI).
233233
See [`ToolDefinition`][pydantic_ai.tools.ToolDefinition] for more info.
234234
requires_approval: Whether this tool requires human-in-the-loop approval. Defaults to False.
235235
See the [tools documentation](../deferred-tools.md#human-in-the-loop-tool-approval) for more info.

tests/models/test_openai_responses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ def test_openai_responses_model_freeform_function_unsupported_model_error():
12061206
# GPT-4 doesn't support freeform function calling
12071207
model = OpenAIResponsesModel('gpt-4o', provider=OpenAIProvider(api_key='foobar'))
12081208

1209-
with pytest.raises(UserError, match='uses free-form function calling but gpt-4o does not support'):
1209+
with pytest.raises(UserError, match='uses freeform function calling but gpt-4o does not support'):
12101210
model._map_tool_definition(freeform_tool) # type: ignore[reportPrivateUsage]
12111211

12121212

0 commit comments

Comments
 (0)