Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions genie-backend/src/main/java/com/jd/genie/agent/llm/LLM.java
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ public void onResponse(Call call, Response response) {
OpenAIToolCall currentToolCall = openToolCallsMap.get(toolCall.index);
if (Objects.isNull(currentToolCall)) {
currentToolCall = new OpenAIToolCall();
currentToolCall.function = new OpenAIFunction();
currentToolCall.function.arguments = "";
}
// [{"index":0,"id":"call_j74R8JMFWTC4rW5wHJ0TtmNU","type":"function","function":{"name":"planning","arguments":""}}]
if (Objects.nonNull(toolCall.id)) {
Expand All @@ -715,7 +717,7 @@ public void onResponse(Call call, Response response) {
}
if (Objects.nonNull(toolCall.function)) {
if (Objects.nonNull(toolCall.function.name)) {
currentToolCall.function = toolCall.function;
currentToolCall.function.name = toolCall.function.name;
}
if (Objects.nonNull(toolCall.function.arguments)) {
currentToolCall.function.arguments += toolCall.function.arguments;
Expand Down Expand Up @@ -1189,4 +1191,4 @@ public static class ClaudeDelta {
}


}
}