Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ A comprehensive SDK for building Microsoft Teams applications, bots, and AI agen
> external packages to integrate with external protocols and microsoft-teams-cards

- [`microsoft-teams-mcpplugin`](./packages/mcp/README.md)
- [`microsoft-teams-a2a`](./packages/a2aprotocol/README.md)

### Create a New Package

Expand Down
8 changes: 4 additions & 4 deletions packages/a2aprotocol/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Microsoft Teams A2A

<p>
<a href="https://pypi.org/project/microsoft-teams-a2aprotocol/" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-a2aprotocol" />
<a href="https://pypi.org/project/microsoft-teams-a2a/" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-a2a" />
</a>
<a href="https://pypi.org/project/microsoft-teams-a2aprotocol" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-a2aprotocol" />
<a href="https://pypi.org/project/microsoft-teams-a2a" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-a2a" />
</a>
</p>
<a href="https://microsoft.github.io/teams-ai" target="_blank">
Expand Down
9 changes: 6 additions & 3 deletions packages/a2aprotocol/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "microsoft-teams-a2aprotocol"
name = "microsoft-teams-a2a"
version = "2.0.0a3"
description = "plugin that enables your teams agent to be used as an a2a agent"
authors = [{ name = "Microsoft", email = "TeamsAISDKFeedback@microsoft.com" }]
Expand All @@ -8,9 +8,10 @@ requires-python = ">=3.12"
repository = "https://github.com/microsoft/teams.py"
keywords = ["microsoft", "teams", "ai", "bot", "agents"]
license = "MIT"
classifiers = ["Private :: Do Not Upload"]
dependencies = [
"a2a-sdk[all]>=0.3.7",
"a2a-sdk[core,http-server]>=0.3.7",
"microsoft-teams-ai",
"microsoft-teams-apps",
"microsoft-teams-common",
"pytest>=8.4.1",
]
Expand All @@ -31,3 +32,5 @@ include = ["src"]

[tool.uv.sources]
microsoft-teams-common = { workspace = true }
microsoft-teams-apps = { workspace = true }
microsoft-teams-ai = { workspace = true }
9 changes: 7 additions & 2 deletions packages/a2aprotocol/src/microsoft/teams/a2a/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Licensed under the MIT License.
"""

from . import chat_prompt, server
from .chat_prompt import * # noqa: F403
from .server import * # noqa: F401, F403

def hello() -> str:
return "Hello from a2aprotocol!"
# Combine all exports from submodules
__all__: list[str] = []
__all__.extend(chat_prompt.__all__)
__all__.extend(server.__all__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
"""

from .agent_client_info import AgentClientInfo
from .agent_config import AgentConfig
from .plugin import A2AClientPlugin, A2AClientPluginOptions, A2APluginUseParams, FunctionMetadata
from .types import (
BuildFunctionMetadata,
BuildMessageForAgent,
BuildMessageForAgentMetadata,
BuildMessageFromAgentMetadata,
BuildMessageFromAgentResponse,
)

__all__ = [
"AgentClientInfo",
"AgentConfig",
"A2AClientPlugin",
"BuildFunctionMetadata",
"BuildMessageForAgent",
"BuildMessageFromAgentResponse",
"A2AClientPluginOptions",
"A2APluginUseParams",
"BuildMessageForAgentMetadata",
"BuildMessageFromAgentMetadata",
"FunctionMetadata",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
"""

from dataclasses import dataclass

from a2a.client import Client
from a2a.types import AgentCard

from .agent_config import AgentConfig


@dataclass(kw_only=True)
class AgentClientInfo(AgentConfig):
client: Client
agent_card: AgentCard
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
"""

from dataclasses import dataclass
from typing import Optional

from .types import BuildFunctionMetadata, BuildMessageForAgent, BuildMessageFromAgentResponse


@dataclass
class AgentConfig:
key: str
base_url: str
card_url: str
build_function_metadata: Optional[BuildFunctionMetadata] = None
"Optional function to customize the function name and description for each agent card."
build_message_for_agent: Optional[BuildMessageForAgent] = None
"Optional function to customize the message format sent to each agent."
build_message_from_agent_response: Optional[BuildMessageFromAgentResponse] = None
"Optional function to customize how agent responses are processed into strings."
Loading