Conditional logic
ConditionalLogic
Bases: BaseModel
flowchart TD
src.tradingagents.graph.conditional_logic.ConditionalLogic[ConditionalLogic]
click src.tradingagents.graph.conditional_logic.ConditionalLogic href "" "src.tradingagents.graph.conditional_logic.ConditionalLogic"
Methods:
| Name | Description |
|---|---|
should_continue_market |
Determine whether to continue market analysis or clear messages. |
should_continue_social |
Determine whether to continue social media analysis or clear messages. |
should_continue_news |
Determine whether to continue news analysis or clear messages. |
should_continue_fundamentals |
Determine whether to continue fundamentals analysis or clear messages. |
should_continue_debate |
Determine the next step in the investment debate. |
should_continue_risk_analysis |
Determine the next step in the risk analysis debate. |
max_debate_rounds
max_debate_rounds: int = Field(
default=1,
title="Max Debate Rounds",
description="Maximum number of Bull/Bear investment debate rounds",
)
max_risk_discuss_rounds
max_risk_discuss_rounds: int = Field(
default=1,
title="Max Risk Discussion Rounds",
description="Maximum number of Risk debate rounds",
)
should_continue_market
Determine whether to continue market analysis or clear messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent. |
required |
Returns:
| Type | Description |
|---|---|
Literal['tools_market', 'Msg Clear Market']
|
Literal["tools_market", "Msg Clear Market"]: Next node to execute. |
Source code in src/tradingagents/graph/conditional_logic.py
should_continue_social
Determine whether to continue social media analysis or clear messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent. |
required |
Returns:
| Type | Description |
|---|---|
Literal['tools_social', 'Msg Clear Social']
|
Literal["tools_social", "Msg Clear Social"]: Next node to execute. |
Source code in src/tradingagents/graph/conditional_logic.py
should_continue_news
Determine whether to continue news analysis or clear messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent. |
required |
Returns:
| Type | Description |
|---|---|
Literal['tools_news', 'Msg Clear News']
|
Literal["tools_news", "Msg Clear News"]: Next node to execute. |
Source code in src/tradingagents/graph/conditional_logic.py
should_continue_fundamentals
should_continue_fundamentals(
state: AgentState,
) -> Literal["tools_fundamentals", "Msg Clear Fundamentals"]
Determine whether to continue fundamentals analysis or clear messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent. |
required |
Returns:
| Type | Description |
|---|---|
Literal['tools_fundamentals', 'Msg Clear Fundamentals']
|
Literal["tools_fundamentals", "Msg Clear Fundamentals"]: Next node to execute. |
Source code in src/tradingagents/graph/conditional_logic.py
should_continue_debate
should_continue_debate(
state: AgentState,
) -> Literal["Bull Researcher", "Bear Researcher", "Research Manager"]
Determine the next step in the investment debate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent. |
required |
Returns:
| Type | Description |
|---|---|
Literal['Bull Researcher', 'Bear Researcher', 'Research Manager']
|
Literal["Bull Researcher", "Bear Researcher", "Research Manager"]: Next node to execute. |
Source code in src/tradingagents/graph/conditional_logic.py
should_continue_risk_analysis
should_continue_risk_analysis(
state: AgentState,
) -> Literal["Aggressive Analyst", "Conservative Analyst", "Neutral Analyst", "Risk Judge"]
Determine the next step in the risk analysis debate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent. |
required |
Returns:
| Type | Description |
|---|---|
Literal['Aggressive Analyst', 'Conservative Analyst', 'Neutral Analyst', 'Risk Judge']
|
Literal["Aggressive Analyst", "Conservative Analyst", "Neutral Analyst", "Risk Judge"]: Next node to execute. |