Skip to content

Commit 4ff6449

Browse files
committed
chore: format
1 parent 80c7fc7 commit 4ff6449

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

examples/simple_qa_agent.exs

+18-16
Original file line numberDiff line numberDiff line change
@@ -182,27 +182,29 @@ defmodule LLMAgent.Examples.SimpleQA do
182182
]
183183

184184
# Process each question
185-
state = Enum.reduce(questions, state, fn question, current_state ->
186-
IO.puts("\nQuestion: #{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("\nQuestion: #{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)
201202

202203
# 6. Display conversation history
203204
history = Store.get_llm_history(store_name)
204205

205206
IO.puts("\n=== Conversation History ===")
207+
206208
Enum.each(history, fn message ->
207209
role = Map.get(message, "role") || Map.get(message, :role)
208210
content = Map.get(message, "content") || Map.get(message, :content)

0 commit comments

Comments
 (0)