Description
pipecat.adapters.schemas.function_schema.FunctionSchema has no way to opt a tool into OpenAI's
strict function-calling mode (JSON-schema-guaranteed argument validation, which OpenAI's own
docs recommend enabling by default). This applies to both hand-written FunctionSchema tools and
direct functions (DirectFunctionWrapper.to_function_schema()), since both build the same
schema shape with no strict concept.
open_ai_responses_adapter.py's to_provider_tools_format reads a "strict" key off the dict
produced by FunctionSchema.to_default_dict():
tool: FunctionToolParam = {
"type": "function",
"name": d["name"],
"parameters": d.get("parameters", {}),
"strict": d.get("strict", None),
}
But to_default_dict() never sets that key, so every Responses-API tool ships with an explicit
"strict": null, never true, and there is no FunctionSchema constructor argument, decorator,
or ToolsSchema option to change that. (open_ai_adapter.py, the Chat Completions path, doesn't
even read/forward a strict key at all.)
The only existing workaround is ToolsSchema.custom_tools[AdapterType.OPENAI], which requires
hand-writing the full raw OpenAI tool dict (bypassing FunctionSchema entirely, and losing its
handler auto-registration) — that's documented as the escape hatch for provider-native tools that
don't fit the standard schema, not a way to add strict: true to an otherwise-standard tool.
Repro (stock pipecat, no custom code beyond this)
from pipecat.adapters.schemas.function_schema import FunctionSchema
from pipecat.adapters.schemas.tools_schema import ToolsSchema
from pipecat.adapters.services.open_ai_responses_adapter import OpenAIResponsesLLMAdapter
weather_function = FunctionSchema(
name="get_weather",
description="Get the weather for a location.",
properties={"location": {"type": "string"}},
required=["location"],
)
tools_schema = ToolsSchema(standard_tools=[weather_function])
adapter = OpenAIResponsesLLMAdapter()
tools = adapter.to_provider_tools_format(tools_schema)
print(tools[0]["strict"]) # -> None, not True
Expected
Some way to request strict: true (and get additionalProperties: false emitted) directly from
FunctionSchema/direct functions — e.g. a strict: bool = False constructor arg on
FunctionSchema that flows through to_default_dict() into both the Responses and Chat
Completions adapters, defaulting to False for backward compatibility.
Actual
strict is always null/absent regardless of the tool's schema shape, with no supported way to
change it short of bypassing FunctionSchema via custom_tools.
Environment
pipecat 1.8.1, openai Python SDK 2.54.0, OpenAI Responses API.
Description
pipecat.adapters.schemas.function_schema.FunctionSchemahas no way to opt a tool into OpenAI'sstrictfunction-calling mode (JSON-schema-guaranteed argument validation, which OpenAI's owndocs recommend enabling by default). This applies to both hand-written
FunctionSchematools anddirect functions (
DirectFunctionWrapper.to_function_schema()), since both build the sameschema shape with no
strictconcept.open_ai_responses_adapter.py'sto_provider_tools_formatreads a"strict"key off the dictproduced by
FunctionSchema.to_default_dict():But
to_default_dict()never sets that key, so every Responses-API tool ships with an explicit"strict": null, nevertrue, and there is noFunctionSchemaconstructor argument, decorator,or
ToolsSchemaoption to change that. (open_ai_adapter.py, the Chat Completions path, doesn'teven read/forward a
strictkey at all.)The only existing workaround is
ToolsSchema.custom_tools[AdapterType.OPENAI], which requireshand-writing the full raw OpenAI tool dict (bypassing
FunctionSchemaentirely, and losing itshandler auto-registration) — that's documented as the escape hatch for provider-native tools that
don't fit the standard schema, not a way to add
strict: trueto an otherwise-standard tool.Repro (stock pipecat, no custom code beyond this)
Expected
Some way to request
strict: true(and getadditionalProperties: falseemitted) directly fromFunctionSchema/direct functions — e.g. astrict: bool = Falseconstructor arg onFunctionSchemathat flows throughto_default_dict()into both the Responses and ChatCompletions adapters, defaulting to
Falsefor backward compatibility.Actual
strictis alwaysnull/absent regardless of the tool's schema shape, with no supported way tochange it short of bypassing
FunctionSchemaviacustom_tools.Environment
pipecat 1.8.1,
openaiPython SDK 2.54.0, OpenAI Responses API.