microsoft / microsoft/semantic-kernel-java
Java: Not possible to retrieve function calls and function results
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 276
- Forks
- 56
- Ø Merge
- 17 Std. 45 Min.
- Gemergte PRs (30 T.)
- 4
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem im Issue gezeigten Java-Aufruf von getChatMessageContentsAsync und verfolge, wie InvocationContext und ChatHistory Funktionsaufrufe und Ergebnisse verarbeiten. Vergleiche das beschriebene Java-Verhalten mit dem .NET-Verhalten von ChatHistory; fertig ist die Aufgabe, wenn Nachrichten zu Funktionsaufrufen und Funktionsergebnissen abgerufen oder erneut hinzugefügt werden können, sodass spätere Fragen den abgerufenen Kontext wiederverwenden können.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- ai, api
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100