Skip to main content

A Toolkit to work with components in Microsoft Bot Framework

Installation (We recommend using a virtualenv):

pip install coco-microsoft-bot-framework 

Setup:

Setting Conversation State

in app.py, include the lines below.

from coco_microsoft_bot_framework import CoCoActivityHandler
from botbuilder.core import (
    BotFrameworkAdapterSettings,
    TurnContext,
    BotFrameworkAdapter,
    UserState,
    MemoryStorage,
    ConversationState,
)

MEMORY = MemoryStorage()
CONVERSATION_STATE = ConversationState(MEMORY)
# Create the Bot
BOT = MyBot(CONVERSATION_STATE)

Setting Activity Handler

in bot.py

Import CoCo custom Activity Handler, then use it to create your bot. At the on_message_activity method add the three lines as below, in order to manage CoCo context during the conversation.

from coco_microsoft_bot_framework import CoCoActivityHandler

class MyBot(CoCoActivityHandler):

    async def on_message_activity(self, turn_context: TurnContext):
        if self.is_component_active():
            await self.call_active_component(turn_context)
            return

Activate CoCo Component

Activate CoCo register component, which ID is: "register_vp3".

class MyBot(CoCoActivityHandler):

    async def on_message_activity(self, turn_context: TurnContext):
        if self.is_component_active():
            await self.call_active_component(turn_context)
            return

        if intent == "register":
            await self.activate_component(turn_context, "register_vp3")
        else:
            await turn_context.send_activity("I don't understand.")

Metadata

Release files for coco-microsoft-bot-framework 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coco-microsoft-bot-framework 0.0.1
File Size Uploaded Provenance Actions
coco-microsoft-bot-framework-0.0.1.tar.gz 3.2 kB Without provenance Details for coco-microsoft-bot-framework-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for coco-microsoft-bot-framework 0.0.1
File Interpreter ABI Platform Actions
coco_microsoft_bot_framework-0.0.1-py3-none-any.whl Python 3 none any Details for coco_microsoft_bot_framework-0.0.1-py3-none-any.whl

Total release size: 7.1 kB

Release files / coco-microsoft-bot-framework-0.0.1.tar.gz

Download URL coco-microsoft-bot-framework-0.0.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ac42acda674ad83ae9c3fc4734e7a5ce6e88148ddb41cb2cccf146c15a28852e
BLAKE2b-256 checksum
How to use checksums
2d84af484798209a8fc9cc31a4be93e050957d8d2bafa6f2cbfe8a417be65d71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

Release files / coco_microsoft_bot_framework-0.0.1-py3-none-any.whl

Download URL coco_microsoft_bot_framework-0.0.1-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1767bcd4c31cfb50b08b3062d02db776b17460f4234dc46fa67a7cefc519d45
BLAKE2b-256 checksum
How to use checksums
8c10c10a1344f907da7e76d9433b14f70a0498e6c9f1d1ed29f5879ca26ff118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

Security for coco-microsoft-bot-framework 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page