mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-22 10:17:13 +00:00
perf: llm model definition
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
|||||||
} from "@/app/home/components/dynamic-form/DynamicFormItemConfig";
|
} from "@/app/home/components/dynamic-form/DynamicFormItemConfig";
|
||||||
import {UUID} from 'uuidjs'
|
import {UUID} from 'uuidjs'
|
||||||
import DynamicFormComponent from "@/app/home/components/dynamic-form/DynamicFormComponent";
|
import DynamicFormComponent from "@/app/home/components/dynamic-form/DynamicFormComponent";
|
||||||
import {ICreateLLMField} from "@/app/home/models/ICreateLLMField";
|
|
||||||
import {httpClient} from "@/app/infra/http/HttpClient";
|
import {httpClient} from "@/app/infra/http/HttpClient";
|
||||||
import { Bot } from "@/app/infra/api/api-types";
|
import { Bot } from "@/app/infra/api/api-types";
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,6 @@ export default function LLMCard({
|
|||||||
<div className={`${styles.basicInfoText} ${styles.bigText}`}>
|
<div className={`${styles.basicInfoText} ${styles.bigText}`}>
|
||||||
{cardVO.name}
|
{cardVO.name}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.basicInfoText}`}>
|
|
||||||
使用模型:{cardVO.model}
|
|
||||||
</div>
|
|
||||||
<div className={`${styles.basicInfoText}`}>
|
<div className={`${styles.basicInfoText}`}>
|
||||||
厂商:{cardVO.company}
|
厂商:{cardVO.company}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
export interface ILLMCardVO {
|
export interface ILLMCardVO {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
model: string;
|
|
||||||
company: string;
|
company: string;
|
||||||
URL: string;
|
URL: string;
|
||||||
}
|
}
|
||||||
@@ -9,14 +8,12 @@ export interface ILLMCardVO {
|
|||||||
export class LLMCardVO implements ILLMCardVO {
|
export class LLMCardVO implements ILLMCardVO {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
model: string;
|
|
||||||
company: string;
|
company: string;
|
||||||
URL: string;
|
URL: string;
|
||||||
|
|
||||||
constructor(props: ILLMCardVO) {
|
constructor(props: ILLMCardVO) {
|
||||||
this.id = props.id;
|
this.id = props.id;
|
||||||
this.name = props.name;
|
this.name = props.name;
|
||||||
this.model = props.model;
|
|
||||||
this.company = props.company;
|
this.company = props.company;
|
||||||
this.URL = props.URL;
|
this.URL = props.URL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,13 +54,21 @@ export default function LLMForm({
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getLLMConfig(id: string): Promise<ICreateLLMField> {
|
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 {
|
return {
|
||||||
name: id,
|
name: llmModel.model.name,
|
||||||
model_provider: "OpenAI",
|
model_provider: llmModel.model.requester,
|
||||||
url: "www.aaa.com",
|
url: llmModel.model.requester_config?.base_url,
|
||||||
api_key: "",
|
api_key: llmModel.model.api_keys[0],
|
||||||
abilities: [],
|
abilities: llmModel.model.abilities,
|
||||||
extra_args: [],
|
extra_args: fakeExtraArgs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user