@@ -28,7 +28,6 @@ defmodule MockInvestmentProvider do
28
28
the evolving context and state.
29
29
"""
30
30
31
- @ behaviour LLMAgent.Provider
32
31
require Logger
33
32
34
33
@ doc """
@@ -432,7 +431,7 @@ defmodule MockInvestmentProvider do
432
431
contains_keywords? ( question , [ "downturn" , "simulation" , "crisis" , "boom" ] )
433
432
end
434
433
435
- defp determine_risk_profile ( question , portfolio \\ nil ) do
434
+ defp determine_risk_profile ( question , portfolio ) do
436
435
# If we already have a portfolio, use its risk profile as default
437
436
default_profile = if portfolio , do: portfolio [ "risk_profile" ] , else: "Moderate"
438
437
@@ -984,8 +983,7 @@ defmodule LLMAgent.Examples.InvestmentDemo do
984
983
complex tool chaining, state management, and error recovery.
985
984
"""
986
985
987
- alias AgentForge . { Flow , Store }
988
- alias LLMAgent . { Flows , Signals }
986
+ alias LLMAgent . { Flows , Signals , Store }
989
987
990
988
require Logger
991
989
@@ -995,7 +993,7 @@ defmodule LLMAgent.Examples.InvestmentDemo do
995
993
996
994
# 2. Create store for this example with unique name
997
995
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 )
999
997
1000
998
# 3. Store initial state using the Store interface
1001
999
Store . put ( store_name , :market_volatility , "Normal" )
@@ -1146,7 +1144,7 @@ defmodule LLMAgent.Examples.InvestmentDemo do
1146
1144
1147
1145
4. State Management:
1148
1146
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
1150
1148
- Analysis history preserved
1151
1149
- Tool results maintained for context
1152
1150
""" )
@@ -1179,13 +1177,13 @@ defmodule LLMAgent.Examples.InvestmentDemo do
1179
1177
1180
1178
3. Process client requests:
1181
1179
```elixir
1182
- {result, new_state} = AgentForge.Flow.process(flow, Signals.user_message(request), state)
1180
+ {result, new_state} = flow.( Signals.user_message(request), state)
1183
1181
```
1184
1182
1185
1183
4. Access stateful information:
1186
1184
```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)
1189
1187
""" )
1190
1188
end
1191
1189
@@ -1249,20 +1247,23 @@ defmodule LLMAgent.Examples.InvestmentDemo do
1249
1247
defp display_response ( { :emit , % { type: :response } = signal } ) ,
1250
1248
do: IO . puts ( "Advisor: #{ signal . data } " )
1251
1249
1252
- defp display_response ( { :emit , % { type: :tool_call } = signal } ) ,
1253
- do: IO . puts ( "Running analysis: #{ signal . data . name } " )
1254
-
1255
1250
defp display_response ( { :emit , % { type: :tool_result } = signal } ) ,
1256
1251
do:
1257
1252
IO . puts (
1258
1253
"Analysis complete: #{ format_tool_result ( signal . data . name , Jason . encode! ( signal . data . result ) ) } "
1259
1254
)
1260
1255
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 } ) ,
1262
1260
do: IO . puts ( "Error: #{ signal . data . message } " )
1263
1261
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
+
1266
1267
defp display_response ( other ) , do: IO . puts ( "Unexpected response: #{ inspect ( other ) } " )
1267
1268
1268
1269
# Format tool results for display
0 commit comments