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

Improve readability of notebooks #2200

Merged
merged 7 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 2 additions & 4 deletions autogen/agentchat/contrib/capabilities/context_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ class TransformChatHistory:
This capability class enables various strategies to transform chat history, such as:
- Truncate messages: Truncate each message to first maximum number of tokens.
- Limit number of messages: Truncate the chat history to a maximum number of (recent) messages.
- Limit number of tokens: Truncate the chat history to number of recent N messages that fit in
maximum number of tokens.
sonichi marked this conversation as resolved.
Show resolved Hide resolved
- Limit number of tokens: Truncate the chat history to number of recent N messages that fit in maximum number of tokens.
Note that the system message, because of its special significance, is always kept as is.

The three strategies can be combined. For example, when each of these parameters are specified
they are used in the following order:
The three strategies can be combined. For example, when each of these parameters are specified they are used in the following order:
1. First truncate messages to a maximum number of tokens
2. Second, it limits the number of message to keep
3. Third, it limits the total number of tokens in the chat history
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_agentoptimizer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"source": [
"# MathUserProxy with function_call\n",
"\n",
"This agent is a customozied MathUserProxy inherits from its [partent class](https://github.com/microsoft/autogen/blob/main/autogen/agentchat/contrib/math_user_proxy_agent.py.).\n",
"This agent is a customized MathUserProxy inherits from its [partent class](https://github.com/microsoft/autogen/blob/main/autogen/agentchat/contrib/math_user_proxy_agent.py).\n",
"\n",
"It supports using both function_call and python to solve math problems.\n"
]
Expand Down Expand Up @@ -265,7 +265,7 @@
"\n",
"MATAH dataset contains 12,500 challenging competition mathematics problems. Each problem in MATH has a full step-by-step solution which can be used to teach models to generate answer derivations and explanations. \n",
"\n",
"We strctly follow the [train](https://github.com/lifan-yuan/CRAFT/blob/main/tab_and_math/MATH/dataset/train/algebra.jsonl)/[test](https://github.com/lifan-yuan/CRAFT/blob/main/tab_and_math/MATH/dataset/algebra.jsonl) splits of [Craft](https://github.com/lifan-yuan/CRAFT). Please specific your own path to the dataset. Here we sample the first 10 algebra problems as examples. "
"We strictly follow the [train](https://github.com/lifan-yuan/CRAFT/blob/main/tab_and_math/MATH/dataset/train/algebra.jsonl)/[test](https://github.com/lifan-yuan/CRAFT/blob/main/tab_and_math/MATH/dataset/algebra.jsonl) splits of [Craft](https://github.com/lifan-yuan/CRAFT). Please specific your own path to the dataset. Here we sample the first 10 algebra problems as examples. "
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebook/agentchat_groupchat_finite_state_machine.ipynb
sonichi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"## Motivation\n",
"\n",
"\n",
"The current GroupChat class allows transition to any agent (without or without the decision of LLM), some use case might demand for more control over transition. A graph is a possible way to control the transition paths, where each node represents an agent and each directed edge represent possible transition path. Let's illustrate the current transition paths for a GroupChat with five agents."
"The current GroupChat class allows the transition to any agent (with or without the decision of the LLM), some use cases might demand for more control over transition. A graph is a possible way to control the transition paths, where each node represents an agent and each directed edge represents possible transition paths. Let's illustrate the current transition paths for a GroupChat with five agents."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebook/agentchat_surfer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"metadata": {},
"source": [
"### Example 1: Search, summarize\n",
"- Search for information aobut Microsoft AutoGen\n",
"- Search for information about Microsoft AutoGen\n",
"- Summarize the results\n",
"- Visit the Getting Started Docs page"
]
Expand Down
Loading