From 5aa46501cf43758cc9a4f3275a02258c2cf8228f Mon Sep 17 00:00:00 2001 From: ccurme Date: Wed, 10 Dec 2025 16:25:06 -0500 Subject: [PATCH] fix(langchain): add sentinel value to ProviderStrategy / strict (#34290) --- libs/langchain_v1/langchain/agents/structured_output.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/langchain_v1/langchain/agents/structured_output.py b/libs/langchain_v1/langchain/agents/structured_output.py index e8e6aea20d4..05bc3c88d59 100644 --- a/libs/langchain_v1/langchain/agents/structured_output.py +++ b/libs/langchain_v1/langchain/agents/structured_output.py @@ -128,7 +128,7 @@ class _SchemaSpec(Generic[SchemaT]): json_schema: dict[str, Any] """JSON schema associated with the schema.""" - strict: bool = False + strict: bool | None = None """Whether to enforce strict validation of the schema.""" def __init__( @@ -137,7 +137,7 @@ class _SchemaSpec(Generic[SchemaT]): *, name: str | None = None, description: str | None = None, - strict: bool = False, + strict: bool | None = None, ) -> None: """Initialize SchemaSpec with schema and optional parameters.""" self.schema = schema @@ -256,7 +256,7 @@ class ProviderStrategy(Generic[SchemaT]): self, schema: type[SchemaT], *, - strict: bool = False, + strict: bool | None = None, ) -> None: """Initialize ProviderStrategy with schema.