Reflection
Reflector
Bases: BaseModel
flowchart TD
src.tradingagents.graph.reflection.Reflector[Reflector]
click src.tradingagents.graph.reflection.Reflector href "" "src.tradingagents.graph.reflection.Reflector"
Handles reflection on decisions and updating memory.
Methods:
| Name | Description |
|---|---|
reflect_bull_researcher |
Reflect on bull researcher's analysis and update memory. |
reflect_bear_researcher |
Reflect on bear researcher's analysis and update memory. |
reflect_trader |
Reflect on trader's decision and update memory. |
reflect_invest_judge |
Reflect on investment judge's decision and update memory. |
reflect_risk_manager |
Reflect on risk manager's decision and update memory. |
quick_thinking_llm
quick_thinking_llm: SkipValidation[ChatModel] = Field(
...,
title="Quick Thinking LLM",
description="LLM instance used for generating reflection analysis",
)
reflect_bull_researcher
reflect_bull_researcher(
current_state: AgentState, returns_losses: float, bull_memory: FinancialSituationMemory
) -> None
Reflect on bull researcher's analysis and update memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent graph. |
required |
|
float
|
The actual returns or losses observed. |
required |
|
FinancialSituationMemory
|
The memory component to update. |
required |
Source code in src/tradingagents/graph/reflection.py
reflect_bear_researcher
reflect_bear_researcher(
current_state: AgentState, returns_losses: float, bear_memory: FinancialSituationMemory
) -> None
Reflect on bear researcher's analysis and update memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent graph. |
required |
|
float
|
The actual returns or losses observed. |
required |
|
FinancialSituationMemory
|
The memory component to update. |
required |
Source code in src/tradingagents/graph/reflection.py
reflect_trader
reflect_trader(
current_state: AgentState, returns_losses: float, trader_memory: FinancialSituationMemory
) -> None
Reflect on trader's decision and update memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent graph. |
required |
|
float
|
The actual returns or losses observed. |
required |
|
FinancialSituationMemory
|
The memory component to update. |
required |
Source code in src/tradingagents/graph/reflection.py
reflect_invest_judge
reflect_invest_judge(
current_state: AgentState, returns_losses: float, invest_judge_memory: FinancialSituationMemory
) -> None
Reflect on investment judge's decision and update memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent graph. |
required |
|
float
|
The actual returns or losses observed. |
required |
|
FinancialSituationMemory
|
The memory component to update. |
required |
Source code in src/tradingagents/graph/reflection.py
reflect_risk_manager
reflect_risk_manager(
current_state: AgentState, returns_losses: float, risk_manager_memory: FinancialSituationMemory
) -> None
Reflect on risk manager's decision and update memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
AgentState
|
The current state of the agent graph. |
required |
|
float
|
The actual returns or losses observed. |
required |
|
FinancialSituationMemory
|
The memory component to update. |
required |