Java: Not possible to retrieve function calls and function results
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start at the Java call to getChatMessageContentsAsync shown in the issue and trace how InvocationContext and ChatHistory handle function calls and results. Compare the described Java behavior with the .NET ChatHistory behavior; done means function-call and function-result messages can be retrieved or readded so later questions can reuse the retrieved context.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 276
- Forks
- 56
- Avg merge
- 17h 45m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/semantic-kernel-java
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
microsoft/semantic-kernel-java#334 · 1 comment ·
-
Feature Parity Inquiry: Multi-Agent Orchestration and Roadmap Alignment with Python/.NET Versions Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/semantic-kernel-java#331 · 7 comments ·
-
bug triage
microsoft/semantic-kernel-java#330 · 3 comments · 1 assignee ·
-
bug triage
Difficulty 5/5 Over a week Newbie friendliness 20/100
microsoft/semantic-kernel-java#328 · 1 comment ·
-
microsoft/semantic-kernel-java#323 · 1 reaction · 2 assignees ·
All issues in microsoft/semantic-kernel-java
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100