Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ JoyAgent-JDGenie是一个通用的多智能体框架,对于用户需要定制

手动更新 genie-tool/.env_template 中的 OPENAI_API_KEY、OPENAI_BASE_URL、DEFAULT_MODEL、SERPER_SEARCH_API_KEY
使用DeepSeek时: 设置DEEPSEEK_API_KEY、DEEPSEEK_API_BASE,DEFAULT_MODEL 设置为 deepseek/deepseek-chat,所有 ${DEFAULT_MODEL} 也都改成deepseek/deepseek-chat
使用阿里百炼平台的模型时: 设置OPENAI_API_KEY、OPENAI_BASE_URL,模型名字需要带个前缀 openai/,如: openai/qwen-turbo 用于兼容openai模型

3. 编译dockerfile
docker build -t genie:latest .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public String act() {
List<String> results = new ArrayList<>();
for (ToolCall command : toolCalls) {
String result = toolResults.get(command.getId());
if (!Arrays.asList("code_interpreter", "report_tool", "file_tool", "deep_search").contains(command.getFunction().getName())) {
if (!Arrays.asList("code_interpreter_tool", "report_tool", "file_tool", "deep_search").contains(command.getFunction().getName())) {
String toolName = command.getFunction().getName();
printer.send("tool_result", AgentResponse.ToolResult.builder()
.toolName(toolName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public String act() {
List<String> results = new ArrayList<>();
for (ToolCall command : toolCalls) {
String result = toolResults.get(command.getId());
if (!Arrays.asList("code_interpreter", "report_tool", "file_tool", "deep_search").contains(command.getFunction().getName())) {
if (!Arrays.asList("code_interpreter_tool", "report_tool", "file_tool", "deep_search").contains(command.getFunction().getName())) {
String toolName = command.getFunction().getName();
printer.send("tool_result", AgentResponse.ToolResult.builder()
.toolName(toolName)
Expand Down
7 changes: 5 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 @@ -700,7 +700,6 @@ public void onResponse(Call call, Response response) {
// tool call
if (Objects.nonNull(choice.delta.tool_calls)) {
List<OpenAIToolCall> openAIToolCalls = choice.delta.tool_calls;
// log.info("{} recv tool call data: {}", context.getRequestId(), openAIToolCalls);
for (OpenAIToolCall toolCall : openAIToolCalls) {
OpenAIToolCall currentToolCall = openToolCallsMap.get(toolCall.index);
if (Objects.isNull(currentToolCall)) {
Expand All @@ -714,8 +713,12 @@ public void onResponse(Call call, Response response) {
currentToolCall.type = toolCall.type;
}
if (Objects.nonNull(toolCall.function)) {
if (Objects.isNull(currentToolCall.function)) {
currentToolCall.function = new OpenAIFunction();
currentToolCall.function.arguments = "";
}
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class CodeInterpreterTool implements BaseTool {

@Override
public String getName() {
return "code_interpreter";
return "code_interpreter_tool";
}

@Override
Expand Down