microsoft / microsoft/semantic-kernel-java
Java: Not possible to retrieve function calls and function results
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 276
- 派生
- 56
- 平均合并
- 17 小时 45 分钟
- 30 天内合并 PR
- 4
描述
After running the following code, it is not possible to retrieve the function calls and function result messages so that they can be readded to the history.
InvocationContext invocationContext = new InvocationContext.Builder()
.withToolCallBehavior(ToolCallBehavior.allowAllKernelFunctions(true))
.build();
List<ChatMessageContent<?>> results = chat.getChatMessageContentsAsync(chatHistory, kernel, invocationContext)
.block();
In .NET, after invoking the chat completion model, the ChatHistory is mutated so that it includes all of the messages that were created (including function calls from the assistant role and function results as tool messages)
Because of this limitation, it is not possible for the AI to reuse context it was able to retrieve in previous function calls/results. For example, in the following chat, the AI used a function call to get the states of the lightbulbs. This included the IDs of the lights which are necessary for subsequent function calls.
Unfortunately, because the function result is lost, subsequent questions aren't able to use that information and the AI cannot complete them.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 issue 中所示的 Java 对 getChatMessageContentsAsync 的调用开始,跟踪 InvocationContext 和 ChatHistory 如何处理函数调用及其结果。将所描述的 Java 行为与 .NET 中 ChatHistory 的行为进行比较;当函数调用消息和函数结果消息可以被检索或重新添加,使后续问题能够复用已检索的上下文时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- ai, api
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100