Skip to content

feat(core): support customized tool result converter#413

Merged
AlbumenJ merged 26 commits intoagentscope-ai:mainfrom
yaohuitc:personal-dev
Jan 5, 2026
Merged

feat(core): support customized tool result converter#413
AlbumenJ merged 26 commits intoagentscope-ai:mainfrom
yaohuitc:personal-dev

Conversation

@yaohuitc
Copy link
Contributor

@yaohuitc yaohuitc commented Dec 31, 2025

AgentScope-Java Version

1.0.6-SNAPSHOT

Description

This PR introduces the ability for users to customize how tool execution results are converted and presented to LLMs by implementing custom ToolResultConverter classes. This enhancement provides businesses with greater control over tool output formatting, security, and LLM comprehension.

Previously, all tool results were serialized using a default JSON converter without customization options. This limitation made it difficult to:

  • Add schema descriptions: Provide structured metadata about return objects to improve LLM understanding beyond simple JSON serialization

  • Mask sensitive information: Centrally filter confidential data (keys, PII, internal IDs) from tool responses before sending to LLMs

  • Format outputs optimally: Customize result formatting for specific use cases (compression, summarization, formatting)

  • Add contextual metadata: Include additional information about tool execution (execution time, data sources, confidence scores)

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

@yaohuitc yaohuitc requested a review from a team December 31, 2025 09:47
@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 89.47368% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...src/main/java/io/agentscope/core/tool/Toolkit.java 81.25% 1 Missing and 2 partials ⚠️
...entscope/core/tool/DefaultToolResultConverter.java 94.11% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

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

Pls resolve conflicts

Change-Id: Ic21ee9c89dfca955bbaa7f6cf2ef31ce74ec37e9
Change-Id: I73929f25100b4e5fa5045a536e2554076d1aa7df
Change-Id: I01d05514198850608993e73dda9d3ff849c15b81
Change-Id: Ief21e7112db8385bab3fc74dc3e72e9afdca22c1
Change-Id: I0cbd30e71bc061cf8154112482be56262f3b1dbf
Change-Id: I18ea26e5ccb6f012fd75d54d233dc24fe514461d
Change-Id: Ib2eb22cfee9af20c34fee7e775d1ffb88cf0b52e
Change-Id: I716ca9f16da80da31b83e8a270e3da6429eb9c59
@yaohuitc yaohuitc requested a review from AlbumenJ January 5, 2026 09:25
@AlbumenJ AlbumenJ merged commit 5f19549 into agentscope-ai:main Jan 5, 2026
4 checks passed
AlbumenJ pushed a commit that referenced this pull request Jan 12, 2026
…o agentscope-all (#507)

close #506 

## AgentScope-Java Version

1.0.7-SNAPSHOT

## Description

The dependency was added to agentscope-core but not synced to
agentscope-all, causing NoClassDefFoundError for users of the all-in-one
artifact.

### Root Cause

The `jackson-datatype-jsr310` dependency was added to `agentscope-core`
in commit 5f19549 (#413), but was not synchronized to
`agentscope-all/pom.xml`.

Since `agentscope-core` is declared with `<optional>true</optional>` in
`agentscope-all`, its transitive dependencies are not propagated to
downstream users.

### Solution

Add the missing `jackson-datatype-jsr310` dependency to
`agentscope-distribution/agentscope-all/pom.xml`.

## Checklist

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

- [x]  Code has been formatted with `mvn spotless:apply`
- [x]  All tests are passing (`mvn test`)
- [x]  Javadoc comments are complete and follow project conventions
- [x] Related documentation has been updated (e.g. links, examples,
etc.)
- [x]  Code is ready for review
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.

2 participants