|
|
""" |
|
|
src/states/vectorizationAgentState.py |
|
|
Vectorization Agent State - handles text-to-vector conversion with multilingual BERT |
|
|
""" |
|
|
|
|
|
from typing import Optional, List, Dict, Any |
|
|
from typing_extensions import TypedDict |
|
|
|
|
|
|
|
|
class VectorizationAgentState(TypedDict, total=False): |
|
|
""" |
|
|
State for Vectorization Agent. |
|
|
Converts text to vectors using language-specific BERT models. |
|
|
Steps: Language Detection → Vectorization → Expert Summary |
|
|
|
|
|
Note: This is a sequential graph, so no reducers needed. |
|
|
Each node's output fully replaces the field value. |
|
|
""" |
|
|
|
|
|
|
|
|
input_texts: List[Dict[str, Any]] |
|
|
batch_id: str |
|
|
|
|
|
|
|
|
language_detection_results: List[Dict[str, Any]] |
|
|
|
|
|
|
|
|
|
|
|
vector_embeddings: List[Dict[str, Any]] |
|
|
|
|
|
|
|
|
|
|
|
clustering_results: Optional[Dict[str, Any]] |
|
|
anomaly_results: Optional[Dict[str, Any]] |
|
|
|
|
|
|
|
|
trending_results: Optional[Dict[str, Any]] |
|
|
|
|
|
|
|
|
|
|
|
expert_summary: Optional[str] |
|
|
opportunities: List[Dict[str, Any]] |
|
|
threats: List[Dict[str, Any]] |
|
|
|
|
|
|
|
|
current_step: str |
|
|
processing_stats: Dict[str, Any] |
|
|
errors: List[str] |
|
|
|
|
|
|
|
|
llm_response: Optional[str] |
|
|
structured_output: Dict[str, Any] |
|
|
|
|
|
|
|
|
domain_insights: List[Dict[str, Any]] |
|
|
|
|
|
|
|
|
final_output: Dict[str, Any] |
|
|
|