Skip to content

Commit

Permalink
Refine agent interaction and improve CLI output
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TechNickAI committed Jul 1, 2023
1 parent 80118f1 commit b3f599c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions aicodebot/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
If asking the human for more clarification would produce better results, you can ask the human for more information.
Before changing any local files, you should ALWAYS check with the human developer first, explaining what you are doing,
you can give human multiple choices.
Important: When you respond calling a tool, you should make sure your response is properly json formatted, ie escape
quotes and newlines.
Before writing any local files, you should ALWAYS check with the human developer first, explaining what you are doing.
"""


Expand Down
8 changes: 5 additions & 3 deletions aicodebot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,12 @@ def sidekick(task, verbose):
model = get_llm_model()
llm = ChatOpenAI(model=model, temperature=DEFAULT_TEMPERATURE, max_tokens=3500, verbose=verbose)

agent = get_agent("sidekick", llm, True)
agent = get_agent("sidekick", llm, verbose)

response = agent({"input": task})
console.print(response, style=bot_style)
with console.status("Thinking", spinner=DEFAULT_SPINNER):
response = agent({"input": task})
console.print("")
console.print(response["output"], style=bot_style)


# ---------------------------------------------------------------------------- #
Expand Down

0 comments on commit b3f599c

Please sign in to comment.