Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { PopupSpec } from "@/components/admin/connectors/Popup";
import * as Yup from "yup";
import isEqual from "lodash/isEqual";
import { IsPublicGroupSelector } from "@/components/IsPublicGroupSelector";
import { usePaidEnterpriseFeaturesEnabled } from "@/components/settings/usePaidEnterpriseFeaturesEnabled";

function customConfigProcessing(customConfigsList: [string, string][]) {
const customConfig: { [key: string]: string } = {};
Expand Down Expand Up @@ -91,6 +92,8 @@ export function CustomLLMProviderUpdateForm({
deployment_name: Yup.string().nullable(),
});

const arePaidEnterpriseFeaturesEnabled = usePaidEnterpriseFeaturesEnabled();

return (
<Formik
initialValues={initialValues}
Expand Down Expand Up @@ -305,13 +308,13 @@ export function CustomLLMProviderUpdateForm({
<Field
name={`custom_config_list[${index}][0]`}
className={`
border
border-border
bg-background
rounded
w-full
py-2
px-3
border
border-border
bg-background
rounded
w-full
py-2
px-3
mr-4
`}
autoComplete="off"
Expand All @@ -328,13 +331,13 @@ export function CustomLLMProviderUpdateForm({
<Field
name={`custom_config_list[${index}][1]`}
className={`
border
border-border
bg-background
rounded
w-full
py-2
px-3
border
border-border
bg-background
rounded
w-full
py-2
px-3
mr-4
`}
autoComplete="off"
Expand Down Expand Up @@ -404,8 +407,8 @@ export function CustomLLMProviderUpdateForm({
<TextFormField
name="default_model_name"
subtext={`
The model to use by default for this provider unless
otherwise specified. Must be one of the models listed
The model to use by default for this provider unless
otherwise specified. Must be one of the models listed
above.`}
label="Default Model"
placeholder="E.g. gpt-4"
Expand All @@ -414,28 +417,31 @@ export function CustomLLMProviderUpdateForm({
{!existingLlmProvider?.deployment_name && (
<TextFormField
name="fast_default_model_name"
subtext={`The model to use for lighter flows like \`LLM Chunk Filter\`
for this provider. If not set, will use
subtext={`The model to use for lighter flows like \`LLM Chunk Filter\`
for this provider. If not set, will use
the Default Model configured above.`}
label="[Optional] Fast Model"
placeholder="E.g. gpt-4"
/>
)}

<Separator />

<AdvancedOptionsToggle
showAdvancedOptions={showAdvancedOptions}
setShowAdvancedOptions={setShowAdvancedOptions}
/>

{showAdvancedOptions && (
<IsPublicGroupSelector
formikProps={formikProps}
objectName="LLM Provider"
publicToWhom="all users"
enforceGroupSelection={true}
/>
{arePaidEnterpriseFeaturesEnabled && (
<>
<Separator />
<AdvancedOptionsToggle
showAdvancedOptions={showAdvancedOptions}
setShowAdvancedOptions={setShowAdvancedOptions}
/>

{showAdvancedOptions && (
<IsPublicGroupSelector
formikProps={formikProps}
objectName="LLM Provider"
publicToWhom="all users"
enforceGroupSelection={true}
/>
)}
</>
)}

<div>
Expand Down
Loading