Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update notebook with new models #1112

Merged
merged 3 commits into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading