Skip to content

Talk2Competitors state

This is the state file for the talk2comp agent.

Talk2Competitors

Bases: AgentState

The state for the talk2comp agent, inheriting from AgentState.

Source code in aiagents4pharma/talk2competitors/state/state_talk2competitors.py
22
23
24
25
26
27
28
29
30
31
32
class Talk2Competitors(AgentState):
    """
    The state for the talk2comp agent, inheriting from AgentState.
    """

    papers: Annotated[Dict[str, Any], replace_dict]  # Changed from List to Dict
    search_table: NotRequired[str]
    next: str  # Required for routing in LangGraph
    current_agent: NotRequired[Optional[str]]
    is_last_step: Required[bool]  # Required field for LangGraph
    llm_model: str

replace_dict(existing, new)

Replace the existing dict with the new one.

Source code in aiagents4pharma/talk2competitors/state/state_talk2competitors.py
16
17
18
19
def replace_dict(existing: Dict[str, Any], new: Dict[str, Any]) -> Dict[str, Any]:
    """Replace the existing dict with the new one."""
    logger.info("Updating existing state %s with the state dict: %s", existing, new)
    return new