Tech
[程序员] 给 tinystruct 加了一层 TypeSafe 的自然语言调用
最近给框架 tinystruct 做了一个有点好玩的东西。
起因
现在很多 AI Agent 的常见模式都是:
用户
↓
LLM
↓
Tool Calling
↓
生成参数
↓
执行 Tool
但我一直觉得这里有一个核心问题: 如果业务代码本来就是确定且类型严密的,为什么还要让 LLM 去“重新编程”?
在 tinystruct 框架中,我们本来就可以这样定义业务方法:
@Action(
value = "create-user",
description = "Create a new user account.",
arguments = {
@Argument(key = "name", description = "The user's name."),
@Argument(key = "role", description = "The user's role.")
}
)
public String createUser(String name, Ro...
Read the full discussion on V2EX
This article was aggregated from V2EX. Click to join the conversation.
View on V2EX