mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
perf: async bug in llm form
This commit is contained in:
@@ -132,14 +132,17 @@ export default function LLMForm({
|
||||
>([]);
|
||||
|
||||
useEffect(() => {
|
||||
initLLMModelFormComponent();
|
||||
initLLMModelFormComponent().then(() => {
|
||||
if (editMode && initLLMId) {
|
||||
getLLMConfig(initLLMId).then((val) => {
|
||||
form.setValue('name', val.name);
|
||||
form.setValue('model_provider', val.model_provider);
|
||||
form.setValue('url', val.url);
|
||||
form.setValue('api_key', val.api_key);
|
||||
form.setValue('abilities', val.abilities as ('vision' | 'func_call')[]);
|
||||
form.setValue(
|
||||
'abilities',
|
||||
val.abilities as ('vision' | 'func_call')[],
|
||||
);
|
||||
// 转换extra_args为新格式
|
||||
if (val.extra_args) {
|
||||
const args = val.extra_args.map((arg) => {
|
||||
@@ -164,6 +167,7 @@ export default function LLMForm({
|
||||
form.reset();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
});
|
||||
}, []);
|
||||
|
||||
const addExtraArg = () => {
|
||||
|
||||
Reference in New Issue
Block a user