Support @Schema annotation for Object parameters in FunctionTool
维护者通常 1 天内回复
@hemasekhar-p 已经在做这个了。
开始于 2026年1月14日。
评估
这个 Issue 还没有评估数据。
描述
Is your feature request related to a problem? Please describe.
Currently, adk-java relies on Jackson's @JsonProperty for defining schema names and required fields for pojos used as FunctionTool parameters. This creates several friction points:
- Naming Conflicts: We may want the LLM-facing parameter name (e.g.,
snake_case) to differ from the Java field name (e.g.,camelCase) without affecting internal JSON serialization used for other purposes. - Missing Metadata: Standard Jackson annotations do not support a
descriptionfield, which is critical for FunctionTool schemas. - Ambiguous Optionality: Controlling whether a field is "required" or "optional" in the generated schema is difficult to decouple from Jackson's strict deserialization rules.
Describe the solution you'd like
I would like to extend the com.google.adk.tools.Annotations.Schema annotation to act as the highest source of truth for generating the FunctionTool schema in regards to pojo parameters, and deserialization. This includes:
- Name:
@Schema(name="...")should control the property name in the generated schema and during deserialization of the LLM response. - Description:
@Schema(description="...")should populate the schema description. - Optionality:
@Schema(optional=true/false)should explicitly control whether a field is marked as required, overriding Jackson's default behavior if necessary.
Describe alternatives you've considered
- Jackson Mixins: We could use Jackson Mixins to separate the LLM view from the internal view, but this adds significant boilerplate and complexity for developers.
- Custom Annotations: I considered creating a new set of annotations, but extending the existing
@Schemaannotation seems more idiomatic for the ADK.
Additional context
The Object FunctionTool parameter doesn't seem to have a direct 1-1 equivalent in adk-python, other than an issue requesting for pydantic models to be supported as FunctionTool parameters.
The precedence rules I believe align best with the rest of the library would be :
Name: @Schema(name) > @JsonProperty(value) > Field Name
Description: @Schema(description) > None
Required: @Schema(optional) > @JsonProperty(required) > Default (Optional)
These rules should not affect the way prior objects that have been passed without the @Schema annotation are treated.
- 主要语言
- Java
- 星标
- 1.7k
- 派生
- 431
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 28
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/adk-java 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
BaseLlmFlow nests each step inside the previous one and overflows the stack after a few hundred LLM calls可能已有人在做 @hemasekhar-p 于 4 天前认领。 未关闭needs review
难度 4/5 3-5 天 新手友好度 68/100
google/adk-java#1564 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
AgentTool runs the wrapped agent with the default RunConfig instead of the caller's可能已有人在做 @hemasekhar-p 于 4 天前认领。 未关闭needs review
难度 3/5 1-2 天 新手友好度 72/100
google/adk-java#1562 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Approved tool call re-runs on every later user turn if it never got a function response可能已有人在做 @hemasekhar-p 于 7 天前认领。 未关闭needs review
google/adk-java#1556 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
LocalSkillSource.listResources returns backslash-separated paths on Windows可能已有人在做 @hemasekhar-p 于 8 天前认领。 未关闭needs review
google/adk-java#1541 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
apache/rocketmq-dashboard#5358 ·
维护者通常 3 天内回复
-
area:cpan-port area:database bug
难度 2/5 1-3 小时 新手友好度 84/100
fglock/PerlOnJava#1605 ·
维护者通常 1 天内回复
-
1.0.0-rc2
难度 2/5 1-3 小时 新手友好度 68/100
wso2/dpdp-accelerator#377 ·
维护者通常 1 天内回复
-
area/dependencies backport/26.4 kind/cve severity/high source/scan-dependencies status/triage
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复