mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-15 04:05:53 +08:00
### What problem does this PR solve? fix: Add Model Providers:Azure-OpenAI error #1402 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
c2693d2f46
commit
fdc21ec853
@ -16,6 +16,8 @@ type FieldType = {
|
||||
base_url?: string;
|
||||
};
|
||||
|
||||
const modelsWithBaseUrl = ['OpenAI', 'Azure-OpenAI'];
|
||||
|
||||
const ApiKeyModal = ({
|
||||
visible,
|
||||
hideModal,
|
||||
@ -33,18 +35,6 @@ const ApiKeyModal = ({
|
||||
return onOk(ret.api_key, ret.base_url);
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
hideModal();
|
||||
};
|
||||
|
||||
const onFinish = (values: any) => {
|
||||
console.log('Success:', values);
|
||||
};
|
||||
|
||||
const onFinishFailed = (errorInfo: any) => {
|
||||
console.log('Failed:', errorInfo);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
form.setFieldValue('api_key', initialValue);
|
||||
@ -56,7 +46,7 @@ const ApiKeyModal = ({
|
||||
title={t('modify')}
|
||||
open={visible}
|
||||
onOk={handleOk}
|
||||
onCancel={handleCancel}
|
||||
onCancel={hideModal}
|
||||
okButtonProps={{ loading }}
|
||||
confirmLoading={loading}
|
||||
>
|
||||
@ -65,8 +55,6 @@ const ApiKeyModal = ({
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
style={{ maxWidth: 600 }}
|
||||
onFinish={onFinish}
|
||||
onFinishFailed={onFinishFailed}
|
||||
autoComplete="off"
|
||||
form={form}
|
||||
>
|
||||
@ -78,7 +66,7 @@ const ApiKeyModal = ({
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
{llmFactory === 'OpenAI' && (
|
||||
{modelsWithBaseUrl.some((x) => x === llmFactory) && (
|
||||
<Form.Item<FieldType>
|
||||
label={t('baseUrl')}
|
||||
name="base_url"
|
||||
|
@ -4,7 +4,11 @@ import { IAddLlmRequestBody } from '@/interfaces/request/llm';
|
||||
import { Flex, Form, Input, Modal, Select, Space, Switch } from 'antd';
|
||||
import omit from 'lodash/omit';
|
||||
|
||||
type FieldType = IAddLlmRequestBody & { vision: boolean };
|
||||
type FieldType = IAddLlmRequestBody & {
|
||||
vision: boolean;
|
||||
volc_ak: string;
|
||||
volc_sk: string;
|
||||
};
|
||||
|
||||
const { Option } = Select;
|
||||
|
||||
@ -13,7 +17,7 @@ const VolcEngineModal = ({
|
||||
hideModal,
|
||||
onOk,
|
||||
loading,
|
||||
llmFactory
|
||||
llmFactory,
|
||||
}: IModalProps<IAddLlmRequestBody> & { llmFactory: string }) => {
|
||||
const [form] = Form.useForm<FieldType>();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user