| 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														interface IProps extends Omit<IModalManagerChildrenProps, 'showModal'> { | 
														 | 
														 | 
														interface IProps extends Omit<IModalManagerChildrenProps, 'showModal'> { | 
													
													
												
													
														 | 
														 | 
														  loading: boolean; | 
														 | 
														 | 
														  loading: boolean; | 
													
													
												
													
														 | 
														 | 
														  initialValue: string; | 
														 | 
														 | 
														  initialValue: string; | 
													
													
												
													
														 | 
														 | 
														  onOk: (name: string) => void; | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  llmFactory: string; | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  onOk: (name: string, baseUrl: string) => void; | 
													
													
												
													
														 | 
														 | 
														  showModal?(): void; | 
														 | 
														 | 
														  showModal?(): void; | 
													
													
												
													
														 | 
														 | 
														} | 
														 | 
														 | 
														} | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														type FieldType = { | 
														 | 
														 | 
														type FieldType = { | 
													
													
												
													
														 | 
														 | 
														  api_key?: string; | 
														 | 
														 | 
														  api_key?: string; | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  base_url?: string; | 
													
													
												
													
														 | 
														 | 
														}; | 
														 | 
														 | 
														}; | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														const ApiKeyModal = ({ | 
														 | 
														 | 
														const ApiKeyModal = ({ | 
													
													
												
													
														 | 
														 | 
														  visible, | 
														 | 
														 | 
														  visible, | 
													
													
												
													
														 | 
														 | 
														  hideModal, | 
														 | 
														 | 
														  hideModal, | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  llmFactory, | 
													
													
												
													
														 | 
														 | 
														  loading, | 
														 | 
														 | 
														  loading, | 
													
													
												
													
														 | 
														 | 
														  initialValue, | 
														 | 
														 | 
														  initialValue, | 
													
													
												
													
														 | 
														 | 
														  onOk, | 
														 | 
														 | 
														  onOk, | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														  const handleOk = async () => { | 
														 | 
														 | 
														  const handleOk = async () => { | 
													
													
												
													
														 | 
														 | 
														    const ret = await form.validateFields(); | 
														 | 
														 | 
														    const ret = await form.validateFields(); | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														    return onOk(ret.api_key); | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														    return onOk(ret.api_key, ret.base_url); | 
													
													
												
													
														 | 
														 | 
														  }; | 
														 | 
														 | 
														  }; | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														  const handleCancel = () => { | 
														 | 
														 | 
														  const handleCancel = () => { | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														    > | 
														 | 
														 | 
														    > | 
													
													
												
													
														 | 
														 | 
														      <Form | 
														 | 
														 | 
														      <Form | 
													
													
												
													
														 | 
														 | 
														        name="basic" | 
														 | 
														 | 
														        name="basic" | 
													
													
												
													
														 | 
														 | 
														        labelCol={{ span: 4 }} | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        wrapperCol={{ span: 20 }} | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														        labelCol={{ span: 6 }} | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														        wrapperCol={{ span: 18 }} | 
													
													
												
													
														 | 
														 | 
														        style={{ maxWidth: 600 }} | 
														 | 
														 | 
														        style={{ maxWidth: 600 }} | 
													
													
												
													
														 | 
														 | 
														        onFinish={onFinish} | 
														 | 
														 | 
														        onFinish={onFinish} | 
													
													
												
													
														 | 
														 | 
														        onFinishFailed={onFinishFailed} | 
														 | 
														 | 
														        onFinishFailed={onFinishFailed} | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        > | 
														 | 
														 | 
														        > | 
													
													
												
													
														 | 
														 | 
														          <Input /> | 
														 | 
														 | 
														          <Input /> | 
													
													
												
													
														 | 
														 | 
														        </Form.Item> | 
														 | 
														 | 
														        </Form.Item> | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														        {llmFactory === 'OpenAI' && ( | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														          <Form.Item<FieldType> | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														            label="Base-Url" | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														            name="base_url" | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														            tooltip="The API key can be obtained by registering the corresponding LLM supplier." | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														            rules={[{ required: true, message: 'Please input base url!' }]} | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														          > | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														            <Input /> | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														          </Form.Item> | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														        )} | 
													
													
												
													
														 | 
														 | 
														      </Form> | 
														 | 
														 | 
														      </Form> | 
													
													
												
													
														 | 
														 | 
														    </Modal> | 
														 | 
														 | 
														    </Modal> | 
													
													
												
													
														 | 
														 | 
														  ); | 
														 | 
														 | 
														  ); |