-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into try_multiversion_build
- Loading branch information
Showing
31 changed files
with
278 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Remove awaiting-op-response label if op responded | ||
on: | ||
issue_comment: | ||
types: [created] | ||
jobs: | ||
label_issues: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- run: gh issue edit "$NUMBER" --remove-label "$LABELS" | ||
if: ${{ github.event.comment.user.login == github.event.issue.user.login && contains(github.event.issue.labels.*.name, 'awaiting-op-response') }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_REPO: ${{ github.repository }} | ||
NUMBER: ${{ github.event.issue.number }} | ||
LABELS: awaiting-op-response |
4 changes: 4 additions & 0 deletions
4
python/packages/autogen-agentchat/src/autogen_agentchat/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
import importlib.metadata | ||
|
||
TRACE_LOGGER_NAME = "autogen_agentchat" | ||
EVENT_LOGGER_NAME = "autogen_agentchat.events" | ||
|
||
__version__ = importlib.metadata.version("autogen_agentchat") |
20 changes: 0 additions & 20 deletions
20
python/packages/autogen-agentchat/src/autogen_agentchat/agents/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,9 @@ | ||
from ._base_chat_agent import ( | ||
BaseChatAgent, | ||
BaseMessage, | ||
BaseToolUseChatAgent, | ||
ChatMessage, | ||
MultiModalMessage, | ||
StopMessage, | ||
TextMessage, | ||
ToolCallMessage, | ||
ToolCallResultMessage, | ||
) | ||
from ._code_executor_agent import CodeExecutorAgent | ||
from ._coding_assistant_agent import CodingAssistantAgent | ||
from ._tool_use_assistant_agent import ToolUseAssistantAgent | ||
|
||
__all__ = [ | ||
"BaseChatAgent", | ||
"BaseMessage", | ||
"BaseToolUseChatAgent", | ||
"ChatMessage", | ||
"CodeExecutorAgent", | ||
"CodingAssistantAgent", | ||
"MultiModalMessage", | ||
"StopMessage", | ||
"TextMessage", | ||
"ToolCallMessage", | ||
"ToolCallResultMessage", | ||
"ToolUseAssistantAgent", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
python/packages/autogen-agentchat/src/autogen_agentchat/base/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from ._base_chat_agent import BaseChatAgent, BaseToolUseChatAgent | ||
from ._base_task import TaskResult, TaskRunner | ||
from ._base_team import Team | ||
from ._base_termination import TerminatedException, TerminationCondition | ||
|
||
__all__ = [ | ||
"BaseChatAgent", | ||
"BaseToolUseChatAgent", | ||
"Team", | ||
"TerminatedException", | ||
"TerminationCondition", | ||
"TaskResult", | ||
"TaskRunner", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
python/packages/autogen-agentchat/src/autogen_agentchat/base/_base_task.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from dataclasses import dataclass | ||
from typing import Protocol, Sequence | ||
|
||
from ..messages import ChatMessage | ||
|
||
|
||
@dataclass | ||
class TaskResult: | ||
"""Result of running a task.""" | ||
|
||
messages: Sequence[ChatMessage] | ||
"""Messages produced by the task.""" | ||
|
||
|
||
class TaskRunner(Protocol): | ||
"""A task runner.""" | ||
|
||
async def run(self, task: str) -> TaskResult: | ||
"""Run the task.""" | ||
... |
10 changes: 10 additions & 0 deletions
10
python/packages/autogen-agentchat/src/autogen_agentchat/base/_base_team.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import Protocol | ||
|
||
from ._base_task import TaskResult, TaskRunner | ||
from ._base_termination import TerminationCondition | ||
|
||
|
||
class Team(TaskRunner, Protocol): | ||
async def run(self, task: str, *, termination_condition: TerminationCondition | None = None) -> TaskResult: | ||
"""Run the team on a given task until the termination condition is met.""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
python/packages/autogen-agentchat/src/autogen_agentchat/messages.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
from typing import List | ||
|
||
from autogen_core.components import FunctionCall, Image | ||
from autogen_core.components.models import FunctionExecutionResult | ||
from pydantic import BaseModel | ||
|
||
|
||
class BaseMessage(BaseModel): | ||
"""A base message.""" | ||
|
||
source: str | ||
"""The name of the agent that sent this message.""" | ||
|
||
|
||
class TextMessage(BaseMessage): | ||
"""A text message.""" | ||
|
||
content: str | ||
"""The content of the message.""" | ||
|
||
|
||
class MultiModalMessage(BaseMessage): | ||
"""A multimodal message.""" | ||
|
||
content: List[str | Image] | ||
"""The content of the message.""" | ||
|
||
|
||
class ToolCallMessage(BaseMessage): | ||
"""A message containing a list of function calls.""" | ||
|
||
content: List[FunctionCall] | ||
"""The list of function calls.""" | ||
|
||
|
||
class ToolCallResultMessage(BaseMessage): | ||
"""A message containing the results of function calls.""" | ||
|
||
content: List[FunctionExecutionResult] | ||
"""The list of function execution results.""" | ||
|
||
|
||
class StopMessage(BaseMessage): | ||
"""A message requesting stop of a conversation.""" | ||
|
||
content: str | ||
"""The content for the stop message.""" | ||
|
||
|
||
ChatMessage = TextMessage | MultiModalMessage | StopMessage | ToolCallMessage | ToolCallResultMessage | ||
"""A message used by agents in a team.""" | ||
|
||
|
||
__all__ = [ | ||
"BaseMessage", | ||
"TextMessage", | ||
"MultiModalMessage", | ||
"ToolCallMessage", | ||
"ToolCallResultMessage", | ||
"StopMessage", | ||
"ChatMessage", | ||
] |
3 changes: 1 addition & 2 deletions
3
python/packages/autogen-agentchat/src/autogen_agentchat/teams/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.