or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

activity-types-enums.mdattachments-media.mdauthentication-oauth.mdchannel-conversation.mdcore-activity.mdentities-semantic.mdindex.mdrich-cards.mdteams-integration.md
tile.json

tessl/pypi-botbuilder-schema

BotBuilder-schema contains the serialized data sent across the wire between user and bot when using Bot Framework

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/botbuilder-schema@4.17.x

To install, run

npx @tessl/cli install tessl/pypi-botbuilder-schema@4.17.0

index.mddocs/

BotBuilder Schema

BotBuilder-schema contains the serialized data sent across the wire between user and bot when using Bot Framework. This package provides comprehensive data models for activities, conversations, channels, attachments, and authentication flows, serving as the foundational schema layer for Microsoft Bot Framework applications.

Package Information

  • Package Name: botbuilder-schema
  • Language: Python
  • Installation: pip install botbuilder-schema
  • Dependencies: msrest==0.7.*, urllib3

Core Imports

from botbuilder.schema import Activity, ChannelAccount, ConversationAccount

Activity types and enums:

from botbuilder.schema import ActivityTypes, RoleTypes, TextFormatTypes

Teams extension:

from botbuilder.schema.teams import TeamsChannelData, TaskModuleRequest

Basic Usage

from botbuilder.schema import (
    Activity, 
    ActivityTypes, 
    ChannelAccount, 
    ConversationAccount,
    TextFormatTypes
)

# Create a simple message activity
message = Activity(
    type=ActivityTypes.message,
    text="Hello, World!",
    from_property=ChannelAccount(id="user123", name="User"),
    recipient=ChannelAccount(id="bot456", name="Bot"),
    conversation=ConversationAccount(id="conversation789"),
    channel_id="webchat",
    text_format=TextFormatTypes.plain
)

# Create a conversation update activity
update = Activity(
    type=ActivityTypes.conversation_update,
    members_added=[ChannelAccount(id="newuser", name="New User")],
    conversation=ConversationAccount(id="conversation789"),
    channel_id="webchat"
)

# Create a reply to an existing activity
reply = message.create_reply("Thanks for your message!")

Architecture

The BotBuilder Schema follows a hierarchical design:

  • Activity: Central communication model containing all message types, events, and conversation updates
  • Channel Models: Account and conversation representations for different chat platforms
  • Card Models: Rich interactive content (Hero, Thumbnail, Receipt, OAuth, etc.)
  • Attachment Models: File and media handling structures
  • Entity Models: Semantic data like mentions, places, and geographic coordinates
  • Teams Extension: Microsoft Teams-specific models for meetings, task modules, and O365 connectors

All models inherit from msrest.serialization.Model providing automatic JSON serialization for REST API communication across Bot Framework channels.

Capabilities

Core Activity Management

The foundational Activity model and supporting types that enable communication between bots and users across all Bot Framework channels. Includes activity creation, manipulation, and conversation management.

class Activity(Model):
    def __init__(self, *, type: str = None, id: str = None, 
                 text: str = None, from_property = None, 
                 recipient = None, conversation = None, **kwargs): ...
    def create_reply(self, text: str = None) -> 'Activity': ...
    def apply_conversation_reference(self, reference: 'ConversationReference') -> 'Activity': ...
    def get_conversation_reference(self) -> 'ConversationReference': ...
    def has_content(self) -> bool: ...

Core Activity Management

Channel and Conversation Models

Account and conversation representations that identify participants and conversation contexts across different chat platforms and channels.

class ChannelAccount(Model):
    def __init__(self, *, id: str = None, name: str = None, 
                 aad_object_id: str = None, role: str = None, **kwargs): ...

class ConversationAccount(Model):
    def __init__(self, *, is_group: bool = None, conversation_type: str = None,
                 id: str = None, name: str = None, **kwargs): ...

Channel and Conversation Models

Rich Card Components

Interactive card models for creating rich user experiences including hero cards, thumbnails, receipts, OAuth flows, and media content with buttons and actions.

class HeroCard(Model):
    def __init__(self, *, title: str = None, subtitle: str = None,
                 text: str = None, images: List = None, buttons: List = None, **kwargs): ...

class CardAction(Model):
    def __init__(self, *, type: str = None, title: str = None,
                 value = None, **kwargs): ...

Rich Card Components

Attachment and Media Handling

File attachment and media management models supporting upload, download, and display of documents, images, audio, and video content.

class Attachment(Model):
    def __init__(self, *, content_type: str = None, content_url: str = None,
                 content = None, name: str = None, **kwargs): ...

class AttachmentData(Model):
    def __init__(self, *, type: str = None, name: str = None,
                 original_base64: str = None, **kwargs): ...

Attachment and Media Handling

Authentication and OAuth

OAuth token management, authentication flows, and signin processes including token requests, responses, and exchange mechanisms for secure bot authentication.

class TokenResponse(Model):
    def __init__(self, *, connection_name: str = None, token: str = None,
                 expiration: str = None, **kwargs): ...

class TokenRequest(Model):
    def __init__(self, *, provider: str = None, settings: dict = None, **kwargs): ...

Authentication and OAuth

Activity Types and Enums

Comprehensive enumeration types defining activity types, role types, input hints, action types, and other standardized values used throughout the Bot Framework.

class ActivityTypes(str, Enum):
    message = "message"
    conversation_update = "conversationUpdate"
    typing = "typing"
    # ... additional types

class RoleTypes(str, Enum):
    user = "user"
    bot = "bot"
    skill = "skill"

Activity Types and Enums

Entities and Semantic Data

Semantic entity models for representing structured data like mentions, places, geographic coordinates, and generic schema.org entities within Bot Framework activities.

class Entity(Model):
    def __init__(self, *, type: str = None, **kwargs): ...

class GeoCoordinates(Model):
    def __init__(self, *, elevation: float = None, latitude: float = None,
                 longitude: float = None, type: str = None, name: str = None, **kwargs): ...

class Place(Model):
    def __init__(self, *, address=None, geo=None, has_map=None,
                 type: str = None, name: str = None, **kwargs): ...

class Thing(Model):
    def __init__(self, *, type: str = None, name: str = None, **kwargs): ...

Entities and Semantic Data

Microsoft Teams Integration

Teams-specific models for meetings, task modules, messaging extensions, O365 connector cards, and file handling within Microsoft Teams environments.

class TeamsChannelData(Model):
    def __init__(self, *, team = None, channel = None, meeting = None, **kwargs): ...

class TaskModuleRequest(Model):
    def __init__(self, *, data = None, context = None, **kwargs): ...

Microsoft Teams Integration

Types

Core Types

# Import from botbuilder.schema
Activity: Model
ChannelAccount: Model  
ConversationAccount: Model
ConversationReference: Model
ResourceResponse: Model
ErrorResponse: Model

Enum Types

# Activity and message types
ActivityTypes: Enum
RoleTypes: Enum
TextFormatTypes: Enum
ActivityImportance: Enum

# Action and input types  
ActionTypes: Enum
InputHints: Enum
AttachmentLayoutTypes: Enum
MessageReactionTypes: Enum

# Status and flow types
EndOfConversationCodes: Enum
DeliveryModes: Enum
ContactRelationUpdateActionTypes: Enum
InstallationUpdateActionTypes: Enum

Constant Types

# Authentication constants
SignInConstants: Enum
CallerIdConstants: Enum

# Speech synthesis constants
SpeechConstants: class