microsoft / microsoft/semantic-kernel-java

Java: Not possible to retrieve function calls and function results

Abierto
#143 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

java
Lenguaje dominante
Java
Estrellas
276
Forks
56
Merge medio
17 h 45 min
PR fusionados (30 d)
4

Descripción

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.

image

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la llamada de Java a getChatMessageContentsAsync mostrada en el issue y sigue cómo InvocationContext y ChatHistory gestionan las llamadas a funciones y sus resultados. Compara el comportamiento de Java descrito con el comportamiento de ChatHistory en .NET; se considera terminado cuando los mensajes de llamada a función y de resultado de función se pueden recuperar o volver a añadir para que las preguntas posteriores puedan reutilizar el contexto recuperado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
ai, api
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.