mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-08-02 05:02:48 +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,
|
||||
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]
|
||||
),
|
||||
)
|
||||
|
@@ -7,6 +7,7 @@ import { useState } from "react";
|
||||
import { LLM_PROVIDERS_ADMIN_URL } from "./constants";
|
||||
import { mutate } from "swr";
|
||||
import { Badge, Button } from "@tremor/react";
|
||||
import isEqual from "lodash/isEqual";
|
||||
|
||||
function LLMProviderUpdateModal({
|
||||
llmProviderDescriptor,
|
||||
@@ -165,7 +166,6 @@ export function ConfiguredLLMProviderDisplay({
|
||||
(llmProviderDescriptors) =>
|
||||
llmProviderDescriptors.name === provider.provider
|
||||
);
|
||||
console.log(provider.model_names.length);
|
||||
|
||||
return (
|
||||
<LLMProviderDisplay
|
||||
@@ -174,7 +174,9 @@ export function ConfiguredLLMProviderDisplay({
|
||||
// then the provider is custom - don't use the default
|
||||
// provider descriptor
|
||||
llmProviderDescriptor={
|
||||
provider.model_names.length > 0 ? null : defaultProviderDesciptor
|
||||
isEqual(provider.model_names, defaultProviderDesciptor?.llm_names)
|
||||
? defaultProviderDesciptor
|
||||
: null
|
||||
}
|
||||
existingLlmProvider={provider}
|
||||
/>
|
||||
|
@@ -136,13 +136,6 @@ export function LLMConfiguration() {
|
||||
return <ThreeDotsLoader />;
|
||||
}
|
||||
|
||||
const wellKnownLLMProviderNames = llmProviderDescriptors.map(
|
||||
(llmProviderDescriptor) => llmProviderDescriptor.name
|
||||
);
|
||||
const customLLMProviders = existingLlmProviders.filter(
|
||||
(llmProvider) => !wellKnownLLMProviderNames.includes(llmProvider.name)
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Title className="mb-2">Enabled LLM Providers</Title>
|
||||
|
Reference in New Issue
Block a user