Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(agent): optimize schema parameter handling for structured output#1312

Merged
chickenlj merged 3 commits into
agentscope-ai:mainfrom
LearningGp:fix/structuredoutput
Apr 29, 2026
Merged

refactor(agent): optimize schema parameter handling for structured output#1312
chickenlj merged 3 commits into
agentscope-ai:mainfrom
LearningGp:fix/structuredoutput

Conversation

@LearningGp
Copy link
Copy Markdown
Collaborator

AgentScope-Java Version

1.0.11

Description

refactor(agent): optimize schema parameter handling for structured output

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the structured-output tool schema wrapping so that JSON Schema $defs (and legacy definitions) are hoisted to the tool-parameters root, enabling $ref resolution when the actual schema is nested under properties.response.

Changes:

  • Shallow-copies the generated schema and hoists $defs / definitions out of properties.response into the root parameters object.
  • Adds a helper method to extract/hoist definition maps without mutating the shared schema map.

@LearningGp LearningGp force-pushed the fix/structuredoutput branch from 94ba865 to c4f851b Compare April 28, 2026 05:47
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...scope/core/agent/StructuredOutputCapableAgent.java 90.90% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@chickenlj chickenlj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@chickenlj chickenlj merged commit 55484f3 into agentscope-ai:main Apr 29, 2026
5 checks passed
liangxingguang pushed a commit to liangxingguang/agentscope-java that referenced this pull request May 21, 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.

4 participants