From 374855f99a945f8599cf5f321116832358b096e9 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Sat, 29 Mar 2025 19:19:43 +0800 Subject: [PATCH 1/3] fix api key empty bug --- src/models/chat_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/chat_model.py b/src/models/chat_model.py index fe5c9c82..600cfe06 100644 --- a/src/models/chat_model.py +++ b/src/models/chat_model.py @@ -37,7 +37,7 @@ class OpenAIBase(): stream=False, ) return response.choices[0].message - + def get_models(self): try: return self.client.models.list() @@ -58,7 +58,7 @@ class OpenModel(OpenAIBase): class CustomModel(OpenAIBase): def __init__(self, model_info): model_name = model_info["name"] - api_key = model_info.get("api_key", "custom_model") + api_key = model_info.get("api_key") or "custom_model" base_url = get_docker_safe_url(model_info["api_base"]) logger.info(f"> Custom model: {model_name}, base_url: {base_url}") From 224caa623e993c8e3c45755f0691627ee5fd4238 Mon Sep 17 00:00:00 2001 From: zhaosb Date: Sat, 29 Mar 2025 23:00:49 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A8=A1=E5=9E=8B=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E8=B6=85=E9=95=BF=E5=AF=BC=E8=87=B4=E6=96=87=E5=AD=97=E6=BA=A2?= =?UTF-8?q?=E5=87=BA=E9=97=AE=E9=A2=98=EF=BC=88=E5=85=B3=E8=81=94=20Issue?= =?UTF-8?q?=20#100=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/SettingView.vue | 24 +++++++++++++++++++++++- web/vite.config.js | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/web/src/views/SettingView.vue b/web/src/views/SettingView.vue index fe19385c..a08a4fe1 100644 --- a/web/src/views/SettingView.vue +++ b/web/src/views/SettingView.vue @@ -106,7 +106,7 @@ @click="handleChange('model_provider', 'custom'); handleChange('model_name', item.custom_id)" >
-
{{ item.name }}
+
{{ item.name }}
{ .name { color: var(--gray-1000); font-weight: bold; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + flex: 1; + margin-right: 8px; + position: relative; + + &:hover::after { + content: attr(title); + position: absolute; + left: 0; + top: 100%; + background: rgba(0, 0, 0, 0.8); + color: white; + padding: 4px 8px; + border-radius: 4px; + font-size: 12px; + white-space: nowrap; + z-index: 1000; + margin-top: 5px; + } } .action { opacity: 0; user-select: none; margin-left: auto; + flex-shrink: 0; button { padding: 4px 8px; } diff --git a/web/vite.config.js b/web/vite.config.js index 2c0b3e13..d318dcb7 100644 --- a/web/vite.config.js +++ b/web/vite.config.js @@ -14,7 +14,7 @@ export default defineConfig(({ mode }) => { server: { proxy: { '^/api': { - target: env.VITE_API_URL || 'http://localhost:5050', + target: env.VITE_API_URL || 'http://127.0.0.1:5050', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') } From 3b65dee0e8ea38303941cf46fb50c8b91a978741 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Sun, 30 Mar 2025 11:09:46 +0800 Subject: [PATCH 3/3] Update graphbase.py --- src/core/graphbase.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/graphbase.py b/src/core/graphbase.py index 178d6ef5..75bf1419 100644 --- a/src/core/graphbase.py +++ b/src/core/graphbase.py @@ -172,7 +172,8 @@ class GraphDatabase: def read_triples(file_path): with open(file_path, 'r', encoding='utf-8') as file: for line in file: - yield json.loads(line.strip()) + if line.strip(): + yield json.loads(line.strip()) triples = list(read_triples(file_path)) @@ -455,4 +456,4 @@ class GraphDatabase: if __name__ == "__main__": - pass \ No newline at end of file + pass