Merge pull request #17328 from open-webui/main

dev
This commit is contained in:
Tim Jaeryang Baek 2025-09-10 14:04:03 +04:00 committed by GitHub
commit 2dd0eaad73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 25 additions and 12 deletions

View file

@ -73,4 +73,4 @@
### Contributor License Agreement ### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.

View file

@ -337,10 +337,7 @@ async def speech(request: Request, user=Depends(get_verified_user)):
timeout=timeout, trust_env=True timeout=timeout, trust_env=True
) as session: ) as session:
r = await session.post( r = await session.post(
url=urljoin( url=f"{request.app.state.config.TTS_OPENAI_API_BASE_URL}/audio/speech",
request.app.state.config.TTS_OPENAI_API_BASE_URL,
"/audio/speech",
),
json=payload, json=payload,
headers={ headers={
"Content-Type": "application/json", "Content-Type": "application/json",
@ -468,10 +465,8 @@ async def speech(request: Request, user=Depends(get_verified_user)):
timeout=timeout, trust_env=True timeout=timeout, trust_env=True
) as session: ) as session:
async with session.post( async with session.post(
urljoin( (base_url or f"https://{region}.tts.speech.microsoft.com")
base_url or f"https://{region}.tts.speech.microsoft.com", + "/cognitiveservices/v1",
"/cognitiveservices/v1",
),
headers={ headers={
"Ocp-Apim-Subscription-Key": request.app.state.config.TTS_API_KEY, "Ocp-Apim-Subscription-Key": request.app.state.config.TTS_API_KEY,
"Content-Type": "application/ssml+xml", "Content-Type": "application/ssml+xml",

View file

@ -262,7 +262,7 @@
{#each OPENAI_API_BASE_URLS as url, idx} {#each OPENAI_API_BASE_URLS as url, idx}
<OpenAIConnection <OpenAIConnection
{url} {url}
key={OPENAI_API_KEYS[idx]} bind:key={OPENAI_API_KEYS[idx]}
bind:config={OPENAI_API_CONFIGS[idx]} bind:config={OPENAI_API_CONFIGS[idx]}
pipeline={pipelineUrls[url] ? true : false} pipeline={pipelineUrls[url] ? true : false}
onSubmit={() => { onSubmit={() => {

View file

@ -385,6 +385,9 @@
} }
await tick(); await tick();
text = await inputVariableHandler(text);
await tick();
const chatInputContainer = document.getElementById('chat-input-container'); const chatInputContainer = document.getElementById('chat-input-container');
if (chatInputContainer) { if (chatInputContainer) {
chatInputContainer.scrollTop = chatInputContainer.scrollHeight; chatInputContainer.scrollTop = chatInputContainer.scrollHeight;

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { getContext, createEventDispatcher, onMount } from 'svelte'; import { getContext, createEventDispatcher, onMount, tick } from 'svelte';
import Spinner from '$lib/components/common/Spinner.svelte'; import Spinner from '$lib/components/common/Spinner.svelte';
import Modal from '$lib/components/common/Modal.svelte'; import Modal from '$lib/components/common/Modal.svelte';
@ -8,9 +8,10 @@
import { toast } from 'svelte-sonner'; import { toast } from 'svelte-sonner';
import { page } from '$app/stores'; import { page } from '$app/stores';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { user } from '$lib/stores';
import Textarea from '$lib/components/common/Textarea.svelte'; import Textarea from '$lib/components/common/Textarea.svelte';
import Knowledge from '$lib/components/workspace/Models/Knowledge.svelte'; import Knowledge from '$lib/components/workspace/Models/Knowledge.svelte';
import { user } from '$lib/stores';
const i18n = getContext('i18n'); const i18n = getContext('i18n');
export let show = false; export let show = false;
@ -53,6 +54,19 @@
}; };
}; };
const focusInput = async () => {
await tick();
const input = document.getElementById('folder-name') as HTMLInputElement;
if (input) {
input.focus();
input.select();
}
};
$: if (show) {
focusInput();
}
$: if (folder) { $: if (folder) {
init(); init();
} }
@ -99,6 +113,7 @@
<div class="flex-1"> <div class="flex-1">
<input <input
id="folder-name"
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden" class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
type="text" type="text"
bind:value={name} bind:value={name}