File size: 1,313 Bytes
ecc8726
 
 
 
 
f5bde8f
ecc8726
 
 
 
201e72b
ecc8726
 
 
 
 
 
 
 
 
1900b1d
 
ecc8726
bddfd4e
 
 
 
 
 
ecc8726
f5bde8f
f47ba34
 
c159b12
 
f5bde8f
c159b12
f47ba34
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from typing import Optional, Dict, Any, List
from typing_extensions import TypedDict
from pydantic import BaseModel

class GraphState(TypedDict):
    """State object passed through LangGraph workflow"""
    query: str
    context: str
    ingestor_context: str
    result: str
    sources: List[Dict[str, str]] 
    reports_filter: str
    sources_filter: str
    subtype_filter: str
    year_filter: str
    file_content: Optional[bytes]
    filename: Optional[str]
    metadata: Optional[Dict[str, Any]]
    file_type: Optional[str]
    workflow_type: Optional[str]  # 'standard' or 'geojson_direct'
    metadata_filters: Optional[Dict[str, Any]]
    metadata: Dict[str, Any]

class Message(BaseModel):
    """Single message in conversation history"""
    role: str  # 'user', 'assistant', or 'system'
    content: str
    id: Optional[str] = None

class ChatUIInput(BaseModel):
    """Input model for text-only ChatUI requests"""
    messages: Optional[List[Message]] = None  # Structured conversation history
    preprompt: Optional[str] = None

class ChatUIFileInput(BaseModel):
    """Input model for ChatUI requests with file attachments"""
    files: Optional[List[Dict[str, Any]]] = None
    messages: Optional[List[Message]] = None  # Structured conversation history
    preprompt: Optional[str] = None