Compare commits

...

2 Commits

Author SHA1 Message Date
pablonyx
bbf5fa13dc update 2025-04-11 15:13:02 -07:00
pablonyx
a4a399bc31 update 2025-04-11 15:11:35 -07:00
8 changed files with 65 additions and 64 deletions

View File

@@ -29,12 +29,11 @@ function LLMProviderUpdateModal({
llmProviderDescriptor?.name ||
"Custom LLM Provider";
const hasAdvancedOptions = llmProviderDescriptor?.name != "azure";
return (
<Modal
title={`${llmProviderDescriptor ? "Configure" : "Setup"} ${providerName}`}
onOutsideClick={() => onClose()}
hideOverflow={true}
>
<div className="max-h-[70vh] overflow-y-auto px-4">
{llmProviderDescriptor ? (
@@ -44,7 +43,6 @@ function LLMProviderUpdateModal({
existingLlmProvider={existingLlmProvider}
shouldMarkAsDefault={shouldMarkAsDefault}
setPopup={setPopup}
hasAdvancedOptions={hasAdvancedOptions}
/>
) : (
<CustomLLMProviderUpdateForm

View File

@@ -35,10 +35,12 @@ function LLMProviderUpdateModal({
existingLlmProvider?.name ||
"Custom LLM Provider";
const hasAdvancedOptions = llmProviderDescriptor?.name != "azure";
return (
<Modal title={`Setup ${providerName}`} onOutsideClick={() => onClose()}>
<Modal
title={`Setup ${providerName}`}
onOutsideClick={() => onClose()}
hideOverflow={true}
>
<div className="max-h-[70vh] overflow-y-auto px-4">
{llmProviderDescriptor ? (
<LLMProviderUpdateForm
@@ -47,7 +49,6 @@ function LLMProviderUpdateModal({
existingLlmProvider={existingLlmProvider}
shouldMarkAsDefault={shouldMarkAsDefault}
setPopup={setPopup}
hasAdvancedOptions={hasAdvancedOptions}
/>
) : (
<CustomLLMProviderUpdateForm

View File

@@ -29,7 +29,6 @@ export function LLMProviderUpdateForm({
setPopup,
hideSuccess,
firstTimeConfiguration = false,
hasAdvancedOptions = false,
}: {
llmProviderDescriptor: WellKnownLLMProviderDescriptor;
onClose: () => void;
@@ -40,7 +39,6 @@ export function LLMProviderUpdateForm({
// Set this when this is the first time the user is setting Onyx up.
firstTimeConfiguration?: boolean;
hasAdvancedOptions?: boolean;
}) {
const { mutate } = useSWRConfig();
@@ -302,7 +300,7 @@ export function LLMProviderUpdateForm({
}
})}
{hasAdvancedOptions && !firstTimeConfiguration && (
{!firstTimeConfiguration && (
<>
<Separator />
@@ -364,52 +362,49 @@ export function LLMProviderUpdateForm({
/>
))}
{hasAdvancedOptions && (
<>
<Separator />
<AdvancedOptionsToggle
showAdvancedOptions={showAdvancedOptions}
setShowAdvancedOptions={setShowAdvancedOptions}
/>
{showAdvancedOptions && (
<>
{llmProviderDescriptor.llm_names.length > 0 && (
<div className="w-full">
<MultiSelectField
selectedInitially={
formikProps.values.display_model_names
}
name="display_model_names"
label="Display Models"
subtext="Select the models to make available to users. Unselected models will not be available."
options={llmProviderDescriptor.llm_names.map(
(name) => ({
value: name,
// don't clean up names here to give admins descriptive names / handle duplicates
// like us.anthropic.claude-3-7-sonnet-20250219-v1:0 and anthropic.claude-3-7-sonnet-20250219-v1:0
label: name,
})
)}
onChange={(selected) =>
formikProps.setFieldValue(
"display_model_names",
selected
)
}
/>
</div>
)}
<IsPublicGroupSelector
formikProps={formikProps}
objectName="LLM Provider"
publicToWhom="all users"
enforceGroupSelection={true}
/>
</>
)}
</>
)}
<>
<Separator />
<AdvancedOptionsToggle
showAdvancedOptions={showAdvancedOptions}
setShowAdvancedOptions={setShowAdvancedOptions}
/>
{showAdvancedOptions && (
<>
{llmProviderDescriptor.llm_names.length > 0 && (
<div className="w-full">
<MultiSelectField
selectedInitially={
formikProps.values.display_model_names
}
name="display_model_names"
label="Display Models"
subtext="Select the models to make available to users. Unselected models will not be available."
options={llmProviderDescriptor.llm_names.map(
(name) => ({
value: name,
// don't clean up names here to give admins descriptive names / handle duplicates
// like us.anthropic.claude-3-7-sonnet-20250219-v1:0 and anthropic.claude-3-7-sonnet-20250219-v1:0
label: name,
})
)}
onChange={(selected) =>
formikProps.setFieldValue(
"display_model_names",
selected
)
}
/>
</div>
)}
<IsPublicGroupSelector
formikProps={formikProps}
objectName="LLM Provider"
publicToWhom="Users"
enforceGroupSelection={true}
/>
</>
)}
</>
</>
)}

View File

@@ -146,7 +146,10 @@ export function ShareChatSessionModal({
setShareLink("");
onShare && onShare(false);
} else {
alert("Failed to delete share link");
setPopup({
message: "Failed to delete share link",
type: "error",
});
}
}}
size="sm"
@@ -171,7 +174,10 @@ export function ShareChatSessionModal({
const shareLink =
await generateShareLink(chatSessionId);
if (!shareLink) {
alert("Failed to generate share link");
setPopup({
message: "Failed to generate share link",
type: "error",
});
} else {
setShareLink(shareLink);
onShare && onShare(true);
@@ -231,7 +237,10 @@ export function ShareChatSessionModal({
}
} catch (e) {
console.error(e);
alert("Failed to generate or copy link.");
setPopup({
message: "Failed to generate or copy link.",
type: "error",
});
}
}}
size="sm"

View File

@@ -346,8 +346,6 @@ export const DocumentList: React.FC<DocumentListProps> = ({
// Get the hostname (domain) from the URL
const url = new URL(uploadingFile.name);
const hostname = url.hostname;
alert("checking for " + hostname);
alert(JSON.stringify(files));
// Look for recently added files that might match this URL
const isUploaded = files.some(

View File

@@ -74,7 +74,6 @@ export const IsPublicGroupSelector = <T extends IsPublicGroupSelectorFormType>({
return (
<div>
<Separator />
{isAdmin && (
<>
<BooleanFormField

View File

@@ -24,6 +24,7 @@ interface ModalProps {
removeBottomPadding?: boolean;
removePadding?: boolean;
increasedPadding?: boolean;
hideOverflow?: boolean;
}
export function Modal({
@@ -43,6 +44,7 @@ export function Modal({
removeBottomPadding,
removePadding,
increasedPadding,
hideOverflow,
}: ModalProps) {
const modalRef = useRef<HTMLDivElement>(null);
const [isMounted, setIsMounted] = useState(false);
@@ -92,7 +94,7 @@ export function Modal({
flex
flex-col
${heightOverride ? `h-${heightOverride}` : "max-h-[90vh]"}
overflow-auto
${hideOverflow ? "overflow-hidden" : "overflow-auto"}
`}
>
{onOutsideClick && !hideCloseButton && (

View File

@@ -174,7 +174,6 @@ export const CustomTooltip = ({
: {}
}
>
lll
{content}
</div>
</div>,