mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-01 15:17:15 +00:00
perf: no longer ask for apikeys for ollama and lm studio
This commit is contained in:
@@ -103,7 +103,7 @@ export default function LLMForm({
|
|||||||
name: '',
|
name: '',
|
||||||
model_provider: '',
|
model_provider: '',
|
||||||
url: '',
|
url: '',
|
||||||
api_key: '',
|
api_key: 'sk-xxxxx',
|
||||||
abilities: [],
|
abilities: [],
|
||||||
extra_args: [],
|
extra_args: [],
|
||||||
},
|
},
|
||||||
@@ -131,6 +131,7 @@ export default function LLMForm({
|
|||||||
string[]
|
string[]
|
||||||
>([]);
|
>([]);
|
||||||
const [modelTesting, setModelTesting] = useState(false);
|
const [modelTesting, setModelTesting] = useState(false);
|
||||||
|
const [currentModelProvider, setCurrentModelProvider] = useState('');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initLLMModelFormComponent().then(() => {
|
initLLMModelFormComponent().then(() => {
|
||||||
@@ -138,6 +139,7 @@ export default function LLMForm({
|
|||||||
getLLMConfig(initLLMId).then((val) => {
|
getLLMConfig(initLLMId).then((val) => {
|
||||||
form.setValue('name', val.name);
|
form.setValue('name', val.name);
|
||||||
form.setValue('model_provider', val.model_provider);
|
form.setValue('model_provider', val.model_provider);
|
||||||
|
setCurrentModelProvider(val.model_provider);
|
||||||
form.setValue('url', val.url);
|
form.setValue('url', val.url);
|
||||||
form.setValue('api_key', val.api_key);
|
form.setValue('api_key', val.api_key);
|
||||||
form.setValue(
|
form.setValue(
|
||||||
@@ -409,6 +411,7 @@ export default function LLMForm({
|
|||||||
<Select
|
<Select
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
field.onChange(value);
|
field.onChange(value);
|
||||||
|
setCurrentModelProvider(value);
|
||||||
const index = requesterNameList.findIndex(
|
const index = requesterNameList.findIndex(
|
||||||
(item) => item.value === value,
|
(item) => item.value === value,
|
||||||
);
|
);
|
||||||
@@ -455,6 +458,10 @@ export default function LLMForm({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{!['lmstudio-chat-completions', 'ollama-chat'].includes(
|
||||||
|
currentModelProvider,
|
||||||
|
) && (
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="api_key"
|
name="api_key"
|
||||||
@@ -471,6 +478,8 @@ export default function LLMForm({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="abilities"
|
name="abilities"
|
||||||
|
|||||||
Reference in New Issue
Block a user