Skip to content

Commit 35a0587

Browse files
authored
Merge branch 'main' into mehak/botbuilder
2 parents 9625f5b + 49362b0 commit 35a0587

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2537
-1167
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ A comprehensive SDK for building Microsoft Teams applications, bots, and AI agen
6464
> external packages to integrate with external protocols and microsoft-teams-cards
6565
6666
- [`microsoft-teams-mcpplugin`](./packages/mcp/README.md)
67+
- [`microsoft-teams-a2a`](./packages/a2aprotocol/README.md)
6768

6869
### Create a New Package
6970

packages/a2aprotocol/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Microsoft Teams A2A
22

33
<p>
4-
<a href="https://pypi.org/project/microsoft-teams-a2aprotocol/" target="_blank">
5-
<img src="https://img.shields.io/pypi/v/microsoft-teams-a2aprotocol" />
4+
<a href="https://pypi.org/project/microsoft-teams-a2a/" target="_blank">
5+
<img src="https://img.shields.io/pypi/v/microsoft-teams-a2a" />
66
</a>
7-
<a href="https://pypi.org/project/microsoft-teams-a2aprotocol" target="_blank">
8-
<img src="https://img.shields.io/pypi/dw/microsoft-teams-a2aprotocol" />
7+
<a href="https://pypi.org/project/microsoft-teams-a2a" target="_blank">
8+
<img src="https://img.shields.io/pypi/dw/microsoft-teams-a2a" />
99
</a>
1010
</p>
1111
<a href="https://microsoft.github.io/teams-ai" target="_blank">

packages/a2aprotocol/pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[project]
2-
name = "microsoft-teams-a2aprotocol"
3-
version = "2.0.0a2"
2+
name = "microsoft-teams-a2a"
3+
version = "2.0.0a3"
44
description = "plugin that enables your teams agent to be used as an a2a agent"
55
authors = [{ name = "Microsoft", email = "[email protected]" }]
66
readme = "README.md"
77
requires-python = ">=3.12"
88
repository = "https://github.com/microsoft/teams.py"
99
keywords = ["microsoft", "teams", "ai", "bot", "agents"]
1010
license = "MIT"
11-
classifiers = ["Private :: Do Not Upload"]
1211
dependencies = [
13-
"a2a-sdk[all]>=0.3.7",
12+
"a2a-sdk[core,http-server]>=0.3.7",
13+
"microsoft-teams-ai",
14+
"microsoft-teams-apps",
1415
"microsoft-teams-common",
1516
"pytest>=8.4.1",
1617
]
@@ -31,3 +32,5 @@ include = ["src"]
3132

3233
[tool.uv.sources]
3334
microsoft-teams-common = { workspace = true }
35+
microsoft-teams-apps = { workspace = true }
36+
microsoft-teams-ai = { workspace = true }

packages/a2aprotocol/src/microsoft/teams/a2a/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Licensed under the MIT License.
44
"""
55

6+
from . import chat_prompt, server
7+
from .chat_prompt import * # noqa: F403
8+
from .server import * # noqa: F401, F403
69

7-
def hello() -> str:
8-
return "Hello from a2aprotocol!"
10+
# Combine all exports from submodules
11+
__all__: list[str] = []
12+
__all__.extend(chat_prompt.__all__)
13+
__all__.extend(server.__all__)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the MIT License.
4+
"""
5+
6+
from .agent_client_info import AgentClientInfo
7+
from .agent_config import AgentConfig
8+
from .plugin import A2AClientPlugin, A2AClientPluginOptions, A2APluginUseParams, FunctionMetadata
9+
from .types import (
10+
BuildFunctionMetadata,
11+
BuildMessageForAgent,
12+
BuildMessageForAgentMetadata,
13+
BuildMessageFromAgentMetadata,
14+
BuildMessageFromAgentResponse,
15+
)
16+
17+
__all__ = [
18+
"AgentClientInfo",
19+
"AgentConfig",
20+
"A2AClientPlugin",
21+
"BuildFunctionMetadata",
22+
"BuildMessageForAgent",
23+
"BuildMessageFromAgentResponse",
24+
"A2AClientPluginOptions",
25+
"A2APluginUseParams",
26+
"BuildMessageForAgentMetadata",
27+
"BuildMessageFromAgentMetadata",
28+
"FunctionMetadata",
29+
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the MIT License.
4+
"""
5+
6+
from dataclasses import dataclass
7+
8+
from a2a.client import Client
9+
from a2a.types import AgentCard
10+
11+
from .agent_config import AgentConfig
12+
13+
14+
@dataclass(kw_only=True)
15+
class AgentClientInfo(AgentConfig):
16+
client: Client
17+
agent_card: AgentCard
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the MIT License.
4+
"""
5+
6+
from dataclasses import dataclass
7+
from typing import Optional
8+
9+
from .types import BuildFunctionMetadata, BuildMessageForAgent, BuildMessageFromAgentResponse
10+
11+
12+
@dataclass
13+
class AgentConfig:
14+
key: str
15+
base_url: str
16+
card_url: str
17+
build_function_metadata: Optional[BuildFunctionMetadata] = None
18+
"Optional function to customize the function name and description for each agent card."
19+
build_message_for_agent: Optional[BuildMessageForAgent] = None
20+
"Optional function to customize the message format sent to each agent."
21+
build_message_from_agent_response: Optional[BuildMessageFromAgentResponse] = None
22+
"Optional function to customize how agent responses are processed into strings."

0 commit comments

Comments
 (0)