Zhuoxi2000 opened a new pull request, #1027:
URL: https://github.com/apache/flink-agents/pull/1027

   <!--
   * Thank you very much for contributing to Flink Agents.
   * Please add the relevant components in the PR title. E.g., [api], 
[runtime], [java], [python], [hotfix], etc.
   -->
   
   <!-- Please link the PR to the relevant issue(s). Hotfix doesn't need this. 
-->
   Linked issue: #1015
   
   ### Purpose of change
   
   <!-- What is the purpose of this change? -->
   
   `SchemaUtils.getParamSchema` maps Java parameter types to JSON Schema with a 
small if/else chain that only handled `String`, `int`/`Integer`, 
`double`/`Double`, and `boolean`/`Boolean` — everything else fell back to 
`"object"`. Common numeric types such as `long`, `Long`, `float`, `Float`, 
`short`, and `byte` were therefore advertised to the model as objects (e.g. 
`getOrder(long orderId)` generated `"type": "object"` for `orderId`), causing 
models to produce the wrong argument shape or avoid the tool call entirely, 
with the failure looking like a model/tool-calling issue rather than a 
schema-generation bug.
   
   This extends the numeric mappings: 
`long`/`Long`/`short`/`Short`/`byte`/`Byte` → `"integer"`, `float`/`Float` → 
`"number"`. Arrays, collections, and POJOs keep the `"object"` fallback for 
now, per the issue.
   
   ### Tests
   
   <!-- How is this change verified? -->
   
   New `SchemaUtilsTest#testGenerateSchemaWithWideNumericTypes` covering all 
six types (primitive and boxed), asserting `"integer"` for the integral types 
and `"number"` for the floating-point types. Existing SchemaUtils tests pass 
unchanged.
   
   ### API
   
   <!-- Does this change touches any public APIs? -->
   
   None. Generated schemas for previously-"object" numeric parameters change to 
the correct JSON Schema types, which is the fix.
   
   ### Documentation
   
   <!-- Do not remove this section. Check the proper box only. -->
   
   - [ ] `doc-needed` <!-- Your PR changes impact docs -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-included` <!-- Your PR already contains the necessary 
documentation updates -->
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   <!-- Do not remove this section. Check the proper box only. -->
   
   - [x] Yes
   - [ ] No
   
   If yes, include a `Generated-by: <tool name and version> (<model name and 
version>)` line, for example `Generated-by: Claude Code 2.1.226 (Claude Opus 
4.6)`, in the commit message so it reaches Git history. Repeat the same line 
here for reviewer visibility. See the [ASF generative tooling 
guidance](https://www.apache.org/legal/generative-tooling.html).
   
   Generated-by Claude Fable 5


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to