Skip to content

Commit b3f599c

Browse files
committed
Refine agent interaction and improve CLI output
This commit includes two main changes: 1. In `aicodebot/agents.py`, the prompt for the AI agent has been updated to emphasize the importance of properly formatting responses in JSON. This change is crucial to ensure that the agent's responses can be correctly parsed and processed. 2. In `aicodebot/cli.py`, the verbosity level passed to the `get_agent` function is now the one provided by the user, instead of always being `True`. Additionally, the agent's response is now displayed in a more user-friendly way, with a spinner indicating that the agent is "thinking", and the response being printed separately from the spinner. This improves the user experience by providing clearer feedback about what the agent is doing.
1 parent 80118f1 commit b3f599c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

aicodebot/agents.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
1010
If asking the human for more clarification would produce better results, you can ask the human for more information.
1111
12-
Before changing any local files, you should ALWAYS check with the human developer first, explaining what you are doing,
13-
you can give human multiple choices.
12+
Important: When you respond calling a tool, you should make sure your response is properly json formatted, ie escape
13+
quotes and newlines.
14+
15+
Before writing any local files, you should ALWAYS check with the human developer first, explaining what you are doing.
1416
"""
1517

1618

aicodebot/cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,12 @@ def sidekick(task, verbose):
243243
model = get_llm_model()
244244
llm = ChatOpenAI(model=model, temperature=DEFAULT_TEMPERATURE, max_tokens=3500, verbose=verbose)
245245

246-
agent = get_agent("sidekick", llm, True)
246+
agent = get_agent("sidekick", llm, verbose)
247247

248-
response = agent({"input": task})
249-
console.print(response, style=bot_style)
248+
with console.status("Thinking", spinner=DEFAULT_SPINNER):
249+
response = agent({"input": task})
250+
console.print("")
251+
console.print(response["output"], style=bot_style)
250252

251253

252254
# ---------------------------------------------------------------------------- #

0 commit comments

Comments
 (0)