Spaces:
Sleeping
Sleeping
feat: Introduce StateInput and StateOutput dataclasses for structured input and output handling
Browse files
pstuts_rag/pstuts_rag/state.py
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
|
|
| 1 |
from langchain_core.messages import BaseMessage
|
| 2 |
|
| 3 |
|
| 4 |
import operator
|
| 5 |
-
from typing import Annotated, List, TypedDict
|
| 6 |
|
| 7 |
|
| 8 |
class PsTutsTeamState(TypedDict):
|
| 9 |
messages: Annotated[List[BaseMessage], operator.add]
|
| 10 |
team_members: List[str]
|
| 11 |
next: str
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from dataclasses import dataclass, field
|
| 2 |
from langchain_core.messages import BaseMessage
|
| 3 |
|
| 4 |
|
| 5 |
import operator
|
| 6 |
+
from typing import Annotated, List, Tuple, TypedDict
|
| 7 |
|
| 8 |
|
| 9 |
class PsTutsTeamState(TypedDict):
|
| 10 |
messages: Annotated[List[BaseMessage], operator.add]
|
| 11 |
team_members: List[str]
|
| 12 |
next: str
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
@dataclass(kw_only=True)
|
| 16 |
+
class StateInput:
|
| 17 |
+
input_query: str = field(default=None) # Report topic
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
@dataclass(kw_only=True)
|
| 21 |
+
class StateOutput:
|
| 22 |
+
output_content: str = field(default=None) # Final report
|
| 23 |
+
video_references: List[Tuple[str, float]] = field(default=None)
|
| 24 |
+
url_references: List[str] = field(default=None)
|