microsoft / microsoft/semantic-kernel-java
Bug: Set ToolCallBehavior.allowAllKernelFunctions(false) doesn't work for getStreamingChatMessageContentsAsync
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 276
- Forks
- 56
- Merge medio
- 17 h 45 min
- PR fusionados (30 d)
- 4
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con getStreamingChatMessageContentsAsync y compara su comportamiento con getChatMessageContentsAsync usando los ejemplos de ToolCallBehavior.allowAllKernelFunctions(false) del issue. Rastrea cómo OpenAIStreamingChatMessageContent expone las llamadas a herramientas; la tarea está terminada cuando los resultados de streaming contienen los datos esperados de las llamadas a herramientas en lugar de un array vacío, con cobertura para esta reproducción.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- api
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100