mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Initial PR for multi-agent orchestration. ADR: https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0071-multi-agent-orchestration.md ### Description This is the initial PR for multi-agent orchestration. This PR includes the following: 1. Base classes 2. Implementations for the concurrent and sequential orchestrations 3. Unit tests and samples Follow up PRs will add the following: - Group chat - Handoff - Magentic One <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Evan Mattson <[email protected]>
46 lines
1.9 KiB
Python
46 lines
1.9 KiB
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
import importlib
|
|
|
|
_AGENTS = {
|
|
"Agent": ".agent",
|
|
"AgentResponseItem": ".agent",
|
|
"AgentThread": ".agent",
|
|
"AutoGenConversableAgent": ".autogen.autogen_conversable_agent",
|
|
"AutoGenConversableAgentThread": ".autogen.autogen_conversable_agent",
|
|
"AzureAIAgent": ".azure_ai.azure_ai_agent",
|
|
"AzureAIAgentSettings": ".azure_ai.azure_ai_agent_settings",
|
|
"AzureAIAgentThread": ".azure_ai.azure_ai_agent",
|
|
"BedrockAgent": ".bedrock.bedrock_agent",
|
|
"BedrockAgentThread": ".bedrock.bedrock_agent",
|
|
"ChatCompletionAgent": ".chat_completion.chat_completion_agent",
|
|
"ChatHistoryAgentThread": ".chat_completion.chat_completion_agent",
|
|
"CopilotStudioAgent": ".copilot_studio.copilot_studio_agent",
|
|
"CopilotStudioAgentAuthMode": ".copilot_studio.copilot_studio_agent_settings",
|
|
"CopilotStudioAgentSettings": ".copilot_studio.copilot_studio_agent_settings",
|
|
"CopilotStudioAgentThread": ".copilot_studio.copilot_studio_agent",
|
|
"AgentChat": ".group_chat.agent_chat",
|
|
"AgentGroupChat": ".group_chat.agent_group_chat",
|
|
"AzureAssistantAgent": ".open_ai.azure_assistant_agent",
|
|
"AssistantAgentThread": ".open_ai.open_ai_assistant_agent",
|
|
"OpenAIAssistantAgent": ".open_ai.open_ai_assistant_agent",
|
|
"OpenAIResponsesAgent": ".open_ai.openai_responses_agent",
|
|
"AzureResponsesAgent": ".open_ai.azure_responses_agent",
|
|
"ResponsesAgentThread": ".open_ai.openai_responses_agent",
|
|
"RunPollingOptions": ".open_ai.run_polling_options",
|
|
"ConcurrentOrchestration": ".orchestration.concurrent",
|
|
"SequentialOrchestration": ".orchestration.sequential",
|
|
}
|
|
|
|
|
|
def __getattr__(name: str):
|
|
if name in _AGENTS:
|
|
submod_name = _AGENTS[name]
|
|
module = importlib.import_module(submod_name, package=__name__)
|
|
return getattr(module, name)
|
|
raise AttributeError(f"module {__name__} has no attribute {name}")
|
|
|
|
|
|
def __dir__():
|
|
return list(_AGENTS.keys())
|