|
8 | 8 | import static org.opensearch.ml.common.conversation.ActionConstants.ADDITIONAL_INFO_FIELD;
|
9 | 9 | import static org.opensearch.ml.common.conversation.ActionConstants.AI_RESPONSE_FIELD;
|
10 | 10 | import static org.opensearch.ml.common.utils.StringUtils.gson;
|
11 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.DISABLE_TRACE; |
12 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.PROMPT_CHAT_HISTORY_PREFIX; |
13 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.PROMPT_PREFIX; |
14 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.PROMPT_SUFFIX; |
15 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.RESPONSE_FORMAT_INSTRUCTION; |
16 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.TOOL_RESPONSE; |
17 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.VERBOSE; |
18 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.constructToolParams; |
19 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.createTools; |
20 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.getMessageHistoryLimit; |
21 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.getMlToolSpecs; |
22 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.getToolName; |
23 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.getToolNames; |
24 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.outputToOutputString; |
25 |
| -import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.parseLLMOutput; |
| 11 | +import static org.opensearch.ml.engine.algorithms.agent.AgentUtils.*; |
26 | 12 | import static org.opensearch.ml.engine.algorithms.agent.PromptTemplate.CHAT_HISTORY_PREFIX;
|
27 | 13 |
|
28 | 14 | import java.security.PrivilegedActionException;
|
@@ -170,6 +156,7 @@ public void run(MLAgent mlAgent, Map<String, String> params, ActionListener<Obje
|
170 | 156 | }
|
171 | 157 |
|
172 | 158 | private void runAgent(MLAgent mlAgent, Map<String, String> params, ActionListener<Object> listener, Memory memory, String sessionId) {
|
| 159 | + fillSelectTool(params); |
173 | 160 | List<MLToolSpec> toolSpecs = getMlToolSpecs(mlAgent, params);
|
174 | 161 | Map<String, Tool> tools = new HashMap<>();
|
175 | 162 | Map<String, MLToolSpec> toolSpecMap = new HashMap<>();
|
|
0 commit comments