coco-microsoft-bot-framework-0.0.1


توضیحات

CoCo(Conversational Components) SDK for using components with Microsoft Bot Framework.
ویژگی مقدار
سیستم عامل -
نام فایل coco-microsoft-bot-framework-0.0.1
نام coco-microsoft-bot-framework
نسخه کتابخانه 0.0.1
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Victor Vasiliev
ایمیل نویسنده victor@a-i.com
آدرس صفحه اصلی https://github.com/conversationalcomponents/coco-microsoft-bot-framework
آدرس اینترنتی https://pypi.org/project/coco-microsoft-bot-framework/
مجوز MIT
# 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. ```python 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. ```python 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". ```python 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.") ```


نیازمندی

مقدار نام
- coco-sdk
- botbuilder-core


زبان مورد نیاز

مقدار نام
>=3.6 Python


نحوه نصب


نصب پکیج whl coco-microsoft-bot-framework-0.0.1:

    pip install coco-microsoft-bot-framework-0.0.1.whl


نصب پکیج tar.gz coco-microsoft-bot-framework-0.0.1:

    pip install coco-microsoft-bot-framework-0.0.1.tar.gz