Unverified Commit c41b33c9 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #3013 from open-webui/dev

0.3.3
parents 06976c45 7131ac24
......@@ -12,9 +12,9 @@
"a user": "người sử dụng",
"About": "Giới thiệu",
"Account": "Tài khoản",
"Account Activation Pending": "",
"Account Activation Pending": "Tài khoản đang chờ kích hoạt",
"Accurate information": "Thông tin chính xác",
"Active Users": "",
"Active Users": "Người dùng đang hoạt động",
"Add": "Thêm",
"Add a model id": "Thêm model id",
"Add a short description about what this model does": "Thêm mô tả ngắn về những khả năng của model",
......@@ -30,9 +30,10 @@
"Add User": "Thêm người dùng",
"Adjusting these settings will apply changes universally to all users.": "Các thay đổi cài đặt này sẽ áp dụng cho tất cả người sử dụng.",
"admin": "quản trị viên",
"Admin": "",
"Admin": "Quản trị",
"Admin Panel": "Trang Quản trị",
"Admin Settings": "Cài đặt hệ thống",
"Admins have access to all tools at all times; users need tools assigned per model in the workspace.": "",
"Advanced Parameters": "Các tham số Nâng cao",
"Advanced Params": "Các tham số Nâng cao",
"all": "tất cả",
......@@ -72,8 +73,8 @@
"Being lazy": "Lười biếng",
"Brave Search API Key": "Khóa API tìm kiếm dũng cảm",
"Bypass SSL verification for Websites": "Bỏ qua xác thực SSL cho các trang web",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Call": "Gọi",
"Call feature is not supported when using Web STT engine": "Tính năng gọi điện không được hỗ trợ khi sử dụng công cụ Web STT",
"Camera": "",
"Cancel": "Hủy bỏ",
"Capabilities": "Năng lực",
......@@ -92,12 +93,12 @@
"Chunk Params": "Tham số khối (chunk)",
"Chunk Size": "Kích thước khối (size)",
"Citation": "Trích dẫn",
"Clear memory": "",
"Clear memory": "Xóa bộ nhớ",
"Click here for help.": "Bấm vào đây để được trợ giúp.",
"Click here to": "Nhấn vào đây để",
"Click here to select": "Bấm vào đây để chọn",
"Click here to select a csv file.": "Nhấn vào đây để chọn tệp csv",
"Click here to select a py file.": "",
"Click here to select a py file.": "Nhấn vào đây để chọn tệp py",
"Click here to select documents.": "Bấm vào đây để chọn tài liệu.",
"click here.": "bấm vào đây.",
"Click on the user role button to change a user's role.": "Bấm vào nút trong cột VAI TRÒ để thay đổi quyền của người sử dụng.",
......@@ -111,7 +112,7 @@
"Concurrent Requests": "Các truy vấn đồng thời",
"Confirm Password": "Xác nhận Mật khẩu",
"Connections": "Kết nối",
"Contact Admin for WebUI Access": "",
"Contact Admin for WebUI Access": "Liên hệ với Quản trị viên để được cấp quyền truy cập",
"Content": "Nội dung",
"Context Length": "Độ dài ngữ cảnh (Context Length)",
"Continue Response": "Tiếp tục trả lời",
......@@ -158,11 +159,11 @@
"Discover a prompt": "Khám phá thêm prompt mới",
"Discover, download, and explore custom prompts": "Tìm kiếm, tải về và khám phá thêm các prompt tùy chỉnh",
"Discover, download, and explore model presets": "Tìm kiếm, tải về và khám phá thêm các thiết lập mô hình sẵn",
"Dismissible": "",
"Dismissible": "Có thể loại bỏ",
"Display the username instead of You in the Chat": "Hiển thị tên người sử dụng thay vì 'Bạn' trong nội dung chat",
"Document": "Tài liệu",
"Document Settings": "Cấu hình kho tài liệu",
"Documentation": "",
"Documentation": "Tài liệu",
"Documents": "Tài liệu",
"does not make any external connections, and your data stays securely on your locally hosted server.": "không thực hiện bất kỳ kết nối ngoài nào, và dữ liệu của bạn vẫn được lưu trữ an toàn trên máy chủ lưu trữ cục bộ của bạn.",
"Don't Allow": "Không Cho phép",
......@@ -201,7 +202,7 @@
"Enter Score": "Nhập Score",
"Enter Searxng Query URL": "Nhập Query URL cho Searxng",
"Enter Serper API Key": "Nhập Serper API Key",
"Enter Serply API Key": "",
"Enter Serply API Key": "Nhập Serply API Key",
"Enter Serpstack API Key": "Nhập Serpstack API Key",
"Enter stop sequence": "Nhập stop sequence",
"Enter Top K": "Nhập Top K",
......@@ -215,15 +216,16 @@
"Experimental": "Thử nghiệm",
"Export": "Xuất khẩu",
"Export All Chats (All Users)": "Tải về tất cả nội dung chat (tất cả mọi người)",
"Export chat (.json)": "",
"Export chat (.json)": "Tải chat (.json)",
"Export Chats": "Tải nội dung chat về máy",
"Export Documents Mapping": "Tải cấu trúc tài liệu về máy",
"Export Models": "Tải Models về máy",
"Export Prompts": "Tải các prompt về máy",
"External Models": "",
"Export Tools": "",
"External Models": "Các model ngoài",
"Failed to create API Key.": "Lỗi khởi tạo API Key",
"Failed to read clipboard contents": "Không thể đọc nội dung clipboard",
"Failed to update settings": "",
"Failed to update settings": "Lỗi khi cập nhật các cài đặt",
"February": "Tháng 2",
"Feel free to add specific details": "Mô tả chi tiết về chất lượng của câu hỏi và phương án trả lời",
"File Mode": "Chế độ Tệp văn bản",
......@@ -236,7 +238,7 @@
"Frequency Penalty": "Hình phạt tần số",
"General": "Cài đặt chung",
"General Settings": "Cấu hình chung",
"Generate Image": "",
"Generate Image": "Sinh ảnh",
"Generating search query": "Tạo truy vấn tìm kiếm",
"Generation Info": "Thông tin chung",
"Good Response": "Trả lời tốt",
......@@ -257,11 +259,12 @@
"Import Documents Mapping": "Nạp cấu trúc tài liệu",
"Import Models": "Nạp model",
"Import Prompts": "Nạp các prompt lên hệ thống",
"Import Tools": "",
"Include `--api` flag when running stable-diffusion-webui": "Bao gồm flag `--api` khi chạy stable-diffusion-webui",
"Info": "Thông tin",
"Input commands": "Nhập các câu lệnh",
"Install from Github URL": "Cài đặt từ Github URL",
"Instant Auto-Send After Voice Transcription": "",
"Instant Auto-Send After Voice Transcription": "Tự động gửi ngay lập tức sau khi phiên dịch giọng nói",
"Interface": "Giao diện",
"Invalid Tag": "Tag không hợp lệ",
"January": "Tháng 1",
......@@ -274,17 +277,17 @@
"JWT Token": "Token JWT",
"Keep Alive": "Giữ kết nối",
"Keyboard shortcuts": "Phím tắt",
"Knowledge": "",
"Knowledge": "Kiến thức",
"Language": "Ngôn ngữ",
"Last Active": "Truy cập gần nhất",
"Light": "Sáng",
"Listening...": "",
"Listening...": "Đang nghe...",
"LLMs can make mistakes. Verify important information.": "Hệ thống có thể tạo ra nội dung không chính xác hoặc sai. Hãy kiểm chứng kỹ lưỡng thông tin trước khi tiếp nhận và sử dụng.",
"Local Models": "",
"LTR": "LTR",
"Made by OpenWebUI Community": "Được tạo bởi Cộng đồng OpenWebUI",
"Make sure to enclose them with": "Hãy chắc chắn bao quanh chúng bằng",
"Manage": "",
"Manage": "Quản lý",
"Manage Models": "Quản lý mô hình",
"Manage Ollama Models": "Quản lý mô hình với Ollama",
"Manage Pipelines": "Quản lý Pipelines",
......@@ -320,7 +323,7 @@
"Name your model": "Tên model",
"New Chat": "Tạo chat mới",
"New Password": "Mật khẩu mới",
"No documents found": "",
"No documents found": "Không tìm thấy tài liệu nào",
"No results found": "Không tìm thấy kết quả",
"No search query generated": "Không có truy vấn tìm kiếm nào được tạo ra",
"No source available": "Không có nguồn",
......@@ -337,7 +340,7 @@
"Ollama": "Ollama",
"Ollama API": "Ollama API",
"Ollama API disabled": "API Ollama bị vô hiệu hóa",
"Ollama API is disabled": "",
"Ollama API is disabled": "Ollama API đang bị vô hiệu hóa",
"Ollama Version": "Phiên bản Ollama",
"On": "Bật",
"Only": "Only",
......@@ -360,12 +363,12 @@
"PDF document (.pdf)": "Tập tin PDF (.pdf)",
"PDF Extract Images (OCR)": "Trích xuất ảnh từ PDF (OCR)",
"pending": "đang chờ phê duyệt",
"Permission denied when accessing media devices": "",
"Permission denied when accessing microphone": "",
"Permission denied when accessing media devices": "Quyền truy cập các thiết bị đa phương tiện bị từ chối",
"Permission denied when accessing microphone": "Quyền truy cập micrô bị từ chối",
"Permission denied when accessing microphone: {{error}}": "Quyền truy cập micrô bị từ chối: {{error}}",
"Personalization": "Cá nhân hóa",
"Pipelines": "Đường ống",
"Pipelines Valves": "Van đường ống",
"Pipelines": "",
"Pipelines Valves": "",
"Plain text (.txt)": "Văn bản thô (.txt)",
"Playground": "Thử nghiệm (Playground)",
"Positive attitude": "Thái độ tích cực",
......@@ -384,7 +387,7 @@
"Read Aloud": "Đọc ra loa",
"Record voice": "Ghi âm",
"Redirecting you to OpenWebUI Community": "Đang chuyển hướng bạn đến Cộng đồng OpenWebUI",
"Refer to yourself as \"User\" (e.g., \"User is learning Spanish\")": "",
"Refer to yourself as \"User\" (e.g., \"User is learning Spanish\")": "Hãy coi bản thân mình như \"Người dùng\" (ví dụ: \"Người dùng đang học Tiếng Tây Ban Nha\")",
"Refused when it shouldn't have": "Từ chối trả lời mà nhẽ không nên làm vậy",
"Regenerate": "Tạo sinh lại câu trả lời",
"Release Notes": "Mô tả những cập nhật mới",
......@@ -403,7 +406,7 @@
"Rosé Pine": "Rosé Pine",
"Rosé Pine Dawn": "Rosé Pine Dawn",
"RTL": "RTL",
"Running": "",
"Running": "Đang chạy",
"Save": "Lưu",
"Save & Create": "Lưu & Tạo",
"Save & Update": "Lưu & Cập nhật",
......@@ -417,25 +420,26 @@
"Search Documents": "Tìm tài liệu",
"Search Models": "Tìm model",
"Search Prompts": "Tìm prompt",
"Search Query Generation Prompt": "",
"Search Query Generation Prompt Length Threshold": "",
"Search Query Generation Prompt": "Prompt tạo câu truy vấn, tìm kiếm",
"Search Query Generation Prompt Length Threshold": "Ngưỡng độ dài prompt tạo câu truy vấn, tìm kiếm",
"Search Result Count": "Số kết quả tìm kiếm",
"Search Tools": "",
"Searched {{count}} sites_other": "Đã tìm {{count}} sites_other",
"Searching \"{{searchQuery}}\"": "",
"Searching \"{{searchQuery}}\"": "Đang tìm \"{{searchQuery}}\"",
"Searxng Query URL": "URL truy vấn Searxng",
"See readme.md for instructions": "Xem readme.md để biết hướng dẫn",
"See what's new": "Xem những cập nhật mới",
"Seed": "Seed",
"Select a base model": "Chọn một base model",
"Select a engine": "",
"Select a engine": "Chọn dịch vụ",
"Select a mode": "Chọn một chế độ",
"Select a model": "Chọn mô hình",
"Select a pipeline": "Chọn một quy trình",
"Select a pipeline url": "Chọn url quy trình",
"Select an Ollama instance": "Chọn một thực thể Ollama",
"Select Documents": "",
"Select Documents": "Chọn tài liệu",
"Select model": "Chọn model",
"Select only one model to call": "",
"Select only one model to call": "Chọn model để gọi",
"Selected model(s) do not support image inputs": "Model được lựa chọn không hỗ trợ đầu vào là hình ảnh",
"Send": "Gửi",
"Send a Message": "Gửi yêu cầu",
......@@ -455,13 +459,13 @@
"Set Voice": "Đặt Giọng nói",
"Settings": "Cài đặt",
"Settings saved successfully!": "Cài đặt đã được lưu thành công!",
"Settings updated successfully": "",
"Settings updated successfully": "Các cài đặt đã được cập nhật thành công",
"Share": "Chia sẻ",
"Share Chat": "Chia sẻ Chat",
"Share to OpenWebUI Community": "Chia sẻ đến Cộng đồng OpenWebUI",
"short-summary": "tóm tắt ngắn",
"Show": "Hiển thị",
"Show Admin Details in Account Pending Overlay": "",
"Show Admin Details in Account Pending Overlay": "Hiển thị thông tin của Quản trị viên trên màn hình hiển thị Tài khoản đang chờ xử lý",
"Show shortcuts": "Hiển thị phím tắt",
"Showcased creativity": "Thể hiện sự sáng tạo",
"sidebar": "thanh bên",
......@@ -492,9 +496,9 @@
"Thanks for your feedback!": "Cám ơn bạn đã gửi phản hồi!",
"The score should be a value between 0.0 (0%) and 1.0 (100%).": "Điểm (score) phải có giá trị từ 0,0 (0%) đến 1,0 (100%).",
"Theme": "Chủ đề",
"Thinking...": "",
"Thinking...": "Đang suy luận...",
"This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "Điều này đảm bảo rằng các nội dung chat có giá trị của bạn được lưu an toàn vào cơ sở dữ liệu backend của bạn. Cảm ơn bạn!",
"This is an experimental feature, it may not function as expected and is subject to change at any time.": "",
"This is an experimental feature, it may not function as expected and is subject to change at any time.": "Đây là tính năng thử nghiệm, có thể không hoạt động như mong đợi và có thể thay đổi bất kỳ lúc nào.",
"This setting does not sync across browsers or devices.": "Cài đặt này không đồng bộ hóa trên các trình duyệt hoặc thiết bị.",
"Thorough explanation": "Giải thích kỹ lưỡng",
"Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.": "Mẹo: Cập nhật nhiều khe biến liên tiếp bằng cách nhấn phím tab trong đầu vào trò chuyện sau mỗi việc thay thế.",
......@@ -506,12 +510,14 @@
"to": " - ",
"To access the available model names for downloading,": "Để truy cập các tên mô hình có sẵn để tải xuống,",
"To access the GGUF models available for downloading,": "Để truy cập các mô hình GGUF có sẵn để tải xuống,",
"To access the WebUI, please reach out to the administrator. Admins can manage user statuses from the Admin Panel.": "",
"To add documents here, upload them to the \"Documents\" workspace first.": "",
"To access the WebUI, please reach out to the administrator. Admins can manage user statuses from the Admin Panel.": "Để truy cập vui lòng liên hệ với quản trị viên.",
"To add documents here, upload them to the \"Documents\" workspace first.": "Để thêm tài liệu, trước tiên hãy upload chúng lên khu vực \"Tài liệu\".",
"to chat input.": "đến đầu vào trò chuyện.",
"To select toolkits here, add them to the \"Tools\" workspace first.": "",
"Today": "Hôm nay",
"Toggle settings": "Bật/tắt cài đặt",
"Toggle sidebar": "Bật/tắt thanh bên",
"Tools": "",
"Top K": "Top K",
"Top P": "Top P",
"Trouble accessing Ollama?": "Gặp vấn đề khi truy cập Ollama?",
......@@ -557,19 +563,19 @@
"What’s New in": "Thông tin mới về",
"When history is turned off, new chats on this browser won't appear in your history on any of your devices.": "Khi chế độ lịch sử chat đã tắt, các nội dung chat mới trên trình duyệt này sẽ không xuất hiện trên bất kỳ thiết bị nào của bạn.",
"Whisper (Local)": "",
"Widescreen Mode": "",
"Widescreen Mode": "Chế độ màn hình rộng",
"Workspace": "Workspace",
"Write a prompt suggestion (e.g. Who are you?)": "Hãy viết một prompt (vd: Bạn là ai?)",
"Write a summary in 50 words that summarizes [topic or keyword].": "Viết một tóm tắt trong vòng 50 từ cho [chủ đề hoặc từ khóa].",
"Yesterday": "Hôm qua",
"You": "Bạn",
"You can personalize your interactions with LLMs by adding memories through the 'Manage' button below, making them more helpful and tailored to you.": "",
"You can personalize your interactions with LLMs by adding memories through the 'Manage' button below, making them more helpful and tailored to you.": "Bạn có thể cá nhân hóa các tương tác của mình với LLM bằng cách thêm bộ nhớ thông qua nút 'Quản lý' bên dưới, làm cho chúng hữu ích hơn và phù hợp với bạn hơn.",
"You cannot clone a base model": "Bạn không thể nhân bản base model",
"You have no archived conversations.": "Bạn chưa lưu trữ một nội dung chat nào",
"You have shared this chat": "Bạn vừa chia sẻ chat này",
"You're a helpful assistant.": "Bạn là một trợ lý hữu ích.",
"You're now logged in.": "Bạn đã đăng nhập.",
"Your account status is currently pending activation.": "",
"Your account status is currently pending activation.": "Tài khoản của bạn hiện đang ở trạng thái chờ kích hoạt.",
"Youtube": "Youtube",
"Youtube Loader Settings": "Cài đặt Youtube Loader"
}
......@@ -33,6 +33,7 @@
"Admin": "管理员联系方式",
"Admin Panel": "管理员面板",
"Admin Settings": "管理员设置",
"Admins have access to all tools at all times; users need tools assigned per model in the workspace.": "",
"Advanced Parameters": "高级参数",
"Advanced Params": "高级参数",
"all": "所有",
......@@ -220,6 +221,7 @@
"Export Documents Mapping": "导出文档映射",
"Export Models": "导出模型",
"Export Prompts": "导出提示词",
"Export Tools": "导出工具",
"External Models": "外部模型",
"Failed to create API Key.": "无法创建 API 密钥。",
"Failed to read clipboard contents": "无法读取剪贴板内容",
......@@ -257,6 +259,7 @@
"Import Documents Mapping": "导入文档映射",
"Import Models": "导入模型",
"Import Prompts": "导入提示词",
"Import Tools": "导入工具",
"Include `--api` flag when running stable-diffusion-webui": "运行 stable-diffusion-webui 时包含 `--api` 标志",
"Info": "信息",
"Input commands": "输入命令",
......@@ -420,8 +423,9 @@
"Search Query Generation Prompt": "搜索查询生成提示",
"Search Query Generation Prompt Length Threshold": "搜索查询生成提示长度阈值",
"Search Result Count": "搜索结果数量",
"Search Tools": "搜索工具",
"Searched {{count}} sites_other": "检索到 {{count}} 个网站",
"Searching \"{{searchQuery}}\"": "",
"Searching \"{{searchQuery}}\"": "搜索 \"{{searchQuery}}\"",
"Searxng Query URL": "Searxng 查询 URL",
"See readme.md for instructions": "查看 readme.md 以获取说明",
"See what's new": "查阅最新更新内容",
......@@ -442,7 +446,7 @@
"Send message": "发送消息",
"September": "九月",
"Serper API Key": "Serper API 密钥",
"Serply API Key": "",
"Serply API Key": "Serply API 密钥",
"Serpstack API Key": "Serpstack API 密钥",
"Server connection verified": "已验证服务器连接",
"Set as default": "设为默认",
......@@ -509,9 +513,11 @@
"To access the WebUI, please reach out to the administrator. Admins can manage user statuses from the Admin Panel.": "请联系管理员以访问。管理员可以在后台管理面板中管理用户状态。",
"To add documents here, upload them to the \"Documents\" workspace first.": "要在此处添加文档,请先将它们上传到工作空间中的“文档”内。",
"to chat input.": "到对话输入。",
"To select toolkits here, add them to the \"Tools\" workspace first.": "",
"Today": "今天",
"Toggle settings": "切换设置",
"Toggle sidebar": "切换侧边栏",
"Tools": "工具",
"Top K": "Top K",
"Top P": "Top P",
"Trouble accessing Ollama?": "访问 Ollama 时遇到问题?",
......
......@@ -33,6 +33,7 @@
"Admin": "",
"Admin Panel": "管理員控制台",
"Admin Settings": "管理設定",
"Admins have access to all tools at all times; users need tools assigned per model in the workspace.": "",
"Advanced Parameters": "進階參數",
"Advanced Params": "進階參數",
"all": "所有",
......@@ -220,6 +221,7 @@
"Export Documents Mapping": "匯出文件映射",
"Export Models": "匯出模型",
"Export Prompts": "匯出提示詞",
"Export Tools": "",
"External Models": "",
"Failed to create API Key.": "無法創建 API 金鑰。",
"Failed to read clipboard contents": "無法讀取剪貼簿內容",
......@@ -257,6 +259,7 @@
"Import Documents Mapping": "匯入文件映射",
"Import Models": "匯入模型",
"Import Prompts": "匯入提示詞",
"Import Tools": "",
"Include `--api` flag when running stable-diffusion-webui": "在運行 stable-diffusion-webui 時加上 `--api` 標誌",
"Info": "資訊",
"Input commands": "輸入命令",
......@@ -420,6 +423,7 @@
"Search Query Generation Prompt": "",
"Search Query Generation Prompt Length Threshold": "",
"Search Result Count": "搜尋結果數量",
"Search Tools": "",
"Searched {{count}} sites_other": "掃描 {{count}} 個網站_其他",
"Searching \"{{searchQuery}}\"": "",
"Searxng Query URL": "Searxng 查詢 URL",
......@@ -509,9 +513,11 @@
"To access the WebUI, please reach out to the administrator. Admins can manage user statuses from the Admin Panel.": "",
"To add documents here, upload them to the \"Documents\" workspace first.": "",
"to chat input.": "到聊天輸入框來啟動此命令。",
"To select toolkits here, add them to the \"Tools\" workspace first.": "",
"Today": "今天",
"Toggle settings": "切換設定",
"Toggle sidebar": "切換側邊欄",
"Tools": "",
"Top K": "Top K",
"Top P": "Top P",
"Trouble accessing Ollama?": "存取 Ollama 時遇到問題?",
......
......@@ -23,24 +23,11 @@ export const chatId = writable('');
export const chats = writable([]);
export const tags = writable([]);
export const models: Writable<Model[]> = writable([]);
export const modelfiles = writable([]);
export const models: Writable<Model[]> = writable([]);
export const prompts: Writable<Prompt[]> = writable([]);
export const documents = writable([
{
collection_name: 'collection_name',
filename: 'filename',
name: 'name',
title: 'title'
},
{
collection_name: 'collection_name1',
filename: 'filename1',
name: 'name1',
title: 'title1'
}
]);
export const documents: Writable<Document[]> = writable([]);
export const tools = writable([]);
export const banners: Writable<Banner[]> = writable([]);
......@@ -135,6 +122,13 @@ type Prompt = {
timestamp: number;
};
type Document = {
collection_name: string;
filename: string;
name: string;
title: string;
};
type Config = {
status: boolean;
name: string;
......
......@@ -8,11 +8,14 @@
import { goto } from '$app/navigation';
import { getModels as _getModels } from '$lib/apis';
import { getOllamaVersion } from '$lib/apis/ollama';
import { getPrompts } from '$lib/apis/prompts';
import { getAllChatTags } from '$lib/apis/chats';
import { getPrompts } from '$lib/apis/prompts';
import { getDocs } from '$lib/apis/documents';
import { getAllChatTags } from '$lib/apis/chats';
import { getTools } from '$lib/apis/tools';
import { getBanners } from '$lib/apis/configs';
import { getUserSettings } from '$lib/apis/users';
import {
user,
......@@ -25,33 +28,21 @@
banners,
showChangelog,
config,
showCallOverlay
showCallOverlay,
tools
} from '$lib/stores';
import { REQUIRED_OLLAMA_VERSION, WEBUI_API_BASE_URL } from '$lib/constants';
import { compareVersion } from '$lib/utils';
import SettingsModal from '$lib/components/chat/SettingsModal.svelte';
import Sidebar from '$lib/components/layout/Sidebar.svelte';
import ShortcutsModal from '$lib/components/chat/ShortcutsModal.svelte';
import ChangelogModal from '$lib/components/ChangelogModal.svelte';
import Tooltip from '$lib/components/common/Tooltip.svelte';
import { getBanners } from '$lib/apis/configs';
import { getUserSettings } from '$lib/apis/users';
import Help from '$lib/components/layout/Help.svelte';
import AccountPending from '$lib/components/layout/Overlay/AccountPending.svelte';
import { error } from '@sveltejs/kit';
import CallOverlay from '$lib/components/chat/MessageInput/CallOverlay.svelte';
const i18n = getContext('i18n');
let ollamaVersion = '';
let loaded = false;
let showShortcutsButtonElement: HTMLButtonElement;
let DB = null;
let localDBChats = [];
let showShortcuts = false;
const getModels = async () => {
return _getModels(localStorage.token);
};
......@@ -99,6 +90,9 @@
(async () => {
documents.set(await getDocs(localStorage.token));
})(),
(async () => {
tools.set(await getTools(localStorage.token));
})(),
(async () => {
banners.set(await getBanners(localStorage.token));
})(),
......
......@@ -14,7 +14,11 @@
</title>
</svelte:head>
<div class=" flex flex-col w-full min-h-screen max-h-screen">
<div
class=" flex flex-col w-full min-h-screen max-h-screen {$showSidebar
? 'md:max-w-[calc(100%-260px)]'
: ''}"
>
<div class=" px-4 pt-3 mt-0.5 mb-1">
<div class=" flex items-center gap-1">
<div class="{$showSidebar ? 'md:hidden' : ''} mr-1 self-start flex flex-none items-center">
......@@ -61,6 +65,15 @@
{$i18n.t('Documents')}
</a>
<a
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/workspace/tools')
? 'bg-gray-50 dark:bg-gray-850'
: ''} transition"
href="/workspace/tools"
>
{$i18n.t('Tools')}
</a>
<a
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/workspace/playground')
? 'bg-gray-50 dark:bg-gray-850'
......
......@@ -2,7 +2,7 @@
import { v4 as uuidv4 } from 'uuid';
import { toast } from 'svelte-sonner';
import { goto } from '$app/navigation';
import { settings, user, config, models } from '$lib/stores';
import { settings, user, config, models, tools } from '$lib/stores';
import { onMount, tick, getContext } from 'svelte';
import { addNewModel, getModelById, getModelInfos } from '$lib/apis/models';
......@@ -12,6 +12,8 @@
import Checkbox from '$lib/components/common/Checkbox.svelte';
import Tags from '$lib/components/common/Tags.svelte';
import Knowledge from '$lib/components/workspace/Models/Knowledge.svelte';
import ToolsSelector from '$lib/components/workspace/Models/ToolsSelector.svelte';
import { stringify } from 'postcss';
const i18n = getContext('i18n');
......@@ -54,16 +56,16 @@
vision: true
};
let toolIds = [];
let knowledge = [];
$: if (name) {
id = name.replace(/\s+/g, '-').toLowerCase();
}
let baseModel = null;
$: {
baseModel = $models.find((m) => m.id === info.base_model_id);
console.log(baseModel);
const addUsage = (base_model_id) => {
const baseModel = $models.find((m) => m.id === base_model_id);
if (baseModel) {
if (baseModel.owned_by === 'openai') {
capabilities.usage = baseModel.info?.meta?.capabilities?.usage ?? false;
......@@ -72,7 +74,7 @@
}
capabilities = capabilities;
}
}
};
const submitHandler = async () => {
loading = true;
......@@ -89,6 +91,14 @@
}
}
if (toolIds.length > 0) {
info.meta.toolIds = toolIds;
} else {
if (info.meta.toolIds) {
delete info.meta.toolIds;
}
}
info.params.stop = params.stop ? params.stop.split(',').filter((s) => s.trim()) : null;
Object.keys(info.params).forEach((key) => {
if (info.params[key] === '' || info.params[key] === null) {
......@@ -155,6 +165,7 @@
params.stop = params?.stop ? (params?.stop ?? []).join(',') : null;
capabilities = { ...capabilities, ...(model?.info?.meta?.capabilities ?? {}) };
toolIds = model?.info?.meta?.toolIds ?? [];
info = {
...info,
......@@ -360,6 +371,9 @@
class="px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg"
placeholder="Select a base model (e.g. llama3, gpt-4o)"
bind:value={info.base_model_id}
on:change={(e) => {
addUsage(e.target.value);
}}
required
>
<option value={null} class=" text-gray-900">{$i18n.t('Select a base model')}</option>
......@@ -552,6 +566,10 @@
<Knowledge bind:knowledge />
</div>
<div class="my-2">
<ToolsSelector bind:selectedToolIds={toolIds} tools={$tools} />
</div>
<div class="my-1">
<div class="flex w-full justify-between mb-1">
<div class=" self-center text-sm font-semibold">{$i18n.t('Capabilities')}</div>
......
......@@ -5,7 +5,7 @@
import { onMount, getContext } from 'svelte';
import { page } from '$app/stores';
import { settings, user, config, models } from '$lib/stores';
import { settings, user, config, models, tools } from '$lib/stores';
import { splitStream } from '$lib/utils';
import { getModelInfos, updateModelById } from '$lib/apis/models';
......@@ -15,6 +15,7 @@
import Checkbox from '$lib/components/common/Checkbox.svelte';
import Tags from '$lib/components/common/Tags.svelte';
import Knowledge from '$lib/components/workspace/Models/Knowledge.svelte';
import ToolsSelector from '$lib/components/workspace/Models/ToolsSelector.svelte';
const i18n = getContext('i18n');
......@@ -60,6 +61,7 @@
};
let knowledge = [];
let toolIds = [];
const updateHandler = async () => {
loading = true;
......@@ -76,6 +78,14 @@
}
}
if (toolIds.length > 0) {
info.meta.toolIds = toolIds;
} else {
if (info.meta.toolIds) {
delete info.meta.toolIds;
}
}
info.params.stop = params.stop ? params.stop.split(',').filter((s) => s.trim()) : null;
Object.keys(info.params).forEach((key) => {
if (info.params[key] === '' || info.params[key] === null) {
......@@ -133,6 +143,10 @@
knowledge = [...model?.info?.meta?.knowledge];
}
if (model?.info?.meta?.toolIds) {
toolIds = [...model?.info?.meta?.toolIds];
}
if (model?.owned_by === 'openai') {
capabilities.usage = false;
}
......@@ -515,6 +529,10 @@
<Knowledge bind:knowledge />
</div>
<div class="my-2">
<ToolsSelector bind:selectedToolIds={toolIds} tools={$tools} />
</div>
<div class="my-2">
<div class="flex w-full justify-between mb-1">
<div class=" self-center text-sm font-semibold">{$i18n.t('Capabilities')}</div>
......
<script>
import Tools from '$lib/components/workspace/Tools.svelte';
</script>
<Tools />
<script>
import { goto } from '$app/navigation';
import { createNewTool, getTools } from '$lib/apis/tools';
import ToolkitEditor from '$lib/components/workspace/Tools/ToolkitEditor.svelte';
import { tools } from '$lib/stores';
import { onMount } from 'svelte';
import { toast } from 'svelte-sonner';
let mounted = false;
let clone = false;
let tool = null;
const saveHandler = async (data) => {
console.log(data);
const res = await createNewTool(localStorage.token, {
id: data.id,
name: data.name,
meta: data.meta,
content: data.content
}).catch((error) => {
toast.error(error);
return null;
});
if (res) {
toast.success('Tool created successfully');
tools.set(await getTools(localStorage.token));
await goto('/workspace/tools');
}
};
onMount(() => {
if (sessionStorage.tool) {
tool = JSON.parse(sessionStorage.tool);
sessionStorage.removeItem('tool');
console.log(tool);
clone = true;
}
mounted = true;
});
</script>
{#if mounted}
<ToolkitEditor
id={tool?.id ?? ''}
name={tool?.name ?? ''}
meta={tool?.meta ?? { description: '' }}
content={tool?.content ?? ''}
{clone}
on:save={(e) => {
saveHandler(e.detail);
}}
/>
{/if}
<script>
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { getToolById, getTools, updateToolById } from '$lib/apis/tools';
import Spinner from '$lib/components/common/Spinner.svelte';
import ToolkitEditor from '$lib/components/workspace/Tools/ToolkitEditor.svelte';
import { tools } from '$lib/stores';
import { onMount } from 'svelte';
import { toast } from 'svelte-sonner';
let tool = null;
const saveHandler = async (data) => {
console.log(data);
const res = await updateToolById(localStorage.token, tool.id, {
id: data.id,
name: data.name,
meta: data.meta,
content: data.content
}).catch((error) => {
toast.error(error);
return null;
});
if (res) {
toast.success('Tool updated successfully');
tools.set(await getTools(localStorage.token));
// await goto('/workspace/tools');
}
};
onMount(async () => {
console.log('mounted');
const id = $page.url.searchParams.get('id');
if (id) {
tool = await getToolById(localStorage.token, id).catch((error) => {
toast.error(error);
goto('/workspace/tools');
return null;
});
console.log(tool);
}
});
</script>
{#if tool}
<ToolkitEditor
edit={true}
id={tool.id}
name={tool.name}
meta={tool.meta}
content={tool.content}
on:save={(e) => {
saveHandler(e.detail);
}}
/>
{:else}
<div class="flex items-center justify-center h-full">
<div class=" pb-16">
<Spinner />
</div>
</div>
{/if}
<script>
import { io } from 'socket.io-client';
import { spring } from 'svelte/motion';
let loadingProgress = spring(0, {
stiffness: 0.05
});
import { onMount, tick, setContext } from 'svelte';
import {
......@@ -116,8 +121,35 @@
await tick();
document.getElementById('splash-screen')?.remove();
loaded = true;
if (
document.documentElement.classList.contains('her') &&
document.getElementById('progress-bar')
) {
loadingProgress.subscribe((value) => {
const progressBar = document.getElementById('progress-bar');
if (progressBar) {
progressBar.style.width = `${value * 0.24}rem`;
}
});
await loadingProgress.set(100);
document.getElementById('splash-screen')?.remove();
const audio = new Audio(`/audio/greeting.mp3`);
const playAudio = () => {
audio.play();
document.removeEventListener('click', playAudio);
};
document.addEventListener('click', playAudio);
loaded = true;
} else {
document.getElementById('splash-screen')?.remove();
loaded = true;
}
return () => {
window.removeEventListener('resize', onResize);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment