add api tab in webui and handle invalid num_turns
This commit is contained in:
@@ -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]] = []
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user