Merge pull request #951 from open-webui/dev

0.1.106
This commit is contained in:
Timothy Jaeryang Baek 2024-02-27 23:11:43 -05:00 committed by GitHub
commit a181b2b63b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 53 additions and 12 deletions

View file

@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.1.106] - 2024-02-27
### Added
- **🎯 Auto-focus Feature**: The input area now automatically focuses when initiating or opening a chat conversation.
### Fixed
- Corrected typo from "HuggingFace" to "Hugging Face" (Issue #924).
- Resolved bug causing errors in chat completion API calls to OpenAI due to missing "num_ctx" parameter (Issue #927).
- Fixed issues preventing text editing, selection, and cursor retention in the input field (Issue #940).
- Fixed a bug where defining an OpenAI-compatible API server using 'OPENAI_API_BASE_URL' containing 'openai' string resulted in hiding models not containing 'gpt' string from the model menu. (Issue #930)
## [0.1.105] - 2024-02-25 ## [0.1.105] - 2024-02-25
### Added ### Added

View file

@ -160,6 +160,16 @@ This project is licensed under the [MIT License](LICENSE) - see the [LICENSE](LI
If you have any questions, suggestions, or need assistance, please open an issue or join our If you have any questions, suggestions, or need assistance, please open an issue or join our
[Open WebUI Discord community](https://discord.gg/5rJgQTnV4s) to connect with us! 🤝 [Open WebUI Discord community](https://discord.gg/5rJgQTnV4s) to connect with us! 🤝
## Star History
<a href="https://star-history.com/#open-webui/open-webui&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=open-webui/open-webui&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=open-webui/open-webui&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=open-webui/open-webui&type=Date" />
</picture>
</a>
--- ---
Created by [Timothy J. Baek](https://github.com/tjbck) - Let's make Open Web UI even more amazing together! 💪 Created by [Timothy J. Baek](https://github.com/tjbck) - Let's make Open Web UI even more amazing together! 💪

View file

@ -146,6 +146,13 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
body["max_tokens"] = 4000 body["max_tokens"] = 4000
print("Modified body_dict:", body) print("Modified body_dict:", body)
# Fix for ChatGPT calls failing because the num_ctx key is in body
if "num_ctx" in body:
# If 'num_ctx' is in the dictionary, delete it
# Leaving it there generates an error with the
# OpenAI API (Feb 2024)
del body["num_ctx"]
# Convert the modified body back to JSON # Convert the modified body back to JSON
body = json.dumps(body) body = json.dumps(body)
except json.JSONDecodeError as e: except json.JSONDecodeError as e:
@ -184,7 +191,7 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
response_data = r.json() response_data = r.json()
if "openai" in app.state.OPENAI_API_BASE_URL and path == "models": if "api.openai.com" in app.state.OPENAI_API_BASE_URL and path == "models":
response_data["data"] = list( response_data["data"] = list(
filter(lambda model: "gpt" in model["id"], response_data["data"]) filter(lambda model: "gpt" in model["id"], response_data["data"])
) )

View file

@ -1,6 +1,6 @@
{ {
"name": "open-webui", "name": "open-webui",
"version": "0.1.105", "version": "0.1.106",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev --host", "dev": "vite dev --host",

View file

@ -293,6 +293,9 @@
}; };
onMount(() => { onMount(() => {
const chatInput = document.getElementById('chat-textarea');
window.setTimeout(() => chatInput?.focus(), 0);
const dropZone = document.querySelector('body'); const dropZone = document.querySelector('body');
const onDragOver = (e) => { const onDragOver = (e) => {

View file

@ -31,6 +31,7 @@
let chatTitle = ''; let chatTitle = '';
let showDropdown = false; let showDropdown = false;
let isEditing = false;
onMount(async () => { onMount(async () => {
if (window.innerWidth > 1280) { if (window.innerWidth > 1280) {
@ -101,17 +102,16 @@
: 'invisible'}" : 'invisible'}"
> >
<div class="px-2 flex justify-center space-x-2"> <div class="px-2 flex justify-center space-x-2">
<button <a
id="sidebar-new-chat-button" id="sidebar-new-chat-button"
class="flex-grow flex justify-between rounded-xl px-3.5 py-2 hover:bg-gray-900 transition" class="flex-grow flex justify-between rounded-xl px-3.5 py-2 hover:bg-gray-900 transition"
href="/"
on:click={async () => { on:click={async () => {
goto('/'); await goto('/');
const newChatButton = document.getElementById('new-chat-button'); const newChatButton = document.getElementById('new-chat-button');
setTimeout(() => {
if (newChatButton) { newChatButton?.click();
newChatButton.click(); }, 0);
}
}} }}
> >
<div class="flex self-center"> <div class="flex self-center">
@ -141,7 +141,7 @@
/> />
</svg> </svg>
</div> </div>
</button> </a>
</div> </div>
{#if $user?.role === 'admin'} {#if $user?.role === 'admin'}
@ -372,6 +372,7 @@
? 'bg-gray-900' ? 'bg-gray-900'
: ''} transition whitespace-nowrap text-ellipsis" : ''} transition whitespace-nowrap text-ellipsis"
href="/c/{chat.id}" href="/c/{chat.id}"
draggable={isEditing ? 'false' : 'true'}
> >
<div class=" flex self-center flex-1 w-full"> <div class=" flex self-center flex-1 w-full">
<div <div
@ -398,6 +399,7 @@
editChatTitle(chat.id, chatTitle); editChatTitle(chat.id, chatTitle);
chatTitleEditId = null; chatTitleEditId = null;
chatTitle = ''; chatTitle = '';
isEditing = false;
}} }}
> >
<svg <svg
@ -485,7 +487,7 @@
on:click={() => { on:click={() => {
chatTitle = chat.title; chatTitle = chat.title;
chatTitleEditId = chat.id; chatTitleEditId = chat.id;
// editChatTitle(chat.id, 'a'); isEditing = true;
}} }}
> >
<svg <svg

View file

@ -134,6 +134,9 @@
settings.set({ settings.set({
..._settings ..._settings
}); });
const chatInput = document.getElementById('chat-textarea');
setTimeout(() => chatInput?.focus(), 0);
}; };
const scrollToBottom = () => { const scrollToBottom = () => {

View file

@ -99,6 +99,9 @@
if (await loadChat()) { if (await loadChat()) {
await tick(); await tick();
loaded = true; loaded = true;
const chatInput = document.getElementById('chat-textarea');
chatInput?.focus();
} else { } else {
await goto('/'); await goto('/');
} }