diff --git a/lightrag/utils.py b/lightrag/utils.py index c8786e7b..fd8e0adc 100644 --- a/lightrag/utils.py +++ b/lightrag/utils.py @@ -657,6 +657,10 @@ def get_conversation_turns( Returns: Formatted string of the conversation history """ + # Check if num_turns is valid + if num_turns <= 0: + return "" + # Group messages into turns turns: list[list[dict[str, Any]]] = [] messages: list[dict[str, Any]] = [] diff --git a/lightrag_webui/src/stores/settings.ts b/lightrag_webui/src/stores/settings.ts index 84f5feac..60ae8f90 100644 --- a/lightrag_webui/src/stores/settings.ts +++ b/lightrag_webui/src/stores/settings.ts @@ -5,7 +5,7 @@ import { defaultQueryLabel } from '@/lib/constants' import { Message, QueryRequest } from '@/api/lightrag' type Theme = 'dark' | 'light' | 'system' -type Tab = 'documents' | 'knowledge-graph' | 'retrieval' +type Tab = 'documents' | 'knowledge-graph' | 'retrieval' | 'api' interface SettingsState { theme: Theme