# Teams AI Library - C# Documentation > Microsoft Teams AI Library (v2) - A comprehensive framework for building AI-powered Teams applications using C#. Using this Library, you can easily build and integrate a variety of features in Microsoft Teams by building Agents or Tools. The documentation here helps by giving background information and code samples on how best to do this. IMPORTANT: This Library is NOT based off of BotFramework (which the _previous_ version of the Teams AI Library was based on). This Library is a completely new framework. ## Main Documentation ### [Teams](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/teams.txt) Overview of Teams-specific features and SDK components that enable agent integration with the Microsoft Teams platform. - [Core Concepts](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/teams-core-concepts.txt): Understand Teams app architecture including app registration, Azure Bot Service, DevTunnel, and sideloading processes. - [Manifest](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/teams-manifest.txt): Learn about Teams app manifest requirements, permissions, and sideloading process for app installation. - [Agents Toolkit](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/microsoft-365-agents-toolkit.txt): Automate Teams app development with Microsoft 365 Agents Toolkit for manifest management, sideloading, and deployment. ### [Developer Tools](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/developer-tools.txt) Overview of developer tools in Teams AI Library v2 including the CLI for project management and DevTools for testing and debugging agents. - [Cli](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/teams-cli.txt): Comprehensive guide to the Teams CLI tool for creating, managing, and deploying Teams AI applications with simple command-line operations. Use this when you need to set up a new Teams AI agent or manage existing ones. ## C# Specific Documentation ### [Getting Started](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/getting-started.txt) Getting started guide for C# Teams AI Library covering application setup, structure, and local development. - [Quickstart](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/quickstart.txt): Quick start guide for C# Teams AI Library v2 using the Teams CLI to create and run your first .NET agent. - [Code Basics](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/code-basics.txt): Understanding the structure and key components of a C# Teams AI application including the Application class, dependency injection, and project organization. - [Running In Teams](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/running-in-teams.txt): Guide to deploying and testing your locally running C# agent in Microsoft Teams using the Microsoft 365 Agents Toolkit. - [LLMs](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/llmstxt.txt): Links to LLM context files for coding assistants to access C# Teams AI documentation for development support. ### [Essentials](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/essentials.txt) Introduction to core concepts and paradigms for building C# Teams AI applications that handle events and activities. - [App Basics](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/app-basics.txt): Overview of the App class in C# Teams AI, covering server hosting, request routing, authentication, and plugin management. - [On Event](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/listening-to-events.txt): Guide to handling and responding to events in C# Teams AI applications, including user and server-originated events. - [Api](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/teams-api-client.txt): Guide to using the Teams API Client in C#, covering conversation management, meeting access, and team/channel operations through the app.Api object, with examples of both handler-based and proactive API usage. - [Graph](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/graph-api-client.txt): A guide to using the Microsoft Graph API in C#, explaining the methods for accessing Microsoft 365 data using application or user tokens, with sample code for retrieving user details and integrating Graph API within message handlers. ### On Activity - [README](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/listening-to-activities.txt): Learn how to handle Teams activities in C# using activity handlers, which process Teams-specific payloads like chat messages, card actions, and app installations through a middleware pattern that supports both controller and minimal API styles. ### Sending Messages - [Proactive Messaging](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/proactive-messaging.txt): Guide to implementing proactive messaging in C# Teams applications, demonstrating how to store conversation IDs and send messages to users without requiring a trigger message, useful for notifications and reminders. - [README](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/sending-messages.txt): Comprehensive guide to sending messages in Teams using C#, covering basic text messages, streaming for long-form content, and @mentions, with examples in both controller and minimal API styles. ### [In Depth Guides](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/in-depth-guides.txt) Detailed technical guides covering advanced features and capabilities of Teams AI Library in C#, including AI integration, adaptive cards, dialogs, authentication, and message extensions. - [Feedback](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/feedback.txt): Guide to implementing user feedback functionality in Teams applications, covering feedback UI components, event handling, and storage mechanisms for gathering and managing user responses to improve application performance. ### [Adaptive Cards](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/adaptive-cards.txt) Overview of Adaptive Cards in C# Teams AI for building rich, interactive user experiences in Teams applications. - [Building Adaptive Cards](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/building-adaptive-cards.txt): Learn to create Adaptive Cards in C# using builder helpers, enabling type-safe, maintainable UI development with IntelliSense support, visual designer integration, and end-to-end examples for interactive forms. - [Executing Actions](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/executing-actions.txt): Guide to implementing interactive elements in Adaptive Cards using C#, covering action types (Execute, Submit, OpenUrl), input validation, data association, and server-side handling of card actions. ### [Dialogs](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/dialogs.txt) Overview of dialogs (task modules) in C# Teams AI for creating interactive pop-up windows and multi-step forms in Teams. - [Creating Dialogs](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/creating-dialogs.txt): Guide to creating and handling dialogs in Teams applications, covering dialog opening mechanisms, content rendering using Adaptive Cards or webpages, and security considerations for web content integration. - [Handling Dialog Submissions](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/handling-dialog-submissions.txt): Guide to processing dialog submissions in Teams applications, showing how to handle form data from both Adaptive Cards and web pages using the dialog.submit event handler with examples for different submission types. - [Handling Multi Step Forms](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/handling-multi-step-forms.txt): Tutorial on implementing multi-step dialogs in Teams, demonstrating how to create dynamic form flows that adapt based on user input, with examples of handling state between steps and conditional navigation. ### [Message Extensions](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/message-extensions.txt) Overview of message extensions in C# Teams AI for enhancing productivity with custom actions and search in Teams messages. - [Action Commands](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/action-commands.txt): Learn how to create action commands for message extensions that present modal dialogs to collect or display information in Teams. - [Search Commands](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/search-commands.txt): Create search commands that allow users to search external systems and insert results as cards in Teams messages. - [Settings](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/settings.txt): Add configurable settings pages to your message extensions to allow users to customize app behavior. - [Link Unfurling](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/link-unfurling.txt): Enable your app to respond when users paste URLs by creating preview cards with additional information and actions. ### [User Authentication](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/user-authentication.txt) Enable user authentication in Teams apps to access secured resources like email, flight status, and online services. - [Quickstart](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/quickstart.txt): Create a Teams app with Microsoft Graph authentication using the Agents Toolkit and SSO flow. - [Auth Sso](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/how-auth-works.txt): Compare OAuth and SSO authentication methods in Teams apps and understand their implementation differences. - [Setup](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/app-setup.txt): Guide to configuring user authentication in C# Teams AI applications, including OAuth setup and secure API access. - [Signin](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/signing-in.txt): How to implement user sign-in with OAuth in C# Teams AI applications using the built-in signin method. - [Signout](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/signing-out.txt): Sign users out of your Teams app by discarding cached access tokens in the Bot Framework token service. ### [Ai](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/ai.txt) Overview of AI components in C# Teams AI, including Prompts for orchestration and Models for LLM interfaces. - [Setup And Prereqs](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/setup-prerequisites.txt): Prerequisites and setup guide for integrating LLMs into C# Teams AI applications, including API keys and configuration. - [Chat](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/chat-generation.txt): Comprehensive guide to implementing chat generation with LLMs in Teams, covering setup with ChatPrompt and Model objects, basic message handling, and streaming responses for improved user experience. - [Function Calling](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/functions.txt): Guide to implementing function calling in LLMs, showing how to integrate custom functions into ChatPrompt for task automation, including both single and multiple function scenarios with context-aware execution. - [Keeping State](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/keeping-state.txt): Guide to managing conversation state in LLM interactions, explaining how to maintain chat history using ChatPrompt's state management capabilities and implementing custom persistence strategies for multi-conversation scenarios. - [Best Practices](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/best-practices.txt): Best practices for AI integration in Teams applications, including AI-generated message indicators, feedback collection for prompt improvement, and citation handling to ensure transparency and accuracy in AI responses. ### [Mcp](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/mcp.txt) Overview of Model Context Protocol (MCP) integration in C# Teams AI for dynamic function and tool loading. - [Mcp Server](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/mcp-server.txt): Tutorial on implementing an MCP (Machine Conversation Protocol) server in Teams applications using the McpPlugin, covering server configuration, tool exposure, and message handling for features like human-in-the-loop interactions and notifications. - [Mcp Client](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/mcp-client.txt): Guide to integrating remote MCP (Machine Conversation Protocol) servers into Teams applications, enabling AI agents to access external tools through SSE protocol, with practical examples of configuring the MCPClientPlugin. ### [Tabs](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/tabs.txt) Overview of Tabs in C# Teams AI for building host-aware web apps with authentication, Graph integration, and agent function calls. - [Getting Started](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/getting-started.txt): Set up new tab app projects or add Teams client capabilities to existing tab applications. - [Using The App](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/using-the-app.txt): Initialize and use the Teams client App to call Graph APIs and remote agent functions. - [App Options](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/app-options.txt): Configure app settings for observability, MSAL authentication, and remote agent function calling. - [Function Calling](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/functions.txt): Call remote agent functions from tab apps with authentication and custom headers using the exec() method. - [Graph](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/microsoft-graph-client.txt): Access Microsoft Graph APIs with type-safe client and manage user consent for permissions. ### [Observability](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/observability.txt) Overview of observability features in C# Teams AI for monitoring, logging, and diagnostics in Teams applications. - [Middleware](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/middleware.txt): Guide to using middleware in C# Teams AI for logging, validation, and extending app functionality. - [Logging](https://microsoft.github.io/teams-ai/llms_docs/docs_csharp/custom-logger.txt): Guide to implementing custom logging in C# Teams AI applications using the ConsoleLogger and custom logger options.