mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-09 20:55:06 +02:00
Fix model names for enabled LLM providers
This commit is contained in:
@@ -87,7 +87,7 @@ class FullLLMProvider(LLMProvider):
|
|||||||
is_default_provider=llm_provider_model.is_default_provider,
|
is_default_provider=llm_provider_model.is_default_provider,
|
||||||
model_names=(
|
model_names=(
|
||||||
llm_provider_model.model_names
|
llm_provider_model.model_names
|
||||||
or fetch_models_for_provider(llm_provider_model.name)
|
or fetch_models_for_provider(llm_provider_model.provider)
|
||||||
or [llm_provider_model.default_model_name]
|
or [llm_provider_model.default_model_name]
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@@ -7,6 +7,7 @@ import { useState } from "react";
|
|||||||
import { LLM_PROVIDERS_ADMIN_URL } from "./constants";
|
import { LLM_PROVIDERS_ADMIN_URL } from "./constants";
|
||||||
import { mutate } from "swr";
|
import { mutate } from "swr";
|
||||||
import { Badge, Button } from "@tremor/react";
|
import { Badge, Button } from "@tremor/react";
|
||||||
|
import isEqual from "lodash/isEqual";
|
||||||
|
|
||||||
function LLMProviderUpdateModal({
|
function LLMProviderUpdateModal({
|
||||||
llmProviderDescriptor,
|
llmProviderDescriptor,
|
||||||
@@ -165,7 +166,6 @@ export function ConfiguredLLMProviderDisplay({
|
|||||||
(llmProviderDescriptors) =>
|
(llmProviderDescriptors) =>
|
||||||
llmProviderDescriptors.name === provider.provider
|
llmProviderDescriptors.name === provider.provider
|
||||||
);
|
);
|
||||||
console.log(provider.model_names.length);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LLMProviderDisplay
|
<LLMProviderDisplay
|
||||||
@@ -174,7 +174,9 @@ export function ConfiguredLLMProviderDisplay({
|
|||||||
// then the provider is custom - don't use the default
|
// then the provider is custom - don't use the default
|
||||||
// provider descriptor
|
// provider descriptor
|
||||||
llmProviderDescriptor={
|
llmProviderDescriptor={
|
||||||
provider.model_names.length > 0 ? null : defaultProviderDesciptor
|
isEqual(provider.model_names, defaultProviderDesciptor?.llm_names)
|
||||||
|
? defaultProviderDesciptor
|
||||||
|
: null
|
||||||
}
|
}
|
||||||
existingLlmProvider={provider}
|
existingLlmProvider={provider}
|
||||||
/>
|
/>
|
||||||
|
@@ -136,13 +136,6 @@ export function LLMConfiguration() {
|
|||||||
return <ThreeDotsLoader />;
|
return <ThreeDotsLoader />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wellKnownLLMProviderNames = llmProviderDescriptors.map(
|
|
||||||
(llmProviderDescriptor) => llmProviderDescriptor.name
|
|
||||||
);
|
|
||||||
const customLLMProviders = existingLlmProviders.filter(
|
|
||||||
(llmProvider) => !wellKnownLLMProviderNames.includes(llmProvider.name)
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Title className="mb-2">Enabled LLM Providers</Title>
|
<Title className="mb-2">Enabled LLM Providers</Title>
|
||||||
|
Reference in New Issue
Block a user