[Java] Add Param<T> public API type for lambda-defined tools#1845
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
Introduce `com.github.copilot.tool.Param<T>` — an immutable, fluent runtime parameter metadata class for inline/lambda tool definitions. Validation behavior: - Rejects blank name/description - Rejects required=true with non-empty defaultValue - Validates default values against declared Class<T> Includes comprehensive unit tests (ParamTest, 24 cases). Updates Phase 4.1 checkbox in the implementation plan.
Copilot
AI
changed the title
[WIP] Add public API types for lambda-defined tools
[Java] Add Jun 30, 2026
Param<T> public API type for lambda-defined tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 4.1 of #1810: introduces the runtime parameter metadata class needed by the upcoming
ToolDefinition.from(...)lambda overloads.Changes
Param<T>(com.github.copilot.tool) — immutable, fluent parameter descriptor with construction-time validation:name/descriptionrequired=truecombined with a non-emptydefaultValuedefaultValueagainst declaredClass<T>(String, numeric primitives/boxed, Boolean, enums; unsupported types throw)ParamTest— 27 unit tests covering factory methods, fluent mutators, all validation rules, and equality semanticsUsage
No changes to
module-info.javaneeded —com.github.copilot.toolis already exported.