From b85f798364b12683c320c0450ee9e7aa3525e0b4 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Sun, 27 Apr 2025 17:04:56 +0800 Subject: [PATCH] perf: llm model definition --- .../home/bots/components/bot-form/BotForm.tsx | 1 - .../models/component/llm-card/LLMCard.tsx | 3 --- .../models/component/llm-card/LLMCardVO.ts | 3 --- .../models/component/llm-form/LLMForm.tsx | 20 +++++++++++++------ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/web_ui/src/app/home/bots/components/bot-form/BotForm.tsx b/web_ui/src/app/home/bots/components/bot-form/BotForm.tsx index b3fa4999..62f83957 100644 --- a/web_ui/src/app/home/bots/components/bot-form/BotForm.tsx +++ b/web_ui/src/app/home/bots/components/bot-form/BotForm.tsx @@ -9,7 +9,6 @@ import { } from "@/app/home/components/dynamic-form/DynamicFormItemConfig"; import {UUID} from 'uuidjs' import DynamicFormComponent from "@/app/home/components/dynamic-form/DynamicFormComponent"; -import {ICreateLLMField} from "@/app/home/models/ICreateLLMField"; import {httpClient} from "@/app/infra/http/HttpClient"; import { Bot } from "@/app/infra/api/api-types"; diff --git a/web_ui/src/app/home/models/component/llm-card/LLMCard.tsx b/web_ui/src/app/home/models/component/llm-card/LLMCard.tsx index 3cad394d..a7672445 100644 --- a/web_ui/src/app/home/models/component/llm-card/LLMCard.tsx +++ b/web_ui/src/app/home/models/component/llm-card/LLMCard.tsx @@ -19,9 +19,6 @@ export default function LLMCard({
{cardVO.name}
-
- 使用模型:{cardVO.model} -
厂商:{cardVO.company}
diff --git a/web_ui/src/app/home/models/component/llm-card/LLMCardVO.ts b/web_ui/src/app/home/models/component/llm-card/LLMCardVO.ts index 6b0b07d3..6d62cb3c 100644 --- a/web_ui/src/app/home/models/component/llm-card/LLMCardVO.ts +++ b/web_ui/src/app/home/models/component/llm-card/LLMCardVO.ts @@ -1,7 +1,6 @@ export interface ILLMCardVO { id: string; name: string; - model: string; company: string; URL: string; } @@ -9,14 +8,12 @@ export interface ILLMCardVO { export class LLMCardVO implements ILLMCardVO { id: string; name: string; - model: string; company: string; URL: string; constructor(props: ILLMCardVO) { this.id = props.id; this.name = props.name; - this.model = props.model; this.company = props.company; this.URL = props.URL; } diff --git a/web_ui/src/app/home/models/component/llm-form/LLMForm.tsx b/web_ui/src/app/home/models/component/llm-form/LLMForm.tsx index c580031e..f52756ce 100644 --- a/web_ui/src/app/home/models/component/llm-form/LLMForm.tsx +++ b/web_ui/src/app/home/models/component/llm-form/LLMForm.tsx @@ -54,13 +54,21 @@ export default function LLMForm({ } async function getLLMConfig(id: string): Promise { + + const llmModel = await httpClient.getProviderLLMModel(id) + + let fakeExtraArgs = [] + const extraArgs = llmModel.model.extra_args as Record + for (const key in extraArgs) { + fakeExtraArgs.push(`${key}:${extraArgs[key]}`) + } return { - name: id, - model_provider: "OpenAI", - url: "www.aaa.com", - api_key: "", - abilities: [], - extra_args: [], + name: llmModel.model.name, + model_provider: llmModel.model.requester, + url: llmModel.model.requester_config?.base_url, + api_key: llmModel.model.api_keys[0], + abilities: llmModel.model.abilities, + extra_args: fakeExtraArgs, } }