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", model = "gpt-3.5-turbo-1106",
temperature = 0.7, temperature = 0.7,
dev = false, dev = false,
whisper_api = "", whisper_api = "https://api.openai.com/v1/audio/transcriptions",
whisper_key = "", whisper_key = "",
tts_api = "", tts_api = "https://api.openai.com/v1/audio/speech",
tts_key = "", tts_key = "",
tts_speed = 1.0, tts_speed = 1.0,
tts_speed_enabled = false, tts_speed_enabled = false,
toolsString = "", toolsString = "",
image_gen_api = "", image_gen_api = "https://api.openai.com/v1/images/generations",
image_gen_key = "" image_gen_key = ""
): ChatStore => { ): ChatStore => {
return { return {

View File

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