Small fixes to LLM configuration screen

This commit is contained in:
Weves 2024-05-14 22:44:52 -07:00 committed by Chris Weaver
parent f087d3eac0
commit 8c17c77ed9
5 changed files with 16 additions and 11 deletions

View File

@ -22,13 +22,17 @@ function LLMProviderUpdateModal({
shouldMarkAsDefault?: boolean;
setPopup?: (popup: PopupSpec) => void;
}) {
const providerName =
llmProviderDescriptor?.display_name ||
llmProviderDescriptor?.name ||
existingLlmProvider?.name ||
"Custom LLM Provider";
const providerName = existingLlmProvider?.name
? `"${existingLlmProvider.name}"`
: null ||
llmProviderDescriptor?.display_name ||
llmProviderDescriptor?.name ||
"Custom LLM Provider";
return (
<Modal title={`Setup ${providerName}`} onOutsideClick={() => onClose()}>
<Modal
title={`${llmProviderDescriptor ? "Configure" : "Setup"} ${providerName}`}
onOutsideClick={() => onClose()}
>
<div className="max-h-[70vh] overflow-y-auto px-4">
{llmProviderDescriptor ? (
<LLMProviderUpdateForm
@ -64,9 +68,9 @@ function LLMProviderDisplay({
const { popup, setPopup } = usePopup();
const providerName =
existingLlmProvider?.name ||
llmProviderDescriptor?.display_name ||
llmProviderDescriptor?.name ||
existingLlmProvider?.name;
llmProviderDescriptor?.name;
return (
<div>
{popup}

View File

@ -191,6 +191,7 @@ export function LLMProviderUpdateForm({
label="Display Name"
subtext="A name which you can use to identify this provider when selecting it in the UI."
placeholder="Display Name"
disabled={existingLlmProvider ? true : false}
/>
<Divider />

View File

@ -38,6 +38,7 @@ export interface FullLLMProvider extends LLMProvider {
export interface LLMProviderDescriptor {
name: string;
provider: string;
model_names: string[];
default_model_name: string;
fast_default_model_name: string | null;

View File

@ -727,8 +727,6 @@ export function ChatPage({
});
}}
noClick
onDragLeave={() => console.log("buh")}
onDragEnter={() => console.log("floppa")}
>
{({ getRootProps }) => (
<>

View File

@ -9,7 +9,7 @@ export function getFinalLLM(
(llmProvider) => llmProvider.is_default_provider
);
let provider = defaultProvider?.name || "";
let provider = defaultProvider?.provider || "";
let model = defaultProvider?.default_model_name || "";
if (persona) {
@ -21,6 +21,7 @@ export function getFinalLLM(
}
const MODELS_SUPPORTING_IMAGES = [
["openai", "gpt-4o"],
["openai", "gpt-4-vision-preview"],
["openai", "gpt-4-turbo"],
["openai", "gpt-4-1106-vision-preview"],