File tree Expand file tree Collapse file tree
chat2db-client/src/blocks/Setting/AiSetting Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,14 +23,14 @@ const AIFormConfig: Record<AIType, IAiConfigBooleans> = {
2323 } ,
2424 [ AIType . ZHIPUAI ] : {
2525 apiKey : true ,
26- apiHost : true ,
27- model : true ,
26+ apiHost : 'https://open.bigmodel.cn/api/paas/v3/model-api/' ,
27+ model : 'chatglm_turbo' ,
2828 } ,
2929 [ AIType . BAICHUANAI ] : {
3030 apiKey : true ,
3131 secretKey : true ,
32- apiHost : true ,
33- model : true ,
32+ apiHost : 'https://api.baichuan-ai.com/v1/stream/chat/' ,
33+ model : 'Baichuan2-53B' ,
3434 } ,
3535 [ AIType . WENXINAI ] : {
3636 apiKey : true ,
@@ -43,7 +43,7 @@ const AIFormConfig: Record<AIType, IAiConfigBooleans> = {
4343 } ,
4444 [ AIType . OPENAI ] : {
4545 apiKey : true ,
46- apiHost : true ,
46+ apiHost : 'https://api.openai.com/' ,
4747 httpProxyHost : true ,
4848 httpProxyPort : true ,
4949 // model: 'gpt-3.5-turbo',
Original file line number Diff line number Diff line change @@ -98,11 +98,16 @@ export default function SettingAI(props: IProps) {
9898
9999 < Form layout = "vertical" >
100100 { Object . keys ( AIFormConfig [ aiConfig ?. aiSqlSource ] ) . map ( ( key : string ) => (
101- < Form . Item key = { key } label = { capitalizeFirstLetter ( key ) } className = { styles . title } >
101+ < Form . Item
102+ key = { key }
103+ required = { key === 'apiKey' || key === 'secretKey' }
104+ label = { capitalizeFirstLetter ( key ) }
105+ className = { styles . title }
106+ >
102107 < Input
103108 autoComplete = "off"
104109 value = { aiConfig [ key ] }
105- defaultValue = { AIFormConfig [ aiConfig ?. aiSqlSource ] ?. [ key ] }
110+ placeholder = { AIFormConfig [ aiConfig ?. aiSqlSource ] ?. [ key ] }
106111 onChange = { ( e ) => {
107112 setAiConfig ( { ...aiConfig , [ key ] : e . target . value } ) ;
108113 } }
You can’t perform that action at this time.
0 commit comments