enable comma in tool list

This commit is contained in:
2026-03-12 11:36:11 +08:00
parent c9b1c5cb32
commit 33faedc1b1

View File

@@ -36,6 +36,7 @@ type EditableAgent = {
pipelineId: string; pipelineId: string;
promptSetId?: string; promptSetId?: string;
toolKeys: string[]; toolKeys: string[];
toolKeysInput: string;
prompts: Record<string, string>; prompts: Record<string, string>;
apiKey: string; apiKey: string;
llmName: string; llmName: string;
@@ -459,6 +460,7 @@ function toEditable(
pipelineId: config.pipeline_id, pipelineId: config.pipeline_id,
promptSetId: config.prompt_set_id, promptSetId: config.prompt_set_id,
toolKeys: config.tool_keys || [], toolKeys: config.tool_keys || [],
toolKeysInput: (config.tool_keys || []).join(", "),
prompts: config.prompt_dict || {}, prompts: config.prompt_dict || {},
apiKey: config.api_key || DEFAULT_API_KEY, apiKey: config.api_key || DEFAULT_API_KEY,
llmName: DEFAULT_LLM_NAME, llmName: DEFAULT_LLM_NAME,
@@ -750,6 +752,7 @@ export default function App() {
graphId, graphId,
prompts: { ...defaults.prompt_dict }, prompts: { ...defaults.prompt_dict },
toolKeys: defaults.tool_keys || [], toolKeys: defaults.tool_keys || [],
toolKeysInput: (defaults.tool_keys || []).join(", "),
actBackend: actBackend:
graphId === "deepagent" graphId === "deepagent"
? prev.actBackend || DEFAULT_DEEPAGENT_ACT_BACKEND ? prev.actBackend || DEFAULT_DEEPAGENT_ACT_BACKEND
@@ -1366,8 +1369,12 @@ export default function App() {
<label> <label>
tool_keys (comma separated) tool_keys (comma separated)
<input <input
value={editor.toolKeys.join(", ")} value={editor.toolKeysInput}
onChange={(e) => updateEditor("toolKeys", parseToolCsv(e.target.value))} onChange={(e) => {
const raw = e.target.value;
updateEditor("toolKeysInput", raw);
updateEditor("toolKeys", parseToolCsv(raw));
}}
placeholder="tool_a, tool_b" placeholder="tool_a, tool_b"
disabled={busy} disabled={busy}
/> />