mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
perf: llm model definition
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user