Skip to content

Update experimental JSON schema per issue #1048 - #2182

Open
zyantw wants to merge 1 commit into
mainfrom
zyantw-patch-12
Open

Update experimental JSON schema per issue #1048#2182
zyantw wants to merge 1 commit into
mainfrom
zyantw-patch-12

Conversation

@zyantw

@zyantw zyantw commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Adds documentation for the experimental JSON schema-based function declaration feature to function-tools.md.

Includes:

  • An explanation of the ADK_ENABLE_JSON_SCHEMA_FOR_FUNC_DECL environment variable.
  • CLI instructions for enabling and disabling the feature across macOS, Linux, and Windows (CMD & PowerShell) using tabbed code blocks.
  • A Python code snippet demonstrates how to explicitly configure the feature in-code.

1. JSON Schema Generation Capability & Default Status

Quoted Claim

"ADK automatically generates JSON schemas from your function signatures using Pydantic for model function declarations. This feature (JSON_SCHEMA_FOR_FUNC_DECL) is enabled by default in ADK."

  1. FeatureName.JSON_SCHEMA_FOR_FUNC_DECL is registered in _FEATURE_REGISTRY with FeatureConfig(FeatureStage.EXPERIMENTAL, default_on=True).
  2. When constructing a FunctionTool, _get_declaration() passes is_feature_enabled(FeatureName.JSON_SCHEMA_FOR_FUNC_DECL) to build_function_declaration(), which delegates to _function_tool_declarations.build_function_declaration_with_json_schema().
  3. _build_parameters_json_schema() extracts parameter types from the callable using Python inspect and get_type_hints, dynamically generates a Pydantic model via pydantic.create_model, and exports the schema using model_json_schema().

2. Feature Resolution Hierarchy & Environment Variables

Quoted Claim

"You can explicitly control or override this behavior using environment variables or directly in Python code."


3. Option 1: Command Line Configuration (Enable & Disable)


4. Option 2 - Method A: Programmatic Feature Override


5. Option 2 - Method B: In-Script Environment Variable Setting

Adds documentation for the experimental JSON schema-based function declaration feature to `function-tools.md`. 

Includes:
* An explanation of the `ADK_ENABLE_JSON_SCHEMA_FOR_FUNC_DECL` environment variable.
* CLI instructions for enabling and disabling the feature across macOS, Linux, and Windows (CMD & PowerShell) using tabbed code blocks.
* A Python code snippet demonstrating how to explicitly configure the feature in-code.
@zyantw
zyantw requested a review from joefernandez August 28, 2026 21:16
@zyantw zyantw self-assigned this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant