add default api endpoint

This commit is contained in:
2023-11-11 13:22:07 +08:00
parent f3953693fd
commit 8c877cb6a8
2 changed files with 17 additions and 15 deletions

View File

@@ -66,14 +66,14 @@ export const newChatStore = (
model = "gpt-3.5-turbo-1106",
temperature = 0.7,
dev = false,
whisper_api = "",
whisper_api = "https://api.openai.com/v1/audio/transcriptions",
whisper_key = "",
tts_api = "",
tts_api = "https://api.openai.com/v1/audio/speech",
tts_key = "",
tts_speed = 1.0,
tts_speed_enabled = false,
toolsString = "",
image_gen_api = "",
image_gen_api = "https://api.openai.com/v1/images/generations",
image_gen_key = ""
): ChatStore => {
return {

View File

@@ -502,13 +502,13 @@ export default (props: {
{...props}
/>
<Input
field="image_gen_api"
help="DALL image gen key, eg. https://api.openai.com/v1/images/generations"
field="image_gen_key"
help="image generation service api key"
{...props}
/>
<Input
field="image_gen_key"
help="image generation service api key"
field="image_gen_api"
help="DALL image gen key, eg. https://api.openai.com/v1/images/generations"
{...props}
/>
@@ -526,15 +526,17 @@ export default (props: {
{Tr("Reset")}
</button>
</div>
<div className="flex justify-evenly flex-wrap">
<SetAPIsTemplate
label="Chat API"
endpoint={props.chatStore.apiEndpoint}
APIkey={props.chatStore.apiKey}
tmps={props.templateAPIs}
setTmps={props.setTemplateAPIs}
/>
{props.chatStore.apiEndpoint && props.chatStore.apiKey && (
<SetAPIsTemplate
label="Chat API"
endpoint={props.chatStore.apiEndpoint}
APIkey={props.chatStore.apiKey}
tmps={props.templateAPIs}
setTmps={props.setTemplateAPIs}
/>
)}
{props.chatStore.whisper_api && props.chatStore.whisper_key && (
<SetAPIsTemplate
label="Whisper API"