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

add agent notebook and documentation #1052

Merged
merged 27 commits into from
May 28, 2023
Merged

add agent notebook and documentation #1052

merged 27 commits into from
May 28, 2023

Conversation

qingyun-wu
Copy link
Contributor

Why are these changes needed?

Adding documentation and a notebook example about agents in FLAML

Related issue number

Checks

@sonichi sonichi added the documentation Improvements or additions to documentation label May 25, 2023
@sonichi sonichi self-assigned this May 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 27, 2023
@qingyun-wu qingyun-wu added this pull request to the merge queue May 27, 2023
@sonichi sonichi removed this pull request from the merge queue due to a manual request May 27, 2023
Copy link
Contributor

@sonichi sonichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependency

notebook/autogen_agent.ipynb Outdated Show resolved Hide resolved
notebook/autogen_agent.ipynb Outdated Show resolved Hide resolved
notebook/autogen_agent.ipynb Outdated Show resolved Hide resolved
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
"\n",
"FLAML offers an experimental feature of interactive LLM agents, which can be used to solve various tasks, including coding and math problem-solving.\n",
"\n",
"In this notebook, we demonstrate how to use `PythonAgent` and `UserProxyAgent` to write code and execute the code. Here `PythonAgent` is an LLM-based agent that can write Python code (in a Python coding block) for a user to execute for a given task. `UserProxyAgent` is an agent which serves as a proxy for a user to execute the code written by `PythonAgent`. By setting `user_interaction_mode` properly, the `UserProxyAgent` can also prompt the user for feedback to `PythonAgent`. For example, when `user_interaction_mode` is set to \"ALWAYS\", the `UserProxyAgent` will always prompt the user for feedback. When user feedback is provided, the `UserProxyAgent` will directly pass the feedback to `PythonAgent` without doing any additional steps. When no user feedback is provided, the `UserProxyAgent` will execute the code written by `PythonAgent` directly and returns the execution results (success or failure and corresponding outputs) to `PythonAgent`.\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"In this notebook, we demonstrate how to use `PythonAgent` and `UserProxyAgent` to write code and execute the code. Here `PythonAgent` is an LLM-based agent that can write Python code (in a Python coding block) for a user to execute for a given task. `UserProxyAgent` is an agent which serves as a proxy for a user to execute the code written by `PythonAgent`. By setting `user_interaction_mode` properly, the `UserProxyAgent` can also prompt the user for feedback to `PythonAgent`. For example, when `user_interaction_mode` is set to \"ALWAYS\", the `UserProxyAgent` will always prompt the user for feedback. When user feedback is provided, the `UserProxyAgent` will directly pass the feedback to `PythonAgent` without doing any additional steps. When no user feedback is provided, the `UserProxyAgent` will execute the code written by `PythonAgent` directly and returns the execution results (success or failure and corresponding outputs) to `PythonAgent`.\n",
"In this notebook, we demonstrate how to use `PythonAgent` and `UserProxyAgent` to write code and execute the code. Here `PythonAgent` is an LLM-based agent that can write Python code (in a Python coding block) for a user to execute for a given task. `UserProxyAgent` is an agent which serves as a proxy for a user to execute the code written by `PythonAgent`. By setting `user_interaction_mode` properly, the `UserProxyAgent` can also prompt the user for feedback to `PythonAgent`. For example, when `user_interaction_mode` is set to \"ALWAYS\", the `UserProxyAgent` will always prompt the user for feedback. When user feedback is provided, the `UserProxyAgent` will directly pass the feedback to `PythonAgent` without doing any additional steps. When no user feedback is provided, the `UserProxyAgent` will execute the code written by `PythonAgent` directly and return the execution results (success or failure and corresponding outputs) to `PythonAgent`.\n",

@@ -380,6 +380,8 @@ The compact history is more efficient and the individual API call history contai

[`flaml.autogen.agents`](../reference/autogen/agent/agent) contains an experimental implementation of interactive agents which can adapt to human or simulated feedback. This subpackage is under active development.

Find a notebook example on how to [use agents in FLAML to solve coding tasks](https://github.com/microsoft/FLAML/blob/main/notebook/autogen_agent.ipynb).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solve coding tasks -> perform tasks with code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also change the text and format to match other links

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have another PR updating this documentation. Can I change this in the other PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should I add notebook links in #1056 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed based on my understanding of "match other links."

notebook/autogen_agent.ipynb Outdated Show resolved Hide resolved
@qingyun-wu qingyun-wu added this pull request to the merge queue May 28, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 28, 2023
@qingyun-wu qingyun-wu added this pull request to the merge queue May 28, 2023
Merged via the queue into main with commit fed28e7 May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants