From 5bea2d5f4414d8e6732ee9040758a43824925f04 Mon Sep 17 00:00:00 2001 From: littlewwwhite <1095245867@qq.com> Date: Sat, 15 Feb 2025 23:23:59 +0800 Subject: [PATCH 1/2] bug: -- --- src/routers/chat_router.py | 5 ----- src/utils/web_search.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/routers/chat_router.py b/src/routers/chat_router.py index 3f7d6117..ad136dde 100644 --- a/src/routers/chat_router.py +++ b/src/routers/chat_router.py @@ -72,12 +72,7 @@ def chat_post( chunk = make_chunk("", "searching", history=None) yield chunk -<<<<<<< HEAD - meta["config"] = startup.config - new_query, refs = startup.retriever(query, history_manager.messages, meta) -======= modified_query, refs = startup.retriever(modified_query, history_manager.messages, meta) ->>>>>>> feature/web_search refs_pool[cur_res_id] = refs messages = history_manager.get_history_with_msg(modified_query, max_rounds=meta.get('history_round')) diff --git a/src/utils/web_search.py b/src/utils/web_search.py index 7c5062b4..781e4553 100644 --- a/src/utils/web_search.py +++ b/src/utils/web_search.py @@ -7,7 +7,7 @@ logger = setup_logger("web-search") class WebSearcher: def __init__(self): - api_key = os.getenv("TAVILY_API_KEY", "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") + api_key = os.getenv("TAVILY_API_KEY") if not api_key: raise ValueError("TAVILY_API_KEY environment variable is not set") self.client = TavilyClient(api_key) From d10c402f27f2b925d3980c244c8945d7b35e1524 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Wed, 26 Feb 2025 12:37:06 +0800 Subject: [PATCH 2/2] details update --- web/src/components/ChatComponent.vue | 10 +++-- web/src/layouts/AppLayout.vue | 67 +++++++++++++++++++++++++--- 2 files changed, 67 insertions(+), 10 deletions(-) diff --git a/web/src/components/ChatComponent.vue b/web/src/components/ChatComponent.vue index 0943c333..8fc760e6 100644 --- a/web/src/components/ChatComponent.vue +++ b/web/src/components/ChatComponent.vue @@ -122,7 +122,7 @@ 知识图谱 @@ -786,6 +786,7 @@ watch( text-align: left; word-wrap: break-word; margin: 0; + max-width: 100%; padding-bottom: 0; padding-top: 16px; padding-left: 0; @@ -821,10 +822,10 @@ watch( max-width: 900px; margin: 0 auto; padding: 0.25rem 0.5rem; - border: 2px solid #E5E5E5; + border: 2px solid var(--gray-200); border-radius: 1rem; - background: #fcfdfd; - transition: background 0.3s, box-shadow 0.3s; + background: var(--gray-50); + transition: background, border 0.3s, box-shadow 0.3s; &:focus-within { border: 2px solid var(--main-500); background: white; @@ -1068,6 +1069,7 @@ watch( } .message-md { + max-width: 100%; h1, h2, h3, h4, h5, h6 { font-size: 1rem; } diff --git a/web/src/layouts/AppLayout.vue b/web/src/layouts/AppLayout.vue index c6f61ca0..48b41abd 100644 --- a/web/src/layouts/AppLayout.vue +++ b/web/src/layouts/AppLayout.vue @@ -35,6 +35,10 @@ const layoutSettings = reactive({ useTopBar: false, // 是否使用顶栏 }) +// Add state for GitHub stars +const githubStars = ref(0) +const isLoadingStars = ref(false) + const getRemoteConfig = () => { configStore.refreshConfig() } @@ -46,9 +50,24 @@ const getRemoteDatabase = () => { databaseStore.refreshDatabase() } +// Fetch GitHub stars count +const fetchGithubStars = async () => { + try { + isLoadingStars.value = true + const response = await fetch('https://api.github.com/repos/xerrors/Yuxi-Know') + const data = await response.json() + githubStars.value = data.stargazers_count + } catch (error) { + console.error('Error fetching GitHub stars:', error) + } finally { + isLoadingStars.value = false + } +} + onMounted(() => { getRemoteConfig() getRemoteDatabase() + fetchGithubStars() // Fetch GitHub stars on mount }) // 打印当前页面的路由信息,使用 vue3 的 setup composition API @@ -114,8 +133,11 @@ console.log(route)
@@ -231,6 +253,30 @@ div.header, #app-router-view { background-color: transparent; border: 1px solid transparent; } + + .github-link { + display: flex; + flex-direction: column; + align-items: center; + color: inherit; + } + + .github-stars { + display: flex; + align-items: center; + font-size: 12px; + margin-top: 4px; + + .star-icon { + color: #f0a742; + font-size: 12px; + margin-right: 2px; + } + + .star-count { + font-weight: 600; + } + } } &.setting { @@ -389,7 +435,6 @@ div.header, #app-router-view { font-size: 15px; } - &.github, &.setting { padding: 8px 12px; @@ -406,11 +451,21 @@ div.header, #app-router-view { &.github { a { display: flex; - justify-content: center; align-items: center; } + + .github-stars { + display: flex; + align-items: center; + margin-left: 6px; + + .star-icon { + color: #f0a742; + font-size: 14px; + margin-right: 2px; + } + } } } } - - + \ No newline at end of file