@@ -182,27 +182,29 @@ defmodule LLMAgent.Examples.SimpleQA do
182
182
]
183
183
184
184
# Process each question
185
- state = Enum . reduce ( questions , state , fn question , current_state ->
186
- IO . puts ( "\n Question: #{ question } " )
187
-
188
- # Process the message through the flow
189
- case LLMAgent . process ( flow , current_state , question ) do
190
- { :ok , response , new_state } ->
191
- # Display the agent's response
192
- IO . puts ( "Assistant: #{ response . data } " )
193
- # Return updated state for next iteration
194
- new_state
195
-
196
- { :error , error , new_state } ->
197
- IO . puts ( "Error: #{ error } " )
198
- new_state
199
- end
200
- end )
185
+ state =
186
+ Enum . reduce ( questions , state , fn question , current_state ->
187
+ IO . puts ( "\n Question: #{ question } " )
188
+
189
+ # Process the message through the flow
190
+ case LLMAgent . process ( flow , current_state , question ) do
191
+ { :ok , response , new_state } ->
192
+ # Display the agent's response
193
+ IO . puts ( "Assistant: #{ response . data } " )
194
+ # Return updated state for next iteration
195
+ new_state
196
+
197
+ { :error , error , new_state } ->
198
+ IO . puts ( "Error: #{ error } " )
199
+ new_state
200
+ end
201
+ end )
201
202
202
203
# 6. Display conversation history
203
204
history = Store . get_llm_history ( store_name )
204
205
205
206
IO . puts ( "\n === Conversation History ===" )
207
+
206
208
Enum . each ( history , fn message ->
207
209
role = Map . get ( message , "role" ) || Map . get ( message , :role )
208
210
content = Map . get ( message , "content" ) || Map . get ( message , :content )
0 commit comments