perf: llm model definition

This commit is contained in:
Junyan Qin
2025-04-27 17:04:56 +08:00
parent 3003f39e34
commit b85f798364
4 changed files with 14 additions and 13 deletions

View File

@@ -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";

View File

@@ -19,9 +19,6 @@ export default function LLMCard({
<div className={`${styles.basicInfoText} ${styles.bigText}`}>
{cardVO.name}
</div>
<div className={`${styles.basicInfoText}`}>
使{cardVO.model}
</div>
<div className={`${styles.basicInfoText}`}>
{cardVO.company}
</div>

View File

@@ -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;
}

View File

@@ -54,13 +54,21 @@ export default function LLMForm({
}
async function getLLMConfig(id: string): Promise<ICreateLLMField> {
const llmModel = await httpClient.getProviderLLMModel(id)
let fakeExtraArgs = []
const extraArgs = llmModel.model.extra_args as Record<string, string>
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,
}
}