microsoft / microsoft/semantic-kernel-java
Java: Not possible to retrieve function calls and function results
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 276
- Fork
- 56
- Merge medio
- 17h 45m
- PR unite (30g)
- 4
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalla chiamata Java a getChatMessageContentsAsync mostrata nell’issue e traccia il modo in cui InvocationContext e ChatHistory gestiscono le chiamate a funzione e i relativi risultati. Confronta il comportamento Java descritto con il comportamento di ChatHistory in .NET; il lavoro è completo quando i messaggi di chiamata a funzione e di risultato della funzione possono essere recuperati o aggiunti nuovamente, così che le domande successive possano riutilizzare il contesto recuperato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- ai, api
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100