microsoft / microsoft/semantic-kernel-java

Java: Not possible to retrieve function calls and function results

オープン
#143 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

java
主要言語
Java
スター
276
フォーク
56
平均マージ
17時間 45分
マージ済み PR(30日)
4

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Issue に示されている getChatMessageContentsAsync への Java 呼び出しから始め、InvocationContext と ChatHistory が関数呼び出しと結果をどのように処理するかを追跡します。説明されている Java の動作を .NET の ChatHistory の動作と比較します。後続の質問で取得したコンテキストを再利用できるように、関数呼び出しメッセージと関数結果メッセージを取得または再追加できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
ai, api
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。