[Feat]: Simplification of the client API?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
查看 spec 模块中的客户端 API,重点关注使用 XXXParams 对象(如 TaskIdParams)的方法。以现有的 sendMessage 方法作为该模式的参考。确定所有可以简化的方法,然后创建接受基本类型参数并委托给现有实现的重载版本。确保向后兼容并测试更改。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
The client API is a thin wrapper around the domain objects in the spec module.
I wonder if we could not make the API a bit simpler while retaining all the capabilities it exposes.
Describe the solution you'd like
For example, a lot of calls wrap their parameters in XXXParams object:
public Task cancelTask(TaskIdParams request)
but TaskIdParams is composed of a taskId and a metadata map.
Could the call simply be:
public Task cancelTask(String taskId, Map<String, Object> metadata) {
return clientTransport.cancelTask(new TaskIdParams(taskId, metadata), request, context);
}
and a default method:
public default Task cancelTask(String taskId) {
return cancelTask(taskId, emptyMap();
}
This way, the TaskIdParams does not leak to the Client API (making it bigger than it needs to be.
The API is already to that for its sendMessage methods that hides the internal MessageSendParams.
This is a pattern that should be applied to other methods as well
Describe alternatives you've considered
No response
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要语言
- Java
- 星标
- 504
- 派生
- 184
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
a2aproject/a2a-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
a2aproject/a2a-java#1012 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
a2aproject/a2a-java#464 · 1 条评论 ·
维护者通常 1 天内回复
-
Create a sample that demonstrates how to use a shared contextId across multiple tasks可能重新可做 @tanish111 于 356 天前认领,目前没有进行中的 PR。 未关闭sample
难度 2/5 1-3 小时 新手友好度 70/100
a2aproject/a2a-java#375 · 5 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 28/100
a2aproject/a2a-java#1211 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
a2aproject/a2a-java#1207 ·
维护者通常 1 天内回复
查看 a2aproject/a2a-java 的全部 Issue
相似的 Issue
-
`RedisList.reversed()` view returns an empty `range` and `trim` removes all elements可能已有人在做 @CCCLL 今天认领。 未关闭status: waiting-for-triage
难度 2/5 1-3 小时 新手友好度 72/100
spring-projects/spring-data-redis#3461 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
devops-thiago/ThrillhouseBot#1093 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
wimdeblauwe/htmx-spring-boot#205 ·
-
[BUG] 增量 SSE 解析器未识别单独 CR 换行,导致事件无法及时交付可能已有人在做 @king-wwwhhh 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
langchain4j/langchain4j#6669 ·
维护者通常 1 天内回复
-
enhancement tech-debt
难度 2/5 1-3 小时 新手友好度 78/100
Albertinesilva/backend-engineering-journey-java-springboot#41 ·