Skip to content

A programming framework for agentic AI

Fix/typo (#1034)

KazooTTTa122ffe5413a
diff --git a/autogen/agentchat/assistant_agent.py b/autogen/agentchat/assistant_agent.py
index ce7836da1..ffb2e598d 100644
--- a/autogen/agentchat/assistant_agent.py
+++ b/autogen/agentchat/assistant_agent.py
@@ -70,7 +70,7 @@ Reply "TERMINATE" in the end when everything is done.
**kwargs,
)
- # Update the provided desciption if None, and we are using the default system_message,
+ # Update the provided description if None, and we are using the default system_message,
# then use the default description.
if description is None:
if system_message == self.DEFAULT_SYSTEM_MESSAGE:
diff --git a/autogen/agentchat/contrib/compressible_agent.py b/autogen/agentchat/contrib/compressible_agent.py
index dc8c80a01..72f31b6f3 100644
--- a/autogen/agentchat/contrib/compressible_agent.py
+++ b/autogen/agentchat/contrib/compressible_agent.py
@@ -225,7 +225,7 @@ Reply "TERMINATE" in the end when everything is done.
# 1. mode = "TERMINATE", terminate the agent if no token left.
if self.compress_config["mode"] == "TERMINATE":
if max_token_allowed - token_used <= 0:
- # Teminate if no token left.
+ # Terminate if no token left.
print(
colored(
f'Warning: Terminate Agent "{self.name}" due to no token left for oai reply. max token for {model}: {max_token_allowed}, existing token count: {token_used}',
@@ -320,7 +320,7 @@ Reply "TERMINATE" in the end when everything is done.
cmsg["role"] = "user"
sender._oai_messages[self][i] = cmsg
- # sucessfully compressed, return False, None for generate_oai_reply to be called with the updated messages
+ # successfully compressed, return False, None for generate_oai_reply to be called with the updated messages
return False, None
return final, None
@@ -332,7 +332,7 @@ Reply "TERMINATE" in the end when everything is done.
"""Compress a list of messages into one message.
The first message (the initial prompt) will not be compressed.
- The rest of the messages will be compressed into one message, the model is asked to distinuish the role of each message: USER, ASSISTANT, FUNCTION_CALL, FUNCTION_RETURN.
+ The rest of the messages will be compressed into one message, the model is asked to distinguish the role of each message: USER, ASSISTANT, FUNCTION_CALL, FUNCTION_RETURN.
Check out the compress_sys_msg.
TODO: model used in compression agent is different from assistant agent: For example, if original model used by is gpt-4; we start compressing at 70% of usage, 70% of 8092 = 5664; and we use gpt 3.5 here max_toke = 4096, it will raise error. choosinng model automatically?
diff --git a/autogen/agentchat/contrib/gpt_assistant_agent.py b/autogen/agentchat/contrib/gpt_assistant_agent.py
index 2fd431e99..351d94cf1 100644
--- a/autogen/agentchat/contrib/gpt_assistant_agent.py
+++ b/autogen/agentchat/contrib/gpt_assistant_agent.py
@@ -203,7 +203,7 @@ class GPTAssistantAgent(ConversableAgent):
new_messages.append(
{
"role": msg.role,
- "content": f"Recieved file id={content.image_file.file_id}",
+ "content": f"Received file id={content.image_file.file_id}",
}
)
return new_messages
@@ -219,7 +219,7 @@ class GPTAssistantAgent(ConversableAgent):
}
logger.info(
- "Intermediate executing(%s, Sucess: %s) : %s",
+ "Intermediate executing(%s, Success: %s) : %s",
tool_response["name"],
is_exec_success,
tool_response["content"],
diff --git a/autogen/agentchat/contrib/img_utils.py b/autogen/agentchat/contrib/img_utils.py
index a8e1a9687..4fc08f8f3 100644
--- a/autogen/agentchat/contrib/img_utils.py
+++ b/autogen/agentchat/contrib/img_utils.py
@@ -26,7 +26,7 @@ def get_image_data(image_file: str, use_b64=True) -> bytes:
return content
-def llava_formater(prompt: str, order_image_tokens: bool = False) -> Tuple[str, List[str]]:
+def llava_formatter(prompt: str, order_image_tokens: bool = False) -> Tuple[str, List[str]]:
"""
Formats the input prompt by replacing image tags and returns the new prompt along with image locations.
diff --git a/autogen/agentchat/contrib/llava_agent.py b/autogen/agentchat/contrib/llava_agent.py
index 641c5fa06..65c39fd1e 100644
--- a/autogen/agentchat/contrib/llava_agent.py
+++ b/autogen/agentchat/contrib/llava_agent.py
@@ -10,7 +10,7 @@ import requests
from regex import R
from autogen.agentchat.agent import Agent
-from autogen.agentchat.contrib.img_utils import get_image_data, llava_formater
+from autogen.agentchat.contrib.img_utils import get_image_data, llava_formatter
from autogen.agentchat.contrib.multimodal_conversable_agent import MultimodalConversableAgent
from autogen.code_utils import content_str
@@ -162,7 +162,7 @@ def llava_call(prompt: str, llm_config: dict) -> str:
Makes a call to the LLaVA service to generate text based on a given prompt
"""
- prompt, images = llava_formater(prompt, order_image_tokens=False)
+ prompt, images = llava_formatter(prompt, order_image_tokens=False)
for im in images:
if len(im) == 0:
diff --git a/autogen/agentchat/conversable_agent.py b/autogen/agentchat/conversable_agent.py
index 493a83da8..ba91ae5b3 100644
--- a/autogen/agentchat/conversable_agent.py
+++ b/autogen/agentchat/conversable_agent.py
@@ -676,7 +676,7 @@ class ConversableAgent(Agent):
else:
messages_to_scan += 1
- # iterate through the last n messages reversly
+ # iterate through the last n messages reversely
# if code blocks are found, execute the code blocks and return the output
# if no code blocks are found, continue
for i in range(min(len(messages), messages_to_scan)):
@@ -1292,7 +1292,7 @@ class ConversableAgent(Agent):
Args:
func_sig (str or dict): description/name of the function to update/remove to the model. See: https://platform.openai.com/docs/api-reference/chat/create#chat/create-functions
- is_remove: whether removing the funciton from llm_config with name 'func_sig'
+ is_remove: whether removing the function from llm_config with name 'func_sig'
"""
if not self.llm_config:
diff --git a/autogen/oai/client.py b/autogen/oai/client.py
index 14abb63ad..a0f713b83 100644
--- a/autogen/oai/client.py
+++ b/autogen/oai/client.py
@@ -136,7 +136,7 @@ class OpenAIWrapper:
return create_config, extra_kwargs
def _client(self, config, openai_config):
- """Create a client with the given config to overrdie openai_config,
+ """Create a client with the given config to override openai_config,
after removing extra kwargs.
"""
openai_config = {**openai_config, **{k: v for k, v in config.items() if k in self.openai_kwargs}}
@@ -244,7 +244,7 @@ class OpenAIWrapper:
try:
response.cost
except AttributeError:
- # update atrribute if cost is not calculated
+ # update attribute if cost is not calculated
response.cost = self.cost(response)
cache.set(key, response)
self._update_usage_summary(response, use_cache=True)
@@ -349,7 +349,7 @@ class OpenAIWrapper:
def _update_usage_summary(self, response: ChatCompletion | Completion, use_cache: bool) -> None:
"""Update the usage summary.
- Usage is calculated no mattter filter is passed or not.
+ Usage is calculated no matter filter is passed or not.
"""
def update_usage(usage_summary):
diff --git a/autogen/oai/completion.py b/autogen/oai/completion.py
index ec99c9f24..e1eeb5302 100644
--- a/autogen/oai/completion.py
+++ b/autogen/oai/completion.py
@@ -430,7 +430,7 @@ class Completion(openai_Completion):
if previous_num_completions:
n_tokens_list[i] += n_output_tokens
responses_list[i].extend(responses)
- # Assumption 1: assuming requesting n1, n2 responses separatively then combining them
+ # Assumption 1: assuming requesting n1, n2 responses separately then combining them
# is the same as requesting (n1+n2) responses together
else:
n_tokens_list.append(n_output_tokens)
diff --git a/samples/apps/autogen-assistant/README.md b/samples/apps/autogen-assistant/README.md
index ab2dbbfbb..d0f722b4b 100644
--- a/samples/apps/autogen-assistant/README.md
+++ b/samples/apps/autogen-assistant/README.md
@@ -77,7 +77,7 @@ Now that you have AutoGen Assistant installed and running, you are ready to expl
This demo focuses on the research assistant use case with some generalizations:
-- **Skills**: The agent is provided with a list of skills that it can leverage while attempting to address a user's query. Each skill is a python function that may be in any file in a folder made availabe to the agents. We separate the concept of global skills available to all agents `backend/files/global_utlis_dir` and user level skills `backend/files/user/<user_hash>/utils_dir`, relevant in a multi user environment. Agents are aware skills as they are appended to the system message. A list of example skills is available in the `backend/global_utlis_dir` folder. Modify the file or create a new file with a function in the same directory to create new global skills.
+- **Skills**: The agent is provided with a list of skills that it can leverage while attempting to address a user's query. Each skill is a python function that may be in any file in a folder made available to the agents. We separate the concept of global skills available to all agents `backend/files/global_utlis_dir` and user level skills `backend/files/user/<user_hash>/utils_dir`, relevant in a multi user environment. Agents are aware skills as they are appended to the system message. A list of example skills is available in the `backend/global_utlis_dir` folder. Modify the file or create a new file with a function in the same directory to create new global skills.
- **Conversation Persistence**: Conversation history is persisted in an sqlite database `database.sqlite`.
diff --git a/samples/apps/autogen-assistant/autogenra/utils/utils.py b/samples/apps/autogen-assistant/autogenra/utils/utils.py
index 6e47ac979..fa52d6aea 100644
--- a/samples/apps/autogen-assistant/autogenra/utils/utils.py
+++ b/samples/apps/autogen-assistant/autogenra/utils/utils.py
@@ -250,7 +250,7 @@ def get_all_skills(user_skills_path: str, global_skills_path: str, dest_dir: str
}
if dest_dir:
- # chcek if dest_dir exists
+ # check if dest_dir exists
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
# copy all skills to dest_dir
diff --git a/samples/apps/autogen-assistant/frontend/src/components/header.tsx b/samples/apps/autogen-assistant/frontend/src/components/header.tsx
index 67ac6e9b4..85c966ea3 100644
--- a/samples/apps/autogen-assistant/frontend/src/components/header.tsx
+++ b/samples/apps/autogen-assistant/frontend/src/components/header.tsx
@@ -94,7 +94,7 @@ const Header = ({ meta, link }: any) => {
return (
<div
key={index + "linkrow"}
- className={`text-primary items-center hover:text-accent hovder:bg-secondary px-1 pt-1 block text-sm font-medium `}
+ className={`text-primary items-center hover:text-accent hover:bg-secondary px-1 pt-1 block text-sm font-medium `}
>
<Link
className="hover:text-accent h-full flex flex-col"
diff --git a/samples/apps/autogen-assistant/frontend/src/components/utils.ts b/samples/apps/autogen-assistant/frontend/src/components/utils.ts
index f1977f66b..bf75b6165 100644
--- a/samples/apps/autogen-assistant/frontend/src/components/utils.ts
+++ b/samples/apps/autogen-assistant/frontend/src/components/utils.ts
@@ -169,7 +169,7 @@ export const ColorTween = (
endColor: string,
percent: number
) => {
- // exaple startColor = "#ff0000" endColor = "#0000ff" percent = 0.5
+ // example startColor = "#ff0000" endColor = "#0000ff" percent = 0.5
const start = {
r: parseInt(startColor.substring(1, 3), 16),
g: parseInt(startColor.substring(3, 5), 16),
diff --git a/samples/apps/autogen-assistant/frontend/src/components/views/gallery/gallery.tsx b/samples/apps/autogen-assistant/frontend/src/components/views/gallery/gallery.tsx
index 91077b491..c97e2df7d 100644
--- a/samples/apps/autogen-assistant/frontend/src/components/views/gallery/gallery.tsx
+++ b/samples/apps/autogen-assistant/frontend/src/components/views/gallery/gallery.tsx
@@ -129,7 +129,7 @@ const GalleryView = ({ location }: any) => {
</div>
<div className="text-xs">
{" "}
- {item.messages.length} messsage{item.messages.length > 1 && "s"}
+ {item.messages.length} message{item.messages.length > 1 && "s"}
</div>
<div className="my-2 border-t border-dashed w-full pt-2 inline-flex gap-2 ">
<TagsView tags={item.tags} />{" "}
diff --git a/samples/tools/testbed/README.md b/samples/tools/testbed/README.md
index 76560b1c6..46325da86 100644
--- a/samples/tools/testbed/README.md
+++ b/samples/tools/testbed/README.md
@@ -6,7 +6,7 @@ This Testbed sample has been tested in, and is known to work with, Autogen versi
## Setup
-Before you begin, you must configure your API keys for use with the Testbed. As with other Autogen applications, the Testbed will look for the OpenAI keys in a file in the current working directy, or environment variable named, OAI_CONFIG_LIST. This can be overrriden using a command-line parameter described later.
+Before you begin, you must configure your API keys for use with the Testbed. As with other Autogen applications, the Testbed will look for the OpenAI keys in a file in the current working directory, or environment variable named, OAI_CONFIG_LIST. This can be overridden using a command-line parameter described later.
For some scenarios, additional keys may be required (e.g., keys for the Bing Search API). These can be added to an `ENV` file in the `includes` folder. A sample has been provided in ``includes/ENV.example``. Edit ``includes/ENV`` as needed.
@@ -56,7 +56,7 @@ options:
## Results
-By default, the Testbed stores results in a folder heirarchy with the following template:
+By default, the Testbed stores results in a folder hierarchy with the following template:
``./results/[scenario]/[instance_id]/[repetition]``
diff --git a/samples/tools/testbed/run_scenarios.py b/samples/tools/testbed/run_scenarios.py
index 059d97345..88547bab8 100644
--- a/samples/tools/testbed/run_scenarios.py
+++ b/samples/tools/testbed/run_scenarios.py
@@ -119,7 +119,7 @@ def expand_scenario(scenario_dir, scenario, output_dir):
template = scenario["template"]
- # Either key works for finding the substiturions list. "values" may be deprecated in the future
+ # Either key works for finding the substitutions list. "values" may be deprecated in the future
substitutions = scenario["substitutions"] if "substitutions" in scenario else scenario["values"]
# Older versions are only one-level deep. Convert them,
@@ -159,7 +159,7 @@ def expand_scenario(scenario_dir, scenario, output_dir):
# If the destination is a directory, use the same filename
shutil.copyfile(src_path, os.path.join(dest_path, os.path.basename(src_path)))
else:
- # Otherwuse use the filename provided
+ # Otherwise use the filename provided
shutil.copyfile(src_path, dest_path)
# Expand templated files
@@ -184,7 +184,7 @@ def run_scenario_natively(work_dir):
Run a scenario in the native environment.
Args:
- work_dir (path): the path to the working directory previously created to house this sceario instance
+ work_dir (path): the path to the working directory previously created to house this scenario instance
"""
# Get the current working directory
@@ -253,7 +253,7 @@ def run_scenario_in_docker(work_dir, requirements, timeout=600, docker_image=Non
Run a scenario in a Docker environment.
Args:
- work_dir (path): the path to the working directory previously created to house this sceario instance
+ work_dir (path): the path to the working directory previously created to house this scenario instance
timeout (Optional, int): the number of seconds to allow a Docker container to run before timing out
"""
@@ -462,7 +462,7 @@ if __name__ == "__main__":
if not os.path.isfile(req_file):
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), req_file)
- # Warn aboit a common error
+ # Warn about a common error
env_file = os.path.join(GLOBAL_INCLUDES_DIR, "ENV")
example_file = os.path.join(GLOBAL_INCLUDES_DIR, "ENV.example")
if not os.path.isfile(env_file):
diff --git a/samples/tools/testbed/scenarios/AutoGPT/Templates/TwoAgents/scenario.py b/samples/tools/testbed/scenarios/AutoGPT/Templates/TwoAgents/scenario.py
index e43b8f05d..1b71eb783 100644
--- a/samples/tools/testbed/scenarios/AutoGPT/Templates/TwoAgents/scenario.py
+++ b/samples/tools/testbed/scenarios/AutoGPT/Templates/TwoAgents/scenario.py
@@ -5,7 +5,7 @@ import testbed_utils
testbed_utils.init()
work_dir = "coding"
-target_folder = "__TARGET_FOLDER__" # path to the arifact folder
+target_folder = "__TARGET_FOLDER__" # path to the artifact folder
config_list = config_list_from_json("OAI_CONFIG_LIST", filter_dict={"model": ["__MODEL__"]})
diff --git a/samples/tools/testbed/scenarios/AutoGPT/challenges/3_qa_small_csv/data.json b/samples/tools/testbed/scenarios/AutoGPT/challenges/3_qa_small_csv/data.json
index 639f7946a..f73329880 100644
--- a/samples/tools/testbed/scenarios/AutoGPT/challenges/3_qa_small_csv/data.json
+++ b/samples/tools/testbed/scenarios/AutoGPT/challenges/3_qa_small_csv/data.json
@@ -28,5 +28,5 @@
]
},
"name": "AnswerQuestionSmallCsv",
- "task": "Read and analyze 'file1.csv', then answer the quetion: How much was spent on utilities in total? Write the answer in file 'output.txt'."
+ "task": "Read and analyze 'file1.csv', then answer the question: How much was spent on utilities in total? Write the answer in file 'output.txt'."
}
diff --git a/samples/tools/testbed/scenarios/MATH/problems_to_json.py b/samples/tools/testbed/scenarios/MATH/problems_to_json.py
index 436217a8c..4dd9dba0d 100644
--- a/samples/tools/testbed/scenarios/MATH/problems_to_json.py
+++ b/samples/tools/testbed/scenarios/MATH/problems_to_json.py
@@ -46,7 +46,7 @@ def problem_to_json():
with open("problems.jsonl", "w") as f:
for i, problem in enumerate(problems):
# a = {
- # 'id': f'problem{i}',
+ # 'id': problem{i}',
# 'template': 'scenario.py',
# 'substitutions': {
# '__PROMPT__': problem,
diff --git a/samples/tools/testbed/utils/collate_autogpt.py b/samples/tools/testbed/utils/collate_autogpt.py
index ddde5b793..3dc8bcdba 100644
--- a/samples/tools/testbed/utils/collate_autogpt.py
+++ b/samples/tools/testbed/utils/collate_autogpt.py
@@ -93,7 +93,7 @@ Test_2, x_20, x_21, ..., X_2N
Test_M, x_M0, x_M1, ..., X_MN
-Where x_ij is the number of AsssitantAgent conversation turns needed to pass all the tests for problem i, in Trial/repetition j. If the agent was not able to pass the tests by the end of the conversation, the value will be -1. If data for the trial is missing, the value will be an empty string "".
+Where x_ij is the number of AssistantAgent conversation turns needed to pass all the tests for problem i, in Trial/repetition j. If the agent was not able to pass the tests by the end of the conversation, the value will be -1. If data for the trial is missing, the value will be an empty string "".
""".strip(),
formatter_class=argparse.RawTextHelpFormatter,
)
diff --git a/samples/tools/testbed/utils/collate_gaia_csv.py b/samples/tools/testbed/utils/collate_gaia_csv.py
index ff8e1376f..88f1ec819 100644
--- a/samples/tools/testbed/utils/collate_gaia_csv.py
+++ b/samples/tools/testbed/utils/collate_gaia_csv.py
@@ -27,7 +27,7 @@ def collate(results_dir):
for test_id in os.listdir(results_dir):
test_path = os.path.join(results_dir, test_id)
- # Collect the reslts vector
+ # Collect the results vector
results = [test_id]
instance = 0
@@ -35,7 +35,7 @@ def collate(results_dir):
while os.path.isdir(instance_dir):
expected_answer_file = os.path.join(instance_dir, "expected_answer.txt")
if not os.path.isfile(expected_answer_file):
- # Expected ansewr is missing
+ # Expected answer is missing
results.append("")
instance += 1
diff --git a/samples/tools/testbed/utils/collate_gaia_jsonl.py b/samples/tools/testbed/utils/collate_gaia_jsonl.py
index 3ab88c287..6a4ac07ca 100644
--- a/samples/tools/testbed/utils/collate_gaia_jsonl.py
+++ b/samples/tools/testbed/utils/collate_gaia_jsonl.py
@@ -15,10 +15,10 @@ def normalize_answer(a):
def collate(results_dir, instance=0):
"""
- Collate the results of running GAIA. Print the results in the format acceped by the leaderboard.
+ Collate the results of running GAIA. Print the results in the format accepted by the leaderboard.
Args:
- results_dir (path): The folder were results were be saved.
+ results_dir (path): The folder where results were be saved.
"""
for test_id in os.listdir(results_dir):
@@ -61,7 +61,7 @@ if __name__ == "__main__":
description=f"""
{script_name} will collate the results of the GAIA scenarios into the jsonl format that can be submit to the GAIA leaderboard.
-NOTE: You will likely need to concatenate resuls for level 1, level 2 and level 3 to form a complete submission.
+NOTE: You will likely need to concatenate results for level 1, level 2 and level 3 to form a complete submission.
""".strip(),
formatter_class=argparse.RawTextHelpFormatter,
)
diff --git a/samples/tools/testbed/utils/collate_human_eval.py b/samples/tools/testbed/utils/collate_human_eval.py
index 594051dc2..e46c83f84 100644
--- a/samples/tools/testbed/utils/collate_human_eval.py
+++ b/samples/tools/testbed/utils/collate_human_eval.py
@@ -83,7 +83,7 @@ HumanEval_2, x_20, x_21, ..., X_2N
HumanEval_M, x_M0, x_M1, ..., X_MN
-Where x_ij is the number of AsssitantAgent conversation turns needed to pass all the tests for problem i, in Trial/repetition j. If the agent was not able to pass the tests by the end of the conversation, the value will be -1. If data for the trial is missing, the value will be an empty string "".
+Where x_ij is the number of AssistantAgent conversation turns needed to pass all the tests for problem i, in Trial/repetition j. If the agent was not able to pass the tests by the end of the conversation, the value will be -1. If data for the trial is missing, the value will be an empty string "".
""".strip(),
formatter_class=argparse.RawTextHelpFormatter,
)
diff --git a/test/agentchat/contrib/test_compressible_agent.py b/test/agentchat/contrib/test_compressible_agent.py
index 06a1ba614..089db650e 100644
--- a/test/agentchat/contrib/test_compressible_agent.py
+++ b/test/agentchat/contrib/test_compressible_agent.py
@@ -138,7 +138,7 @@ def test_mode_customized():
sys.platform in ["darwin", "win32"] or not OPENAI_INSTALLED,
reason="do not run on MacOS or windows or dependency is not installed",
)
-def test_compress_messsage():
+def test_compress_message():
assistant = CompressibleAgent(
name="assistant",
llm_config={
@@ -202,5 +202,5 @@ def test_mode_terminate():
if __name__ == "__main__":
test_mode_compress()
test_mode_customized()
- test_compress_messsage()
+ test_compress_message()
test_mode_terminate()
diff --git a/test/agentchat/contrib/test_gpt_assistant.py b/test/agentchat/contrib/test_gpt_assistant.py
index fae85bbf3..f04a7bef0 100644
--- a/test/agentchat/contrib/test_gpt_assistant.py
+++ b/test/agentchat/contrib/test_gpt_assistant.py
@@ -42,7 +42,7 @@ def test_gpt_assistant_chat():
},
"required": ["question"],
},
- "description": "This is an API endpoint allowing users (analysts) to input question about GitHub in text format to retrieve the realted and structured data.",
+ "description": "This is an API endpoint allowing users (analysts) to input question about GitHub in text format to retrieve the related and structured data.",
}
name = "For test_gpt_assistant_chat"
@@ -202,13 +202,13 @@ def test_get_assistant_files():
)
files = assistant.openai_client.beta.assistants.files.list(assistant_id=assistant.assistant_id)
- retrived_file_ids = [fild.id for fild in files]
+ retrieved_file_ids = [fild.id for fild in files]
expected_file_id = file.id
assistant.delete_assistant()
openai_client.files.delete(file.id)
- assert expected_file_id in retrived_file_ids
+ assert expected_file_id in retrieved_file_ids
@pytest.mark.skipif(
diff --git a/test/agentchat/contrib/test_img_utils.py b/test/agentchat/contrib/test_img_utils.py
index 3081c5d55..9c38153f6 100644
--- a/test/agentchat/contrib/test_img_utils.py
+++ b/test/agentchat/contrib/test_img_utils.py
@@ -10,7 +10,7 @@ import requests
try:
from PIL import Image
- from autogen.agentchat.contrib.img_utils import extract_img_paths, get_image_data, gpt4v_formatter, llava_formater
+ from autogen.agentchat.contrib.img_utils import extract_img_paths, get_image_data, gpt4v_formatter, llava_formatter
except ImportError:
skip = True
else:
@@ -64,37 +64,37 @@ class TestGetImageData(unittest.TestCase):
class TestLlavaFormater(unittest.TestCase):
def test_no_images(self):
"""
- Test the llava_formater function with a prompt containing no images.
+ Test the llava_formatter function with a prompt containing no images.
"""
prompt = "This is a test."
expected_output = (prompt, [])
- result = llava_formater(prompt)
+ result = llava_formatter(prompt)
self.assertEqual(result, expected_output)
@patch("autogen.agentchat.contrib.img_utils.get_image_data")
def test_with_images(self, mock_get_image_data):
"""
- Test the llava_formater function with a prompt containing images.
+ Test the llava_formatter function with a prompt containing images.
"""
# Mock the get_image_data function to return a fixed string.
mock_get_image_data.return_value = raw_encoded_image
prompt = "This is a test with an image <img http://example.com/image.png>."
expected_output = ("This is a test with an image <image>.", [raw_encoded_image])
- result = llava_formater(prompt)
+ result = llava_formatter(prompt)
self.assertEqual(result, expected_output)
@patch("autogen.agentchat.contrib.img_utils.get_image_data")
def test_with_ordered_images(self, mock_get_image_data):
"""
- Test the llava_formater function with ordered image tokens.
+ Test the llava_formatter function with ordered image tokens.
"""
# Mock the get_image_data function to return a fixed string.
mock_get_image_data.return_value = raw_encoded_image
prompt = "This is a test with an image <img http://example.com/image.png>."
expected_output = ("This is a test with an image <image 0>.", [raw_encoded_image])
- result = llava_formater(prompt, order_image_tokens=True)
+ result = llava_formatter(prompt, order_image_tokens=True)
self.assertEqual(result, expected_output)
diff --git a/test/agentchat/contrib/test_llava.py b/test/agentchat/contrib/test_llava.py
index 570791a70..5ae5e4abb 100644
--- a/test/agentchat/contrib/test_llava.py
+++ b/test/agentchat/contrib/test_llava.py
@@ -94,11 +94,11 @@ class TestLLavaCallBinaryWithConfig(unittest.TestCase):
@pytest.mark.skipif(skip, reason="dependency is not installed")
class TestLLavaCall(unittest.TestCase):
- @patch("autogen.agentchat.contrib.llava_agent.llava_formater")
+ @patch("autogen.agentchat.contrib.llava_agent.llava_formatter")
@patch("autogen.agentchat.contrib.llava_agent.llava_call_binary")
- def test_llava_call(self, mock_llava_call_binary, mock_llava_formater):
+ def test_llava_call(self, mock_llava_call_binary, mock_llava_formatter):
# Set up the mocks
- mock_llava_formater.return_value = ("formatted prompt", ["image1", "image2"])
+ mock_llava_formatter.return_value = ("formatted prompt", ["image1", "image2"])
mock_llava_call_binary.return_value = "Generated Text"
# Set up the llm_config dictionary
@@ -113,7 +113,7 @@ class TestLLavaCall(unittest.TestCase):
result = llava_call("Test Prompt", llm_config)
# Check the results
- mock_llava_formater.assert_called_once_with("Test Prompt", order_image_tokens=False)
+ mock_llava_formatter.assert_called_once_with("Test Prompt", order_image_tokens=False)
mock_llava_call_binary.assert_called_once_with(
"formatted prompt",
["image1", "image2"],
diff --git a/test/agentchat/test_conversable_agent.py b/test/agentchat/test_conversable_agent.py
index 839a598b2..3b468e627 100644
--- a/test/agentchat/test_conversable_agent.py
+++ b/test/agentchat/test_conversable_agent.py
@@ -305,16 +305,16 @@ def test_generate_reply():
dummy_agent_2 = ConversableAgent(
name="user_proxy", llm_config=False, human_input_mode="TERMINATE", function_map={"add_num": add_num}
)
- messsages = [{"function_call": {"name": "add_num", "arguments": '{ "num_to_be_added": 5 }'}, "role": "assistant"}]
+ messages = [{"function_call": {"name": "add_num", "arguments": '{ "num_to_be_added": 5 }'}, "role": "assistant"}]
# when sender is None, messages is provided
assert (
- dummy_agent_2.generate_reply(messages=messsages, sender=None)["content"] == "15"
+ dummy_agent_2.generate_reply(messages=messages, sender=None)["content"] == "15"
), "generate_reply not working when sender is None"
# when sender is provided, messages is None
dummy_agent_1 = ConversableAgent(name="dummy_agent_1", llm_config=False, human_input_mode="ALWAYS")
- dummy_agent_2._oai_messages[dummy_agent_1] = messsages
+ dummy_agent_2._oai_messages[dummy_agent_1] = messages
assert (
dummy_agent_2.generate_reply(messages=None, sender=dummy_agent_1)["content"] == "15"
), "generate_reply not working when messages is None"
diff --git a/test/agentchat/test_math_user_proxy_agent.py b/test/agentchat/test_math_user_proxy_agent.py
index 565aa80eb..bb825ddfb 100644
--- a/test/agentchat/test_math_user_proxy_agent.py
+++ b/test/agentchat/test_math_user_proxy_agent.py
@@ -61,7 +61,7 @@ def test_add_remove_print():
assert _add_print_to_last_line(code) == "a = 4\nb = 5\nprint(a,b)"
# test remove print
- code = """print("hello")\na = 4*5\nprint("wolrld")"""
+ code = """print("hello")\na = 4*5\nprint("world")"""
assert _remove_print(code) == "a = 4*5"
# test remove print. Only remove prints without indentation
@@ -107,7 +107,7 @@ def test_execute_one_wolfram_query():
try:
mathproxyagent.execute_one_wolfram_query(code)[0]
except ValueError:
- print("Wolfrma API key not found. Skip test.")
+ print("Wolfram API key not found. Skip test.")
def test_generate_prompt():
diff --git a/test/test_token_count.py b/test/test_token_count.py
index 8fe6e3666..444611db0 100644
--- a/test/test_token_count.py
+++ b/test/test_token_count.py
@@ -23,7 +23,7 @@ func1 = {
}
func2 = {
"name": "query_wolfram",
- "description": "Return the API query result from the Wolfram Alpha. the ruturn is a tuple of (result, is_success).",
+ "description": "Return the API query result from the Wolfram Alpha. the return is a tuple of (result, is_success).",
"parameters": {
"type": "object",
"properties": {},
@@ -46,7 +46,7 @@ func3 = {
@pytest.mark.parametrize(
- "input_functions, expected_count", [([func1], 44), ([func2], 47), ([func3], 45), ([func1, func2], 79)]
+ "input_functions, expected_count", [([func1], 44), ([func2], 46), ([func3], 45), ([func1, func2], 78)]
)
def test_num_tokens_from_functions(input_functions, expected_count):
assert num_tokens_from_functions(input_functions) == expected_count
diff --git a/website/blog/2023-11-09-EcoAssistant/index.mdx b/website/blog/2023-11-09-EcoAssistant/index.mdx
index d687774f0..24b53ae6d 100644
--- a/website/blog/2023-11-09-EcoAssistant/index.mdx
+++ b/website/blog/2023-11-09-EcoAssistant/index.mdx
@@ -9,7 +9,7 @@ tags: [LLM, RAG, cost-effectiveness]
**TL;DR:**
* Introducing the **EcoAssistant**, which is designed to solve user queries more accurately and affordably.
* We show how to let the LLM assistant agent leverage external API to solve user query.
-* We show how to reduce the cost of using GPT models via **Assistant Hierachy**.
+* We show how to reduce the cost of using GPT models via **Assistant Hierarchy**.
* We show how to leverage the idea of Retrieval-augmented Generation (RAG) to improve the success rate via **Solution Demonstration**.
diff --git a/website/blog/2023-11-13-OAI-assistants/index.mdx b/website/blog/2023-11-13-OAI-assistants/index.mdx
index 91c941181..13b5383d0 100644
--- a/website/blog/2023-11-13-OAI-assistants/index.mdx
+++ b/website/blog/2023-11-13-OAI-assistants/index.mdx
@@ -67,7 +67,7 @@ user_proxy = UserProxyAgent(name="user_proxy",
user_proxy.initiate_chat(gpt_assistant, message="Print hello world")
```
-`GPTAssistantAgent` supports both creating new OpenAI assistants or reusing existsing assistants
+`GPTAssistantAgent` supports both creating new OpenAI assistants or reusing existing assistants
(e.g, by providing an `assistant_id`).
diff --git a/website/blog/2023-11-20-AgentEval/index.mdx b/website/blog/2023-11-20-AgentEval/index.mdx
index 97d0b010a..070d431b1 100644
--- a/website/blog/2023-11-20-AgentEval/index.mdx
+++ b/website/blog/2023-11-20-AgentEval/index.mdx
@@ -34,7 +34,7 @@ Let's first look into an overview of the suggested task taxonomy that a multi-ag
* _The optimal solution exits_ - these are tasks where only one solution is possible. For example, if you ask your assistant to turn on the light, the success of this task is clearly defined, and there is only one way to accomplish it.
* _Multiple solutions exist_ - increasingly, we observe situations where multiple trajectories of agent behavior can lead to either success or failure. In such cases, it is crucial to differentiate between the various successful and unsuccessful trajectories. For example, when you ask the agent to suggest you a food recipe or tell you a joke.
-In our `AgentEval` framework, we are currently focusing on tasks where _Success is clearly defined_. Next, we will introduce the suggeted framework.
+In our `AgentEval` framework, we are currently focusing on tasks where _Success is clearly defined_. Next, we will introduce the suggested framework.
## `AgentEval` Framework
@@ -93,8 +93,8 @@ Then, after running QuantifierAgent, we obtained the results presented in Fig. 3
Lighter colors represent estimates for failed cases, and brighter colors show how discovered criteria were quantified.
-![Fig.3: Results based on overall mathp roblems dataset `_s` stands for successful cases, `_f` - stands for failed cases](img/math-problems-plot.png)
-<p align="center"><em>Fig.3 presents results based on overall mathproblems datase `_s` stands for successful cases, `_f` - stands for failed cases</em></p>
+![Fig.3: Results based on overall math problems dataset `_s` stands for successful cases, `_f` - stands for failed cases](img/math-problems-plot.png)
+<p align="center"><em>Fig.3 presents results based on overall math problems dataset `_s` stands for successful cases, `_f` - stands for failed cases</em></p>
We note that while applying agentEval to math problems, the agent was not exposed to any ground truth information about the problem. As such, this figure illustrates an estimated performance of the three different agents, namely, Autogen (blue), Gpt-4 (red), and ReAct (green). We observe that by comparing the performance of any of the three agents in successful cases (dark bars of any color) versus unsuccessful cases (lighter version of the same bar), we note that AgentEval was able to assign higher quantification to successful cases than that of failed ones. This observation verifies AgentEval's ability for task utility prediction. Additionally, AgentEval allows us to go beyond just a binary definition of success, enabling a more in-depth comparison between successful and failed cases.
diff --git a/website/docs/Gallery.mdx b/website/docs/Gallery.mdx
index dff1195c6..1b07b1381 100644
--- a/website/docs/Gallery.mdx
+++ b/website/docs/Gallery.mdx
@@ -27,9 +27,9 @@ The `image` property should be the name of a file in the `static/img/gallery` di
The `tags` property should be an array of strings that describe the demo. We recommend using no more than two tags for clarity.
Here are the meanings of several tags for reference:
1. app: Using Autogen for specific applications.
-2. extension: Enhacing AutoGen beyond the features in current version.
+2. extension: Enhancing AutoGen beyond the features in current version.
3. ui: Building user interface for AutoGen.
-4. tool: Strengthing AutoGen Agents with exteral tools.
+4. tool: Strengthening AutoGen Agents with external tools.
5. groupchat: Solving complex tasks with a group of Agents.
if the existing ones do not precisely portray your own demos, new tags are also encouraged to add.
diff --git a/website/docs/Getting-Started.md b/website/docs/Getting-Started.md
index 75f34b120..374396b9e 100644
--- a/website/docs/Getting-Started.md
+++ b/website/docs/Getting-Started.md
@@ -44,7 +44,7 @@ The figure below shows an example conversation flow with AutoGen.
* [Documentation](/docs/Use-Cases/agent_chat).
#### Enhanced LLM Inferences
-Autogen also helps maximize the utility out of the expensive LLMs such as ChatGPT and GPT-4. It offers enhanced LLM inference with powerful functionalites like tuning, caching, error handling, templating. For example, you can optimize generations by LLM with your own tuning data, success metrics and budgets.
+Autogen also helps maximize the utility out of the expensive LLMs such as ChatGPT and GPT-4. It offers enhanced LLM inference with powerful functionalities like tuning, caching, error handling, templating. For example, you can optimize generations by LLM with your own tuning data, success metrics and budgets.
```python
# perform tuning for openai<1
config, analysis = autogen.Completion.tune(
diff --git a/website/docs/Use-Cases/agent_chat.md b/website/docs/Use-Cases/agent_chat.md
index ef63ac3e4..9c4146158 100644
--- a/website/docs/Use-Cases/agent_chat.md
+++ b/website/docs/Use-Cases/agent_chat.md
@@ -54,7 +54,7 @@ user_proxy.initiate_chat(
)
```
-After the initialization step, the conversation could proceed automatically. Find a visual illustration of how the user_proxy and assistant collaboratively solve the above task autonmously below:
+After the initialization step, the conversation could proceed automatically. Find a visual illustration of how the user_proxy and assistant collaboratively solve the above task autonomously below:
![Agent Chat Example](images/agent_example.png)
1. The assistant receives a message from the user_proxy, which contains the task description.
diff --git a/website/docs/Use-Cases/enhanced_inference.md b/website/docs/Use-Cases/enhanced_inference.md
index 1313713bc..3b88f8230 100644
--- a/website/docs/Use-Cases/enhanced_inference.md
+++ b/website/docs/Use-Cases/enhanced_inference.md
@@ -103,7 +103,7 @@ config, analysis = autogen.Completion.tune(
`num_samples` is the number of configurations to sample. -1 means unlimited (until optimization budget is exhausted).
The returned `config` contains the optimized configuration and `analysis` contains an ExperimentAnalysis object for all the tried configurations and results.
-The tuend config can be used to perform inference.
+The tuned config can be used to perform inference.
## API unification