Skip to content
Open
Show file tree
Hide file tree
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
19 changes: 5 additions & 14 deletions app/client/src/pages/Settings/AddModelProviderButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { PlusCircleOutlined } from '@ant-design/icons';
import { Alert, AutoComplete, Button, Form, Input, Modal, notification, Radio, Select } from 'antd';
import { Alert, AutoComplete, Button, Form, Input, Modal, notification, Radio, Select, Tooltip } from 'antd';
import type { CheckboxGroupProps } from 'antd/es/checkbox';
import get from 'lodash/get';
import isEqual from 'lodash/isEqual';
Expand All @@ -18,11 +18,11 @@ export enum ModelProviderType {


export const modelProviderTypeOptions: CheckboxGroupProps<string>['options'] = [
{ label: <Tooltip title="Cloudera AI Inferencing">{'Cloudera'}</Tooltip>, value: 'caii' },
{ label: 'OpenAI', value: 'openai' },
{ label: 'OpenAI Compatible', value: 'openai_compatible' },
{ label: 'Gemini', value: 'gemini' },
{ label: 'AWS Bedrock', value: 'aws_bedrock' },
{ label: 'CAII', value: 'caii' },
{ label: 'AWS Bedrock', value: 'aws_bedrock' }
];

const OPENAI_MODELS = [
Expand Down Expand Up @@ -153,6 +153,8 @@ const AddModelProviderButton: React.FC<Props> = ({ refetch }) => {
setModels(GEMINI_MODELS_OPTIONS);
} else if (value === 'aws_bedrock' && !isEqual(GEMINI_MODELS_OPTIONS, models)) {
setModels(AWS_BEDROCK_MODELS_OPTIONS);
} else if (value === 'caii' && !isEqual(GEMINI_MODELS_OPTIONS, models)) {
setModels([]);
}
}

Expand Down Expand Up @@ -193,17 +195,6 @@ const AddModelProviderButton: React.FC<Props> = ({ refetch }) => {
onChange={onChange}
/>
</Form.Item>
<Form.Item
name="display_name"
label="Display Name"
rules={[
{
required: true,
message: 'This field is required.'
}
]}>
<Input />
</Form.Item>
<Form.Item
name="model_id"
label="Model"
Expand Down
4 changes: 1 addition & 3 deletions app/client/src/pages/Settings/EditModelProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useEffect, useState } from 'react';
import { PlusCircleOutlined } from '@ant-design/icons';
import { Alert, Button, Form, Input, Modal, notification, Radio, Select } from 'antd';
import type { CheckboxGroupProps } from 'antd/es/checkbox';
import { Alert, Form, Input, Modal, notification, Radio, Select } from 'antd';
import get from 'lodash/get';
import isEqual from 'lodash/isEqual';
import { useMutation } from "@tanstack/react-query";
Expand Down