(improvement)(Chat) Return agent info after creating agent (#1272)

Co-authored-by: lxwcodemonkey
This commit is contained in:
LXW
2024-06-28 19:15:36 +08:00
committed by GitHub
parent 5a052248dc
commit 5bcb76a1de
8 changed files with 17 additions and 23 deletions

View File

@@ -221,8 +221,7 @@ public class S2ArtistDemo extends S2BaseDemo {
agentConfig.getTools().add(llmParserTool);
}
agent.setAgentConfig(JSONObject.toJSONString(agentConfig));
int id = agentService.createAgent(agent, User.getFakeUser());
agent.setId(id);
agentService.createAgent(agent, User.getFakeUser());
}
}

View File

@@ -167,9 +167,8 @@ public class S2VisitsDemo extends S2BaseDemo {
agent.setAgentConfig(JSONObject.toJSONString(agentConfig));
MultiTurnConfig multiTurnConfig = new MultiTurnConfig(false);
agent.setMultiTurnConfig(multiTurnConfig);
int id = agentService.createAgent(agent, User.getFakeUser());
agent.setId(id);
return agent.getId();
Agent agentCreated = agentService.createAgent(agent, User.getFakeUser());
return agentCreated.getId();
}
public DomainResp addDomain() {

View File

@@ -24,7 +24,8 @@ public class Text2SQLEval extends BaseTest {
@BeforeAll
public void init() {
agentId = agentService.createAgent(getLLMAgent(false), DataUtils.getUser());
Agent agent = agentService.createAgent(getLLMAgent(false), DataUtils.getUser());
agentId = agent.getId();
}
@Test