may config tts baseURL
This commit is contained in:
@@ -53,6 +53,7 @@ const conversationFormSchema = z.object({
|
||||
engine: z.enum(["openai"]).default("openai"),
|
||||
model: z.string().default("tts-1"),
|
||||
voice: z.string().optional(),
|
||||
baseUrl: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
@@ -102,6 +103,9 @@ export const ConversationForm = (props: {
|
||||
engine: conversation.engine,
|
||||
configuration: {
|
||||
...conversation.configuration,
|
||||
tts: {
|
||||
...conversation.configuration?.tts,
|
||||
},
|
||||
},
|
||||
}
|
||||
: {
|
||||
@@ -128,6 +132,10 @@ export const ConversationForm = (props: {
|
||||
configuration.baseUrl = LLM_PROVIDERS[engine]?.baseUrl;
|
||||
}
|
||||
|
||||
if (!configuration.tts.baseUrl) {
|
||||
configuration.tts.baseUrl = LLM_PROVIDERS[engine]?.baseUrl;
|
||||
}
|
||||
|
||||
if (conversation?.id) {
|
||||
EnjoyApp.conversations
|
||||
.update(conversation.id, {
|
||||
@@ -547,6 +555,21 @@ export const ConversationForm = (props: {
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="configuration.tts.baseUrl"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("models.conversation.ttsBaseUrl")}</FormLabel>
|
||||
<Input {...field} />
|
||||
<FormDescription>
|
||||
{t("models.conversation.baseUrl")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
@@ -584,7 +607,9 @@ export const ConversationForm = (props: {
|
||||
)}
|
||||
|
||||
<Button
|
||||
disabled={submitting || (conversation.id && !form.formState.isDirty)}
|
||||
disabled={
|
||||
submitting || (conversation.id && !form.formState.isDirty)
|
||||
}
|
||||
className="w-full h-12"
|
||||
size="lg"
|
||||
type="submit"
|
||||
@@ -688,6 +713,7 @@ const conversationDefaultConfiguration = {
|
||||
frequencyPenalty: 0,
|
||||
historyBufferSize: 0,
|
||||
tts: {
|
||||
baseUrl: "",
|
||||
engine: "openai",
|
||||
model: "tts-1",
|
||||
voice: "alloy",
|
||||
|
||||
@@ -54,6 +54,7 @@ export const AssistantMessageComponent = (props: {
|
||||
engine: configuration?.tts?.engine,
|
||||
model: configuration?.tts?.model,
|
||||
voice: configuration?.tts?.voice,
|
||||
baseUrl: configuration?.tts?.baseUrl,
|
||||
})
|
||||
.then((speech) => {
|
||||
setSpeech(speech);
|
||||
|
||||
Reference in New Issue
Block a user