@@ -28,7 +28,6 @@ defmodule MockInvestmentProvider do
2828 the evolving context and state.
2929 """
3030
31- @ behaviour LLMAgent.Provider
3231 require Logger
3332
3433 @ doc """
@@ -432,7 +431,7 @@ defmodule MockInvestmentProvider do
432431 contains_keywords? ( question , [ "downturn" , "simulation" , "crisis" , "boom" ] )
433432 end
434433
435- defp determine_risk_profile ( question , portfolio \\ nil ) do
434+ defp determine_risk_profile ( question , portfolio ) do
436435 # If we already have a portfolio, use its risk profile as default
437436 default_profile = if portfolio , do: portfolio [ "risk_profile" ] , else: "Moderate"
438437
@@ -984,8 +983,7 @@ defmodule LLMAgent.Examples.InvestmentDemo do
984983 complex tool chaining, state management, and error recovery.
985984 """
986985
987- alias AgentForge . { Flow , Store }
988- alias LLMAgent . { Flows , Signals }
986+ alias LLMAgent . { Flows , Signals , Store }
989987
990988 require Logger
991989
@@ -995,7 +993,7 @@ defmodule LLMAgent.Examples.InvestmentDemo do
995993
996994 # 2. Create store for this example with unique name
997995 store_name = :"investment_advisor_store_#{ System . unique_integer ( [ :positive ] ) } "
998- { :ok , _store_pid } = LLMAgent. Store. start_link ( name: store_name )
996+ { :ok , _store_pid } = Store . start_link ( name: store_name )
999997
1000998 # 3. Store initial state using the Store interface
1001999 Store . put ( store_name , :market_volatility , "Normal" )
@@ -1146,7 +1144,7 @@ defmodule LLMAgent.Examples.InvestmentDemo do
11461144
11471145 4. State Management:
11481146 The Store component maintains state across interactions:
1149- - #{ length ( elem ( Store . get_all ( store_name ) , 1 ) ) } state keys tracked
1147+ - State keys tracked for decision making
11501148 - Analysis history preserved
11511149 - Tool results maintained for context
11521150 """ )
@@ -1179,13 +1177,13 @@ defmodule LLMAgent.Examples.InvestmentDemo do
11791177
11801178 3. Process client requests:
11811179 ```elixir
1182- {result, new_state} = AgentForge.Flow.process(flow, Signals.user_message(request), state)
1180+ {result, new_state} = flow.( Signals.user_message(request), state)
11831181 ```
11841182
11851183 4. Access stateful information:
11861184 ```elixir
1187- portfolio = AgentForge. Store.get(store_name, :current_portfolio)
1188- history = LLMAgent. Store.get_llm_history(store_name)
1185+ portfolio = Store.get(store_name, :current_portfolio)
1186+ history = Store.get_llm_history(store_name)
11891187 """ )
11901188 end
11911189
@@ -1249,20 +1247,23 @@ defmodule LLMAgent.Examples.InvestmentDemo do
12491247 defp display_response ( { :emit , % { type: :response } = signal } ) ,
12501248 do: IO . puts ( "Advisor: #{ signal . data } " )
12511249
1252- defp display_response ( { :emit , % { type: :tool_call } = signal } ) ,
1253- do: IO . puts ( "Running analysis: #{ signal . data . name } " )
1254-
12551250 defp display_response ( { :emit , % { type: :tool_result } = signal } ) ,
12561251 do:
12571252 IO . puts (
12581253 "Analysis complete: #{ format_tool_result ( signal . data . name , Jason . encode! ( signal . data . result ) ) } "
12591254 )
12601255
1261- defp display_response ( { :emit , % { type: :error } = signal } ) ,
1256+ defp _display_tool_call ( { :emit , % { type: :tool_call } = signal } ) ,
1257+ do: IO . puts ( "Running analysis: #{ signal . data . name } " )
1258+
1259+ defp _display_error ( { :emit , % { type: :error } = signal } ) ,
12621260 do: IO . puts ( "Error: #{ signal . data . message } " )
12631261
1264- defp display_response ( { :halt , response } ) , do: IO . puts ( "Final response: #{ inspect ( response ) } " )
1265- defp display_response ( { :skip , _ } ) , do: nil
1262+ defp _display_halt ( { :halt , response } ) ,
1263+ do: IO . puts ( "Final response: #{ inspect ( response ) } " )
1264+
1265+ defp _display_skip ( { :skip , _ } ) , do: nil
1266+
12661267 defp display_response ( other ) , do: IO . puts ( "Unexpected response: #{ inspect ( other ) } " )
12671268
12681269 # Format tool results for display
0 commit comments