save api key
This commit is contained in:
@@ -101,7 +101,7 @@ function toEditable(
|
||||
toolKeys: config.tool_keys || [],
|
||||
prompts: config.prompt_dict || {},
|
||||
port: DEFAULT_PORT,
|
||||
apiKey: DEFAULT_API_KEY,
|
||||
apiKey: config.api_key || DEFAULT_API_KEY,
|
||||
llmName: DEFAULT_LLM_NAME,
|
||||
};
|
||||
}
|
||||
@@ -207,8 +207,8 @@ export default function App() {
|
||||
const editable = toEditable(detail, false);
|
||||
editable.id = id;
|
||||
editable.port = editor?.pipelineId === editable.pipelineId ? editor.port : DEFAULT_PORT;
|
||||
editable.apiKey = editor?.pipelineId === editable.pipelineId ? editor.apiKey : DEFAULT_API_KEY;
|
||||
editable.llmName = editor?.pipelineId === editable.pipelineId ? editor.llmName : DEFAULT_LLM_NAME;
|
||||
// apiKey is loaded from backend (persisted in DB) — don't override with default
|
||||
setEditor(editable);
|
||||
setStatusMessage("");
|
||||
} catch (error) {
|
||||
@@ -305,6 +305,7 @@ export default function App() {
|
||||
prompt_set_id: "default",
|
||||
tool_keys: [],
|
||||
prompt_dict: fallbackPrompts,
|
||||
api_key: "",
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -340,6 +341,7 @@ export default function App() {
|
||||
prompt_set_id: editor.promptSetId,
|
||||
tool_keys: editor.toolKeys,
|
||||
prompt_dict: editor.prompts,
|
||||
api_key: editor.apiKey.trim(),
|
||||
});
|
||||
|
||||
await refreshConfigs();
|
||||
@@ -347,7 +349,7 @@ export default function App() {
|
||||
const saved = toEditable(detail, false);
|
||||
saved.id = makeAgentKey(upsertResp.pipeline_id, upsertResp.prompt_set_id);
|
||||
saved.port = editor.port;
|
||||
saved.apiKey = editor.apiKey;
|
||||
// apiKey is loaded from backend (persisted in DB) — don't override
|
||||
saved.llmName = editor.llmName;
|
||||
setEditor(saved);
|
||||
setSelectedId(saved.id);
|
||||
|
||||
@@ -6,6 +6,7 @@ export type GraphConfigListItem = {
|
||||
description: string;
|
||||
is_active: boolean;
|
||||
tool_keys: string[];
|
||||
api_key: string;
|
||||
created_at?: string | null;
|
||||
updated_at?: string | null;
|
||||
};
|
||||
@@ -21,6 +22,7 @@ export type GraphConfigReadResponse = {
|
||||
prompt_set_id: string;
|
||||
tool_keys: string[];
|
||||
prompt_dict: Record<string, string>;
|
||||
api_key: string;
|
||||
};
|
||||
|
||||
export type GraphConfigUpsertRequest = {
|
||||
@@ -29,6 +31,7 @@ export type GraphConfigUpsertRequest = {
|
||||
prompt_set_id?: string;
|
||||
tool_keys: string[];
|
||||
prompt_dict: Record<string, string>;
|
||||
api_key?: string;
|
||||
};
|
||||
|
||||
export type GraphConfigUpsertResponse = {
|
||||
@@ -37,6 +40,7 @@ export type GraphConfigUpsertResponse = {
|
||||
prompt_set_id: string;
|
||||
tool_keys: string[];
|
||||
prompt_keys: string[];
|
||||
api_key: string;
|
||||
};
|
||||
|
||||
export type AvailableGraphsResponse = {
|
||||
|
||||
Reference in New Issue
Block a user