Skip to content

Commit c97ae02

Browse files
google-genai-botcopybara-github
authored andcommitted
docs: Update unenforced JSON Schema keywords on Interactions schema fields.
PiperOrigin-RevId: 1004403542
1 parent 4e44c84 commit c97ae02

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

‎google/genai/_gaos/types/interactions/function.py‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ class FunctionParam(TypedDict):
3535
name: NotRequired[str]
3636
r"""The name of the function."""
3737
parameters: NotRequired[Any]
38-
r"""The JSON Schema for the function's parameters."""
38+
r"""The JSON Schema for the function's parameters.
39+
40+
Supports a subset of JSON Schema. `minLength`, `maxLength`,
41+
`minProperties`, `maxProperties`, `uniqueItems`, `contains`,
42+
`minContains`, and `maxContains` are ignored and not enforced.
43+
"""
3944
type: Literal["function"]
4045

4146

@@ -49,7 +54,12 @@ class Function(BaseModel):
4954
r"""The name of the function."""
5055

5156
parameters: Optional[Any] = None
52-
r"""The JSON Schema for the function's parameters."""
57+
r"""The JSON Schema for the function's parameters.
58+
59+
Supports a subset of JSON Schema. `minLength`, `maxLength`,
60+
`minProperties`, `maxProperties`, `uniqueItems`, `contains`,
61+
`minContains`, and `maxContains` are ignored and not enforced.
62+
"""
5363

5464
type: Annotated[
5565
Annotated[Literal["function"], AfterValidator(validate_const("function"))],

‎google/genai/_gaos/types/interactions/textresponseformat.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ class TextResponseFormatParam(TypedDict):
4545
schema_: NotRequired[Dict[str, Any]]
4646
r"""The JSON schema that the output should conform to. Only applicable when
4747
mime_type is application/json.
48+
49+
Supports a subset of JSON Schema. `minLength`, `maxLength`,
50+
`minProperties`, `maxProperties`, `uniqueItems`, `contains`,
51+
`minContains`, and `maxContains` are ignored and not enforced; validate
52+
these in your application. `minItems` and `maxItems` are enforced. Schemas
53+
that are too complex to enforce (for example, large `maxItems` on nested
54+
arrays) return a 400 INVALID_ARGUMENT error.
4855
"""
4956
type: Literal["text"]
5057

@@ -58,6 +65,13 @@ class TextResponseFormat(BaseModel):
5865
schema_: Annotated[Optional[Dict[str, Any]], pydantic.Field(alias="schema")] = None
5966
r"""The JSON schema that the output should conform to. Only applicable when
6067
mime_type is application/json.
68+
69+
Supports a subset of JSON Schema. `minLength`, `maxLength`,
70+
`minProperties`, `maxProperties`, `uniqueItems`, `contains`,
71+
`minContains`, and `maxContains` are ignored and not enforced; validate
72+
these in your application. `minItems` and `maxItems` are enforced. Schemas
73+
that are too complex to enforce (for example, large `maxItems` on nested
74+
arrays) return a 400 INVALID_ARGUMENT error.
6175
"""
6276

6377
type: Annotated[

0 commit comments

Comments
 (0)