microsoft / microsoft/semantic-kernel-java

Java: Not possible to retrieve function calls and function results

Đang mở
#143 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

java
Ngôn ngữ chính
Java
Star
276
Fork
56
Merge trung bình
17 giờ 45 phút
Pull request đã merge (30 ngày)
4

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu từ lệnh gọi Java đến getChatMessageContentsAsync được hiển thị trong issue và theo dõi cách InvocationContext và ChatHistory xử lý các lần gọi hàm và kết quả. So sánh hành vi Java được mô tả với hành vi của ChatHistory trong .NET; công việc được xem là hoàn tất khi các thông báo gọi hàm và kết quả hàm có thể được truy xuất hoặc thêm lại để các câu hỏi sau đó có thể sử dụng lại ngữ cảnh đã truy xuất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
ai, api
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.