Bug: Set ToolCallBehavior.allowAllKernelFunctions(false) doesn't work for getStreamingChatMessageContentsAsync
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with getStreamingChatMessageContentsAsync and compare its behavior with getChatMessageContentsAsync, using the ToolCallBehavior.allowAllKernelFunctions(false) examples in the issue. Trace how OpenAIStreamingChatMessageContent exposes tool calls; done means streaming results contain the expected tool-call data instead of an empty array, with coverage for this reproduction.
Written by the indexing model from the issue text.
Description
Describe the bug
I try to invoke toolcall myself in a streaming chat.
I have learned that how to invoke a toolcall in an non-streaming chat. like
Kernel kernel = Kernel.builder().withAIService(ChatCompletionService.class, chatCompletionService)
.withPlugin(KernelPluginFactory.createFromObject(this, "time"))
.build();
chatCompletionService
.getChatMessageContentsAsync("what time is it now?", kernel, InvocationContext.builder()
.withToolCallBehavior(ToolCallBehavior.allowAllKernelFunctions(false))
.build())
.block()
.stream().filter(it->it instanceof OpenAIChatMessageContent<?>)
.map(it->((OpenAIChatMessageContent)it))
.forEach(it->{
System.out.println(it.getToolCall().size());
});
As you can see, I can get the toolCall value;
but when I change to an streaming chat, like
Kernel kernel = Kernel.builder().withAIService(ChatCompletionService.class, chatCompletionService)
.withPlugin(KernelPluginFactory.createFromObject(this, "time"))
.build();
chatCompletionService
.getStreamingChatMessageContentsAsync("what time is it now?", kernel, InvocationContext.builder()
.withToolCallBehavior(ToolCallBehavior.allowAllKernelFunctions(false))
.build())
.filter(it->it instanceof OpenAIStreamingChatMessageContent<?>)
.map(it->(OpenAIStreamingChatMessageContent)it)
.doOnNext(it->{
System.out.println(it.getToolCall().size());
}).subscribe();
the toolCall will always be an empty array.
- 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 untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
emitter:client:csharp feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficulty 2/5 1-3 hours Newbie friendliness 78/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