instruction stringclasses 2
values | input stringlengths 0 1k | output stringclasses 2
values | metadata dict |
|---|---|---|---|
Analyze this document content | These files were obtained from the creators of the AssistantBench benchmark and modified slightly. You can find the latest version at [https://huggingface.co/spaces/AssistantBench/leaderboard/tree/main/evaluation](https://huggingface.co/spaces/AssistantBench/leaderboard/tree/main/evaluation)
| Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/AssistantBench/Scripts/evaluate_utils/readme.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this code content | from typing import List, Set, Tuple, Union, Callable
import numpy as np
from scipy.optimize import linear_sum_assignment
def _align_bags(
predicted: List[Set[str]],
gold: List[Set[str]],
method: Callable[[object, object], float],
) -> List[float]:
"""
Takes gold and predicted answer sets and first... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/AssistantBench/Scripts/evaluate_utils/utils.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import logging
import os
import re
import tiktoken
from openai import AzureOpenAI
from typing import List
from autogen_core import AgentId, AgentProxy, TopicId
from autogen_core import SingleThreadedAgentRuntime
from autogen_core.logging import EVENT_LOGGER_NAME
from autogen_core.models import (
C... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/AssistantBench/Templates/MagenticOne/scenario.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this document content | # GAIA Benchmark
This scenario implements the [GAIA](https://arxiv.org/abs/2311.12983) agent benchmark. Before you begin, make sure you have followed instruction in `../README.md` to prepare your environment.
### Setup Environment Variables for AgBench
Navigate to GAIA
```bash
cd benchmarks/GAIA
```
Create a file ... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/GAIA/README.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this code content | import os
import sys
import re
from agbench.tabulate_cmd import default_tabulate
import json
import pandas as pd
import sqlite3
import glob
import numpy as np
EXCLUDE_DIR_NAMES = ["__pycache__"]
def normalize_answer(a):
# Lower case
# Trim (left and right)
# standardize comma separated values
# Repla... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/GAIA/Scripts/custom_tabulate.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | #
# Run this file to download the human_eval dataset, and create a corresponding testbed scenario:
# (default: ../scenarios/human_eval_two_agents_gpt4.jsonl and ./scenarios/human_eval_two_agents_gpt35.jsonl)
#
import json
import os
import re
import sys
from huggingface_hub import snapshot_download
SCRIPT_PATH = os.p... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/GAIA/Scripts/init_tasks.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import logging
import os
import re
import tiktoken
from openai import AzureOpenAI
from typing import List
from autogen_core import AgentId, AgentProxy, TopicId
from autogen_core import SingleThreadedAgentRuntime
from autogen_core import EVENT_LOGGER_NAME
from autogen_core.models import (
ChatCompl... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/GAIA/Templates/MagenticOne/scenario.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this document content | # HumanEval Benchmark
This scenario implements a modified version of the [HumanEval](https://arxiv.org/abs/2107.03374) benchmark.
Compared to the original benchmark, there are **two key differences** here:
- A chat model rather than a completion model is used.
- The agents get pass/fail feedback about their implement... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/HumanEval/README.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this code content | import os
import sys
from agbench.tabulate_cmd import default_tabulate
def main(args):
default_tabulate(args)
if __name__ == "__main__" and __package__ is None:
main(sys.argv)
| Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/HumanEval/Scripts/custom_tabulate.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | #
# Run this file to download the human_eval dataset, and create a corresponding testbed scenario:
# (default: ../scenarios/human_eval_two_agents_gpt4.jsonl and ./scenarios/human_eval_two_agents_gpt35.jsonl)
#
import base64
import gzip
import io
import json
import os
import re
import requests
URL = "https://github.c... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/HumanEval/Scripts/init_tasks.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import logging
from autogen_core import AgentId, AgentProxy, TopicId
from autogen_core import SingleThreadedAgentRuntime
from autogen_core import EVENT_LOGGER_NAME
from autogen_core import DefaultSubscription, DefaultTopicId
from autogen_ext.code_executors.local import LocalCommandLineCodeExecutor
from ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/HumanEval/Templates/MagenticOne/scenario.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | # Disable ruff linter for template files
# ruff: noqa: F821 E722
import sys
__TEST__
def run_tests(candidate):
try:
check(candidate)
# We can search for this string in the output
print("ALL TESTS PASSED !#!#")
except AssertionError:
sys.exit("SOME TESTS FAILED - TRY AGAIN !#!... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/HumanEval/Templates/MagenticOne/unit_tests.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this document content | # WebArena Benchmark
This scenario implements the [WebArena](https://github.com/web-arena-x/webarena/tree/main) benchmark. The evaluation code has been modified from WebArena in [evaluation_harness](Templates/Common/evaluation_harness) we retain the License from WebArena and include it here [LICENSE](Templates/Common/... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/README.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this code content | import os
import sys
import re
from agbench.tabulate_cmd import default_tabulate
def scorer(instance_dir):
# Read the console
console_log_file = os.path.join(instance_dir, "console_log.txt")
if not os.path.isfile(console_log_file):
return None
console_log = ""
with open(console_log_file,... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/Scripts/custom_tabulate.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | #
# Run this file to download the human_eval dataset, and create a corresponding testbed scenario:
# (default: ../scenarios/human_eval_two_agents_gpt4.jsonl and ./scenarios/human_eval_two_agents_gpt35.jsonl)
#
import requests
import tarfile
import hashlib
import io
import json
import os
import re
import sys
URL = "ht... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/Scripts/init_tasks.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from .evaluators import *
from .helper_functions import (
shopping_get_latest_order_url,
shopping_get_sku_latest_review_author,
shopping_get_sku_latest_review_rating,
)
| Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/Templates/Common/evaluation_harness/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | # websites domain
import os
REDDIT = os.environ.get("REDDIT", "")
SHOPPING = os.environ.get("SHOPPING", "")
SHOPPING_ADMIN = os.environ.get("SHOPPING_ADMIN", "")
GITLAB = os.environ.get("GITLAB", "")
WIKIPEDIA = os.environ.get("WIKIPEDIA", "")
MAP = os.environ.get("MAP", "")
HOMEPAGE = os.environ.get("HOMEPAGE", "")
... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/Templates/Common/evaluation_harness/env_config.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """From WebArena. base class for evaluation"""
# answer string match
import collections
import html
import importlib
import json
import time
import urllib
import inspect
from pathlib import Path
from typing import Any, Tuple, Union, TypedDict, Dict
from beartype import beartype
from nltk.tokenize import word_tokenize... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/Templates/Common/evaluation_harness/evaluators.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """From WebArena with minor modifications. Implements helper functions to assist evaluation cases where other evaluators are not suitable."""
import json
from typing import Any
from urllib.parse import urlparse
import requests
from playwright.async_api import Page
from .env_config import (
ACCOUNTS,
GITLAB,
... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/Templates/Common/evaluation_harness/helper_functions.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """Tools to generate from OpenAI prompts.
Adopted from https://github.com/zeno-ml/zeno-build/"""
import asyncio
import logging
import os
import random
import time
from typing import Any
import aiolimiter
import openai
from openai import AsyncOpenAI, OpenAI
client = None
aclient = None
if "OPENAI_API_KEY" not in os.e... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/Templates/Common/evaluation_harness/openai_utils.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import logging
import json
import os
import re
import nltk
from typing import Any, Dict, List, Tuple, Union
from autogen_core import AgentId, AgentProxy, TopicId
from autogen_core import SingleThreadedAgentRuntime
from autogen_core import EVENT_LOGGER_NAME
from autogen_core import DefaultSubscription, ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/benchmarks/WebArena/Templates/MagenticOne/scenario.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from .version import __version__
| Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/src/agbench/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from .cli import main
if __name__ == "__main__":
main()
| Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/src/agbench/__main__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import sys
from typing import Callable, List, Optional, Sequence
from typing_extensions import TypedDict
from .remove_missing_cmd import remove_missing_cli
from .run_cmd import run_cli
from .tabulate_cmd import tabulate_cli
from .version import __version__
class CommandSpec(TypedDict):
command: str
descript... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/src/agbench/cli.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import importlib.util
import os
import sys
from types import ModuleType
def load_module(module_path: str) -> ModuleType:
module_name = os.path.basename(module_path).replace(".py", "")
spec = importlib.util.spec_from_file_location(module_name, module_path)
if spec is None:
raise ValueError(f"Could ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/src/agbench/load_module.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import argparse
import os
import shutil
import sys
from typing import Sequence
def default_scorer(instance_dir: str) -> bool:
"""
returns True if the instance_dir has the expected ending pattern in the console_log.txt file
"""
console_log = os.path.join(instance_dir, "console_log.txt")
if os.path.... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/src/agbench/remove_missing_cmd.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import argparse
import errno
import json
import logging
import os
import pathlib
import random
import shutil
import subprocess
import sys
import time
import traceback
from multiprocessing import Pool
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union, cast
import docker
from azure.... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/src/agbench/run_cmd.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import argparse
import os
import sys
from copy import deepcopy
from typing import Any, Callable, List, Optional, Sequence, Tuple
import tabulate as tb
from .load_module import load_module
# Figure out where everything is
SCRIPT_PATH = os.path.realpath(__file__)
SCRIPT_NAME = os.path.basename(SCRIPT_PATH)
SCRIPT_DIR ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/src/agbench/tabulate_cmd.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | __version__ = "0.0.1a1"
| Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/agbench/src/agbench/version.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this document content | # AutoGen AgentChat
- [Documentation](https://microsoft.github.io/autogen/dev/user-guide/agentchat-user-guide/index.html)
| Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/README.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this code content | """
This module provides the main entry point for the autogen_agentchat package.
It includes logger names for trace and event logs, and retrieves the package version.
"""
import importlib.metadata
TRACE_LOGGER_NAME = "autogen_agentchat"
"""Logger name for trace logs."""
EVENT_LOGGER_NAME = "autogen_agentchat.events"... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """
This module defines various message types used for agent-to-agent communication.
Each message type inherits either from the BaseChatMessage class or BaseAgentEvent
class and includes specific fields relevant to the type of message being sent.
"""
from abc import ABC
from typing import List, Literal
from autogen_c... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/messages.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """
This module initializes various pre-defined agents provided by the package.
BaseChatAgent is the base class for all agents in AgentChat.
"""
from ._assistant_agent import AssistantAgent, Handoff # type: ignore
from ._base_chat_agent import BaseChatAgent
from ._code_executor_agent import CodeExecutorAgent
from ._c... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/agents/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import json
import logging
import warnings
from typing import (
Any,
AsyncGenerator,
Awaitable,
Callable,
Dict,
List,
Mapping,
Sequence,
)
from autogen_core import CancellationToken, FunctionCall
from autogen_core.model_context import (
ChatCompletionContext,
Unbo... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from abc import ABC, abstractmethod
from typing import Any, AsyncGenerator, List, Mapping, Sequence
from autogen_core import CancellationToken
from ..base import ChatAgent, Response, TaskResult
from ..messages import (
AgentEvent,
BaseChatMessage,
ChatMessage,
TextMessage,
)
from ..state import BaseSt... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_base_chat_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import re
from typing import List, Sequence
from autogen_core import CancellationToken
from autogen_core.code_executor import CodeBlock, CodeExecutor
from ..base import Response
from ..messages import ChatMessage, TextMessage
from ._base_chat_agent import BaseChatAgent
def _extract_markdown_code_blocks(markdown_tex... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_code_executor_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import warnings
from autogen_core.models import (
ChatCompletionClient,
)
from ._assistant_agent import AssistantAgent
class CodingAssistantAgent(AssistantAgent):
"""[DEPRECATED] An agent that provides coding assistance using an LLM model client.
It responds with a StopMessage when 'terminate' is detec... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_coding_assistant_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from typing import Any, AsyncGenerator, List, Mapping, Sequence
from autogen_core import CancellationToken
from autogen_core.models import ChatCompletionClient, LLMMessage, SystemMessage, UserMessage
from autogen_agentchat.base import Response
from autogen_agentchat.state import SocietyOfMindAgentState
from ..base i... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_society_of_mind_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import logging
import warnings
from typing import Any, Awaitable, Callable, List
from autogen_core.models import (
ChatCompletionClient,
)
from autogen_core.tools import Tool
from .. import EVENT_LOGGER_NAME
from ._assistant_agent import AssistantAgent
event_logger = logging.getLogger(EVENT_LOGGER_NAME)
class ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_tool_use_assistant_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
from inspect import iscoroutinefunction
from typing import Awaitable, Callable, Optional, Sequence, Union, cast
from aioconsole import ainput # type: ignore
from autogen_core import CancellationToken
from ..base import Response
from ..messages import ChatMessage, HandoffMessage, TextMessage
from ._bas... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_user_proxy_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from ._chat_agent import ChatAgent, Response
from ._handoff import Handoff
from ._task import TaskResult, TaskRunner
from ._team import Team
from ._termination import TerminatedException, TerminationCondition
__all__ = [
"ChatAgent",
"Response",
"Team",
"TerminatedException",
"TerminationCondition"... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/base/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from dataclasses import dataclass
from typing import Any, AsyncGenerator, Mapping, Protocol, Sequence, runtime_checkable
from autogen_core import CancellationToken
from ..messages import AgentEvent, ChatMessage
from ._task import TaskRunner
@dataclass(kw_only=True)
class Response:
"""A response from calling :me... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/base/_chat_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import logging
from typing import Any, Dict
from autogen_core.tools import FunctionTool, Tool
from pydantic import BaseModel, Field, model_validator
from .. import EVENT_LOGGER_NAME
event_logger = logging.getLogger(EVENT_LOGGER_NAME)
class Handoff(BaseModel):
"""Handoff configuration."""
target: str
"... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/base/_handoff.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from dataclasses import dataclass
from typing import AsyncGenerator, Protocol, Sequence
from autogen_core import CancellationToken
from ..messages import AgentEvent, ChatMessage
@dataclass
class TaskResult:
"""Result of running a task."""
messages: Sequence[AgentEvent | ChatMessage]
"""Messages produce... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/base/_task.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from typing import Any, Mapping, Protocol
from ._task import TaskRunner
class Team(TaskRunner, Protocol):
async def reset(self) -> None:
"""Reset the team and all its participants to its initial state."""
...
async def save_state(self) -> Mapping[str, Any]:
"""Save the current state ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/base/_team.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
from abc import ABC, abstractmethod
from typing import List, Sequence
from ..messages import AgentEvent, ChatMessage, StopMessage
class TerminatedException(BaseException): ...
class TerminationCondition(ABC):
"""A stateful condition that determines when a conversation should be terminated.
... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/base/_termination.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """
This module provides various termination conditions for controlling the behavior of
multi-agent teams.
"""
from ._terminations import (
ExternalTermination,
HandoffTermination,
MaxMessageTermination,
SourceMatchTermination,
StopMessageTermination,
TextMentionTermination,
TimeoutTerminat... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/conditions/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import time
from typing import List, Sequence
from ..base import TerminatedException, TerminationCondition
from ..messages import AgentEvent, ChatMessage, HandoffMessage, MultiModalMessage, StopMessage
class StopMessageTermination(TerminationCondition):
"""Terminate the conversation if a StopMessage is received.... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/conditions/_terminations.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """State management for agents, teams and termination conditions."""
from ._states import (
AssistantAgentState,
BaseGroupChatManagerState,
BaseState,
ChatAgentContainerState,
MagenticOneOrchestratorState,
RoundRobinManagerState,
SelectorManagerState,
SocietyOfMindAgentState,
SwarmM... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/state/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from typing import Annotated, Any, List, Mapping, Optional
from pydantic import BaseModel, Field
from ..messages import (
AgentEvent,
ChatMessage,
)
# Ensures pydantic can distinguish between types of events & messages.
_AgentMessage = Annotated[AgentEvent | ChatMessage, Field(discriminator="type")]
class ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/state/_states.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from typing import AsyncGenerator, TypeVar
from typing_extensions import deprecated
from ..base import Response, TaskResult
from ..conditions import (
ExternalTermination as ExternalTerminationAlias,
)
from ..conditions import (
HandoffTermination as HandoffTerminationAlias,
)
from ..conditions import (
M... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/task/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """
This module provides implementation of various pre-defined multi-agent teams.
Each team inherits from the BaseGroupChat class.
"""
from ._group_chat._base_group_chat import BaseGroupChat
from ._group_chat._magentic_one import MagenticOneGroupChat
from ._group_chat._round_robin_group_chat import RoundRobinGroupChat... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/__init__.py",
"file_type": ".py",
"source_type": "code"
} | |
Analyze this code content | import asyncio
import logging
import uuid
from abc import ABC, abstractmethod
from typing import Any, AsyncGenerator, Callable, List, Mapping, Sequence
from autogen_core import (
AgentId,
AgentInstantiationContext,
AgentRuntime,
AgentType,
CancellationToken,
ClosureAgent,
MessageContext,
... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
from abc import ABC, abstractmethod
from typing import Any, List
from autogen_core import DefaultTopicId, MessageContext, event, rpc
from ...base import TerminationCondition
from ...messages import AgentEvent, ChatMessage, StopMessage
from ._events import (
GroupChatAgentResponse,
GroupChatRequ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat_manager.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from typing import Any, List, Mapping
from autogen_core import DefaultTopicId, MessageContext, event, rpc
from ...base import ChatAgent, Response
from ...messages import ChatMessage
from ...state import ChatAgentContainerState
from ._events import GroupChatAgentResponse, GroupChatMessage, GroupChatRequestPublish, Gro... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_chat_agent_container.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from typing import List
from pydantic import BaseModel
from ...base import Response
from ...messages import AgentEvent, ChatMessage, StopMessage
class GroupChatStart(BaseModel):
"""A request to start a group chat."""
messages: List[ChatMessage] | None = None
"""An optional list of messages to start the... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_events.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from typing import Any, Callable, List, Mapping
from ...base import ChatAgent, TerminationCondition
from ...messages import AgentEvent, ChatMessage
from ...state import RoundRobinManagerState
from ._base_group_chat import BaseGroupChat
from ._base_group_chat_manager import BaseGroupChatManager
class RoundRobinGroupC... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_round_robin_group_chat.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import logging
import re
from typing import Any, Callable, Dict, List, Mapping, Sequence
from autogen_core.models import ChatCompletionClient, SystemMessage
from ... import TRACE_LOGGER_NAME
from ...base import ChatAgent, TerminationCondition
from ...messages import (
AgentEvent,
BaseAgentEvent,
ChatMessa... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_selector_group_chat.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
from typing import Any
from autogen_core import MessageContext, RoutedAgent
class FIFOLock:
"""A lock that ensures coroutines acquire the lock in the order they request it."""
def __init__(self) -> None:
self._queue = asyncio.Queue[asyncio.Event]()
self._locked = False
as... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_sequential_routed_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from typing import Any, Callable, List, Mapping
from ...base import ChatAgent, TerminationCondition
from ...messages import AgentEvent, ChatMessage, HandoffMessage
from ...state import SwarmManagerState
from ._base_group_chat import BaseGroupChat
from ._base_group_chat_manager import BaseGroupChatManager
class Swarm... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_swarm_group_chat.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | from ._magentic_one_group_chat import MagenticOneGroupChat
__all__ = [
"MagenticOneGroupChat",
]
| Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_magentic_one/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import logging
from typing import Callable, List
from autogen_core.models import ChatCompletionClient
from .... import EVENT_LOGGER_NAME, TRACE_LOGGER_NAME
from ....base import ChatAgent, TerminationCondition
from .._base_group_chat import BaseGroupChat
from ._magentic_one_orchestrator import MagenticOneOrchestrator
... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_magentic_one/_magentic_one_group_chat.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import json
import logging
from typing import Any, Dict, List, Mapping
from autogen_core import AgentId, CancellationToken, DefaultTopicId, Image, MessageContext, event, rpc
from autogen_core.models import (
AssistantMessage,
ChatCompletionClient,
LLMMessage,
UserMessage,
)
from .... import TRACE_LOGG... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_magentic_one/_magentic_one_orchestrator.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | ORCHESTRATOR_SYSTEM_MESSAGE = ""
ORCHESTRATOR_TASK_LEDGER_FACTS_PROMPT = """Below I will present you a request. Before we begin addressing the request, please answer the following pre-survey to the best of your ability. Keep in mind that you are Ken Jennings-level with trivia, and Mensa-level with puzzles, so there s... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_magentic_one/_prompts.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """
This module implements utility classes for formatting/printing agent messages.
"""
from ._console import Console
__all__ = ["Console"]
| Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/ui/__init__.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import os
import sys
import time
from typing import AsyncGenerator, List, Optional, TypeVar, cast
from autogen_core import Image
from autogen_core.models import RequestUsage
from autogen_agentchat.base import Response, TaskResult
from autogen_agentchat.messages import AgentEvent, ChatMessage, MultiModalMessage
def ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/src/autogen_agentchat/ui/_console.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import json
import logging
from typing import Any, AsyncGenerator, List
import pytest
from autogen_agentchat import EVENT_LOGGER_NAME
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.base import Handoff, TaskResult
from autogen_agentchat.messages import (
ChatMessage,
H... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/test_assistant_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import pytest
from autogen_agentchat.agents import CodeExecutorAgent
from autogen_agentchat.base import Response
from autogen_agentchat.messages import TextMessage
from autogen_core import CancellationToken
from autogen_ext.code_executors.local import LocalCommandLineCodeExecutor
@pytest.mark.asyncio
async def test_b... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/test_code_executor_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import json
import logging
import tempfile
from typing import Any, AsyncGenerator, List, Sequence
import pytest
from autogen_agentchat import EVENT_LOGGER_NAME
from autogen_agentchat.agents import (
AssistantAgent,
BaseChatAgent,
CodeExecutorAgent,
)
from autogen_agentchat.base import Handof... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/test_group_chat.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import json
import logging
from typing import Sequence
import pytest
from autogen_agentchat import EVENT_LOGGER_NAME
from autogen_agentchat.agents import (
BaseChatAgent,
)
from autogen_agentchat.base import Response
from autogen_agentchat.messages import (
ChatMessage,
TextMessage,
)
from a... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/test_magentic_one_group_chat.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import random
from dataclasses import dataclass
from typing import List
import pytest
from autogen_agentchat.teams._group_chat._sequential_routed_agent import SequentialRoutedAgent
from autogen_core import (
AgentId,
DefaultTopicId,
MessageContext,
SingleThreadedAgentRuntime,
default... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/test_sequential_routed_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
from typing import Any, AsyncGenerator, List
import pytest
from autogen_agentchat.agents import AssistantAgent, SocietyOfMindAgent
from autogen_agentchat.conditions import MaxMessageTermination
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models.openai import OpenAIChatComple... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/test_society_of_mind_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
import pytest
from autogen_agentchat.base import TerminatedException
from autogen_agentchat.conditions import (
ExternalTermination,
HandoffTermination,
MaxMessageTermination,
SourceMatchTermination,
StopMessageTermination,
TextMentionTermination,
TimeoutTermination,
Toke... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/test_termination_condition.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import asyncio
from typing import Optional, Sequence
import pytest
from autogen_agentchat.agents import UserProxyAgent
from autogen_agentchat.base import Response
from autogen_agentchat.messages import ChatMessage, HandoffMessage, TextMessage
from autogen_core import CancellationToken
@pytest.mark.asyncio
async def ... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/test_userproxy_agent.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | import json
import logging
import sys
from datetime import datetime
from pydantic import BaseModel
class FileLogHandler(logging.Handler):
def __init__(self, filename: str) -> None:
super().__init__()
self.filename = filename
self.file_handler = logging.FileHandler(filename)
def emit(... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-agentchat/tests/utils.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this document content | # AutoGen Core
- [Documentation](https://microsoft.github.io/autogen/dev/user-guide/core-user-guide/index.html)
| Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/README.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | ## Building the AutoGen Documentation
AutoGen documentation is based on the sphinx documentation system and uses the myst-parser to render markdown files. It uses the [pydata-sphinx-theme](https://pydata-sphinx-theme.readthedocs.io/en/latest/) to style the documentation.
### Prerequisites
Ensure you have all of the ... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/README.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this code content | from pathlib import Path
from string import Template
import sys
THIS_FILE_DIR = Path(__file__).parent
# Contains single text template $to_url
HTML_PAGE_TEMPLATE_FILE = THIS_FILE_DIR / "redirect_template.html"
HTML_REDIRECT_TEMPLATE = HTML_PAGE_TEMPLATE_FILE.open("r").read()
REDIRECT_URLS_FILE = THIS_FILE_DIR / "redi... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/redirects/redirects.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
from sphinx.application import Sphinx
from typing import Any, Dict
from pathlib import Path
import sys
import os
# --... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/conf.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this document content | ---
myst:
html_meta:
"description lang=en": |
Top-level documentation for AutoGen, a framework for developing applications using AI agents
html_theme.sidebar_secondary.remove: false
sd_hide_title: true
---
<style>
.hero-title {
font-size: 60px;
font-weight: bold;
margin: 2rem auto 0;
}
.wip-card {
... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/index.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this code content | # Modified from: https://github.com/kai687/sphinxawesome-codelinter
import tempfile
from typing import AbstractSet, Any, Iterable
from docutils import nodes
from sphinx.application import Sphinx
from sphinx.builders import Builder
from sphinx.util import logging
from sphinx.util.console import darkgreen, darkred, red... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/_extension/code_lint.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this code content | """A directive to generate a gallery of images from structured data.
Generating a gallery of images that are all the same size is a common
pattern in documentation, and this can be cumbersome if the gallery is
generated programmatically. This directive wraps this particular use-case
in a helper-directive to generate i... | Code analysis and explanation | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/_extension/gallery_directive.py",
"file_type": ".py",
"source_type": "code"
} |
Analyze this document content | ---
myst:
html_meta:
"description lang=en": |
AutoGen is a community-driven project. Learn how to get involved, contribute, and connect with the community.
---
# API Reference
```{toctree}
:hidden:
:caption: AutoGen AgentChat
python/autogen_agentchat
python/autogen_agentchat.messages
python/autogen_agent... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/reference/index.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | ---
myst:
html_meta:
"description lang=en": |
User Guide for AgentChat, a high-level API for AutoGen
---
# AgentChat
AgentChat is a high-level API for building multi-agent applications.
It is built on top of the [`autogen-core`](../core-user-guide/index.md) package.
For beginner users, AgentChat is the re... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/index.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | ---
myst:
html_meta:
"description lang=en": |
Installing AutoGen AgentChat
---
# Installation
## Create a Virtual Environment (optional)
When installing AgentChat locally, we recommend using a virtual environment for the installation. This will ensure that the dependencies for AgentChat are isolated from... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/installation.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | # Migration Guide for v0.2 to v0.4
This is a migration guide for users of the `v0.2.*` versions of `autogen-agentchat`
to the `v0.4` version, which introduces a new set of APIs and features.
The `v0.4` version contains breaking changes. Please read this guide carefully.
We still maintain the `v0.2` version in the `0.2... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/migration-guide.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | ---
myst:
html_meta:
"description lang=en": |
Examples built using AgentChat, a high-level api for AutoGen
---
# Examples
A list of examples to help you get started with AgentChat.
:::::{grid} 2 2 2 3
::::{grid-item-card} Travel Planning
:img-top: ../../../images/example-travel.jpeg
:img-alt: travel pla... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/index.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | ---
myst:
html_meta:
"description lang=en": |
FAQ for AutoGen Studio - A low code tool for building and debugging multi-agent systems
---
# FAQ
## Q: How do I specify the directory where files(e.g. database) are stored?
A: You can specify the directory where files are stored by setting the `--appdir` arg... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/autogenstudio-user-guide/faq.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | ---
myst:
html_meta:
"description lang=en": |
User Guide for AutoGen Studio - A low code tool for building and debugging multi-agent systems
---
# AutoGen Studio
[](https://badge.fury.io/py/autogenstudio)
[ authentication.
The identity used must be assigned the [**Cognitive Services OpenAI User**](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/role-based-access-control#cognitive-s... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/azure-openai-with-aad-auth.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | # Cookbook
This section contains a collection of recipes that demonstrate how to use the Core API features.
## List of recipes
```{toctree}
:maxdepth: 1
azure-openai-with-aad-auth
termination-with-intervention
tool-use-with-intervention
extracting-results-with-an-agent
openai-assistant-agent
langgraph-agent
llamain... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/index.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | # Instrumentating your code locally
AutoGen supports instrumenting your code using [OpenTelemetry](https://opentelemetry.io). This allows you to collect traces and logs from your code and send them to a backend of your choice.
While debugging, you can use a local backend such as [Aspire](https://aspiredashboard.com/)... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/instrumenting.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | # Agent and Multi-Agent Applications
An **agent** is a software entity that communicates via messages, maintains its own state, and performs actions in response to received messages or changes in its state. These actions may modify the agent’s state and produce external effects, such as updating message logs, sending ... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/core-user-guide/core-concepts/agent-and-multi-agent-application.md",
"file_type": ".md",
"source_type": "document"
} |
Analyze this document content | (agentid_and_lifecycle)=
# Agent Identity and Lifecycle
The agent runtime manages agents' identities
and lifecycles.
Application does not create agents directly, rather,
it registers an agent type with a factory function for
agent instances.
In this section, we explain how agents are identified
and created by the runt... | Document summary and key points | {
"file_path": "multi_repo_data/autogen/python/packages/autogen-core/docs/src/user-guide/core-user-guide/core-concepts/agent-identity-and-lifecycle.md",
"file_type": ".md",
"source_type": "document"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.