diff --git a/packages/a2aprotocol/README.md b/packages/a2aprotocol/README.md index 10cb4650..239acc8c 100644 --- a/packages/a2aprotocol/README.md +++ b/packages/a2aprotocol/README.md @@ -7,7 +7,65 @@ + + +

- - - + +Agent-to-Agent (A2A) protocol support for Microsoft Teams AI applications. +Enables Teams agents to communicate and collaborate with other AI agents using standardized protocols. + +## Installation + +```bash +uv add microsoft-teams-a2a +``` + +## Usage + +### A2A Server (Expose Agent) + +```python +from microsoft.teams.apps import App +from microsoft.teams.a2a import A2APlugin, A2APluginOptions +from a2a.types import AgentCard, AgentCapabilities + +app = App() + +# Define agent card with capabilities +agent_card = AgentCard( + name="weather_agent", + description="An agent that can tell you the weather", + url="http://localhost:4000/a2a/", + version="0.0.1", + protocol_version="0.3.0", + capabilities=AgentCapabilities(), + default_input_modes=[], + default_output_modes=[] +) + +a2a_server = A2APlugin(A2APluginOptions(agent_card=agent_card)) +app = App(plugins=[a2a_server]) +``` + +### A2A Client (Use Other Agents) + +```python +from microsoft.teams.a2a import A2AClientPlugin, A2APluginUseParams +from microsoft.teams.ai import ChatPrompt +from microsoft.teams.openai import OpenAICompletionsAIModel + +model = OpenAICompletionsAIModel(api_key="your-api-key", model="gpt-4") + +# Connect to another A2A agent +a2a_client = A2AClientPlugin() +a2a_client.on_use_plugin( + A2APluginUseParams( + key="my-weather-agent", + base_url="http://localhost:4000/a2a", + card_url=".well-known/agent-card.json" + ) +) + +prompt = ChatPrompt(model, plugins=[a2a_client]) +``` diff --git a/packages/ai/README.md b/packages/ai/README.md index 7f95ed2f..9139bd37 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -7,10 +7,57 @@ + + +

-AI tools and utilities. +AI-powered conversational experiences for Microsoft Teams applications. +Provides prompt management, action planning, and model integration for building intelligent Teams bots. + +[📖 Documentation](https://microsoft.github.io/teams-sdk/python/in-depth-guides/ai/) + +## Installation + +```bash +uv add microsoft-teams-ai +``` + +## Usage + +### ChatPrompt + +```python +from microsoft.teams.ai import ChatPrompt, Function +from microsoft.teams.openai import OpenAICompletionsAIModel +from pydantic import BaseModel + +model = OpenAICompletionsAIModel(api_key="your-api-key", model="gpt-4") + +# Create a ChatPrompt +prompt = ChatPrompt(model) + +result = await prompt.send( + input="Hello!", + instructions="You are a helpful assistant." +) +``` + +### Function Calling + +```python +class GetWeatherParams(BaseModel): + location: str + +async def get_weather(params: GetWeatherParams) -> str: + return f"The weather in {params.location} is sunny" + +weather_function = Function( + name="get_weather", + description="Get weather for a location", + parameter_schema=GetWeatherParams, + handler=get_weather +) - - - +prompt = ChatPrompt(model, functions=[weather_function]) +``` diff --git a/packages/devtools/README.md b/packages/devtools/README.md index 4feeef92..8168454e 100644 --- a/packages/devtools/README.md +++ b/packages/devtools/README.md @@ -10,15 +10,30 @@ + + +

+[📖 Documentation](https://microsoft.github.io/teams-sdk/developer-tools/devtools/) + Developer tools for locally testing and debugging Teams applications. Streamlines the development process by eliminating the need to deploy apps or expose public endpoints during development. - - - +## Installation + +```bash +uv add microsoft-teams-devtools +``` + +## Usage + +```python +from microsoft.teams.apps import App +from microsoft.teams.devtools import DevToolsPlugin -## Features +app = App() +app.use(DevToolsPlugin()) -- **Local Testing**: Test Teams apps locally without deployment -- **Bot Emulator**: Simulate Teams conversations and interactions +await app.start() +# Open http://localhost:3979/devtools in your browser +``` diff --git a/packages/mcpplugin/README.md b/packages/mcpplugin/README.md index e69de29b..9b624467 100644 --- a/packages/mcpplugin/README.md +++ b/packages/mcpplugin/README.md @@ -0,0 +1,73 @@ +# Microsoft Teams MCP Plugin + +

+ + + + + + +

+ +Model Context Protocol (MCP) integration for Microsoft Teams AI applications. +Enables Teams bots to both expose tools as MCP servers and use MCP servers as clients. + +[📖 Documentation](https://microsoft.github.io/teams-sdk/python/in-depth-guides/ai/mcp/) + +## Installation + +```bash +uv add microsoft-teams-mcpplugin +``` + +## Usage + +### MCP Client (Use MCP Servers) + +```python +from microsoft.teams.apps import App +from microsoft.teams.mcpplugin import McpClientPlugin +from microsoft.teams.ai import ChatPrompt +from microsoft.teams.openai import OpenAICompletionsAIModel + +# Create MCP client plugin +mcp_client = McpClientPlugin() + +# Connect to MCP servers +mcp_client.use_mcp_server("https://example.com/mcp") + +# Use with ChatPrompt +model = OpenAICompletionsAIModel(api_key="your-api-key", model="gpt-4") +prompt = ChatPrompt(model, plugins=[mcp_client]) +``` + +### MCP Server (Expose Tools) + +```python +from microsoft.teams.apps import App +from microsoft.teams.mcpplugin import McpServerPlugin +from microsoft.teams.ai import Function +from pydantic import BaseModel + +# Create MCP server plugin +mcp_server = McpServerPlugin(name="my-mcp-server") + +# Define a tool +class EchoParams(BaseModel): + input: str + +async def echo_handler(params: EchoParams) -> str: + return f"You said {params.input}" + +# Register tool with MCP server +mcp_server.use_tool( + Function( + name="echo", + description="Echo back whatever you said", + parameter_schema=EchoParams, + handler=echo_handler + ) +) + +app = App(plugins=[mcp_server]) +``` diff --git a/packages/openai/README.md b/packages/openai/README.md index a0769799..9089975b 100644 --- a/packages/openai/README.md +++ b/packages/openai/README.md @@ -7,10 +7,27 @@ + + +

-OpenAI model implementations to be used with @microsoft-teams-ai package. Supports all OpenAI-like API models. - - - +OpenAI model implementations for Microsoft Teams AI applications. +Supports OpenAI and OpenAI-compatible APIs for chat completions and embeddings. + +## Installation + +```bash +uv add microsoft-teams-openai +``` + +## Usage + +```python +from microsoft.teams.openai import OpenAICompletionsAIModel +from microsoft.teams.ai import ChatPrompt + +model = OpenAICompletionsAIModel(api_key="your-api-key", model="gpt-4") +prompt = ChatPrompt(model) +``` \ No newline at end of file