Merge pull request #800 from ArnoChenFx/misc

Fix: Correct component paths, add 'api' tab, and handle invalid num_turns
This commit is contained in:
zrguo
2025-02-17 13:32:03 +08:00
committed by GitHub
7 changed files with 8 additions and 4 deletions

View File

@@ -657,6 +657,10 @@ def get_conversation_turns(
Returns: Returns:
Formatted string of the conversation history Formatted string of the conversation history
""" """
# Check if num_turns is valid
if num_turns <= 0:
return ""
# Group messages into turns # Group messages into turns
turns: list[list[dict[str, Any]]] = [] turns: list[list[dict[str, Any]]] = []
messages: list[dict[str, Any]] = [] messages: list[dict[str, Any]] = []

View File

@@ -1,5 +1,5 @@
import { useState, useCallback } from 'react' import { useState, useCallback } from 'react'
import ThemeProvider from '@/components/graph/ThemeProvider' import ThemeProvider from '@/components/ThemeProvider'
import MessageAlert from '@/components/MessageAlert' import MessageAlert from '@/components/MessageAlert'
import ApiKeyAlert from '@/components/ApiKeyAlert' import ApiKeyAlert from '@/components/ApiKeyAlert'
import StatusIndicator from '@/components/graph/StatusIndicator' import StatusIndicator from '@/components/graph/StatusIndicator'

View File

@@ -1,6 +1,6 @@
import Button from '@/components/ui/Button' import Button from '@/components/ui/Button'
import { SiteInfo } from '@/lib/constants' import { SiteInfo } from '@/lib/constants'
import ThemeToggle from '@/components/graph/ThemeToggle' import ThemeToggle from '@/components/ThemeToggle'
import { TabsList, TabsTrigger } from '@/components/ui/Tabs' import { TabsList, TabsTrigger } from '@/components/ui/Tabs'
import { useSettingsStore } from '@/stores/settings' import { useSettingsStore } from '@/stores/settings'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'

View File

@@ -1,5 +1,5 @@
import { useContext } from 'react' import { useContext } from 'react'
import { ThemeProviderContext } from '@/components/graph/ThemeProvider' import { ThemeProviderContext } from '@/components/ThemeProvider'
const useTheme = () => { const useTheme = () => {
const context = useContext(ThemeProviderContext) const context = useContext(ThemeProviderContext)

View File

@@ -5,7 +5,7 @@ import { defaultQueryLabel } from '@/lib/constants'
import { Message, QueryRequest } from '@/api/lightrag' import { Message, QueryRequest } from '@/api/lightrag'
type Theme = 'dark' | 'light' | 'system' type Theme = 'dark' | 'light' | 'system'
type Tab = 'documents' | 'knowledge-graph' | 'retrieval' type Tab = 'documents' | 'knowledge-graph' | 'retrieval' | 'api'
interface SettingsState { interface SettingsState {
theme: Theme theme: Theme