Procházet zdrojové kódy

Merge pull request #17328 from open-webui/main

dev
Tim Jaeryang Baek před 3 týdny
rodič
revize
2dd0eaad73

+ 1 - 1
.github/pull_request_template.md

@@ -73,4 +73,4 @@
 
 ### 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.

+ 3 - 8
backend/open_webui/routers/audio.py

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

+ 1 - 1
src/lib/components/admin/Settings/Connections.svelte

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

+ 3 - 0
src/lib/components/chat/MessageInput.svelte

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

+ 17 - 2
src/lib/components/layout/Sidebar/Folders/FolderModal.svelte

@@ -1,5 +1,5 @@
 <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 Modal from '$lib/components/common/Modal.svelte';
@@ -8,9 +8,10 @@
 	import { toast } from 'svelte-sonner';
 	import { page } from '$app/stores';
 	import { goto } from '$app/navigation';
+	import { user } from '$lib/stores';
+
 	import Textarea from '$lib/components/common/Textarea.svelte';
 	import Knowledge from '$lib/components/workspace/Models/Knowledge.svelte';
-	import { user } from '$lib/stores';
 	const i18n = getContext('i18n');
 
 	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) {
 		init();
 	}
@@ -99,6 +113,7 @@
 
 						<div class="flex-1">
 							<input
+								id="folder-name"
 								class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
 								type="text"
 								bind:value={name}