File size: 986 Bytes
65ade69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from typing import TypedDict, Annotated, List, Any
import operator

# The `AgentState` defines the data structure that is passed between nodes in our LangGraph.
# Every node in the graph will receive this state, and can return updates to it.
class AgentState(TypedDict):
    # The original startup idea provided by the user.
    idea: str
    
    # We use `Annotated` with `operator.add` to create a "reducer".
    # Since our 4 research agents will run in PARALLEL, they will all try to update the `results` key at the same time.
    # Without `operator.add`, the last agent to finish would overwrite the others. 
    # With `operator.add`, LangGraph knows to *append* their results into a single list safely.
    results: Annotated[List[dict[str, Any]], operator.add]
    
    # The final evaluation score from 0-100
    score: int
    
    # A categorical verdict: "Go", "Caution", or "No-Go"
    verdict: str
    
    # A brief textual summary of the final report
    summary: str