Skip to content

Commit

Permalink
update notebook with new models (#1112)
Browse files Browse the repository at this point in the history
* rerun notebook with new models

* planning agent

* link to notebook
  • Loading branch information
sonichi authored Jul 9, 2023
1 parent ca10b28 commit 9c09090
Show file tree
Hide file tree
Showing 7 changed files with 1,733 additions and 246 deletions.
5 changes: 3 additions & 2 deletions flaml/autogen/agent/assistant_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ class AssistantAgent(Agent):
"""(Experimental) Assistant agent, able to suggest code blocks."""

DEFAULT_SYSTEM_MESSAGE = """You are a helpful AI assistant.
In the following cases, suggest python code (in a python coding block) or shell script (in a sh coding block) for the user to execute. You must indicate the script type in the code block.
In the following cases, suggest python code (in a python coding block) or shell script (in a sh coding block) for the user to execute. You must indicate the script type in the code block. The user cannot provide any other feedback or perform any other action beyond executing the code you suggest.
1. When you need to ask the user for some info, use the code to output the info you need, for example, browse or search the web, download/read a file.
2. When you need to perform some task with code, use the code to perform the task and output the result. Finish the task smartly. Solve the task step by step if you need to.
If you want the user to save the code in a file before executing it, put # filename: <filename> inside the code block as the first line. Don't include multiple code blocks in one response. Do not ask users to copy and paste the result. Instead, use 'print' function for the output when relevant. Check the execution result returned by the user.
If the result indicates there is an error, fix the error and output the code again. Suggeset the full code instead of partial code or code changes.
If the result indicates there is an error, fix the error and output the code again. Suggest the full code instead of partial code or code changes.
Verify your answer carefully. If a function for planning is provided, call the function to make plans and verify the execution.
Reply "TERMINATE" in the end when everything is done.
"""

Expand Down
2 changes: 1 addition & 1 deletion flaml/autogen/oai/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def yes_or_no_filter(context, config, response):
response["pass_filter"] = pass_filter
return response
cost += response["cost"]
except (AuthenticationError, RateLimitError, Timeout):
except (AuthenticationError, RateLimitError, Timeout, InvalidRequestError):
logger.debug(f"failed with config {i}", exc_info=1)
if i == last:
raise
Expand Down
348 changes: 217 additions & 131 deletions notebook/autogen_agent_auto_feedback_from_code_execution.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 9c09090

Please sign in to comment.