8000 Sample started, skills moved to core · itsmokha/botbuilder-python@6f57afe · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f57afe

Browse files
committed
Sample started, skills moved to core
1 parent 691ab59 commit 6f57afe

26 files changed

+248
-758
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
# --------------------------------------------------------------------------
7+
8+
from .bot_framework_http_client import BotFrameworkHttpClient
9+
from .channel_service_handler import ChannelServiceHandler
10+
from .skill_conversation_id_factory import SkillConversationIdFactory
11+
12+
__all__ = [
13+
"BotFrameworkHttpClient",
14+
"ChannelServiceHandler",
15+
"SkillConversationIdFactory",
16+
]

libraries/botbuilder-core/botbuilder/core/integration/aiohttp_channel_service.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from .channel_service_handler import ChannelServiceHandler
99

10+
1011
async def deserialize_activity(request: Request) -> Activity:
1112
if "application/json" in request.headers["Content-Type"]:
1213
body = await request.json()
@@ -15,6 +16,7 @@ async def deserialize_activity(request: Request) -> Activity:
1516

1617
return Activity().deserialize(body)
1718

19+
1820
def channel_service_routes(handler: ChannelServiceHandler) -> RouteTableDef:
1921
routes = RouteTableDef()
2022

@@ -24,7 +26,7 @@ async def send_to_conversation(request: Request):
2426
return await handler.handle_send_to_conversation(
2527
request.headers.get("Authorization"),
2628
request.match_info["conversation_id"],
27-
activity
29+
activity,
2830
)
2931

3032
@routes.post("/{conversation_id}/activities/{activity_id}")
@@ -34,7 +36,7 @@ async def reply_to_activity(request: Request):
3436
request.headers.get("Authorization"),
3537
request.match_info["conversation_id"],
3638
request.match_info["activity_id"],
37-
activity
39+
activity,
3840
)
3941

4042
@routes.put("/{conversation_id}/activities/{activity_id}")
@@ -44,15 +46,15 @@ async def update_activity(request: Request):
4446
request.headers.get("Authorization"),
4547
request.match_info["conversation_id"],
4648
request.match_info["activity_id"],
47-
activity
49+
activity,
4850
)
4951

5052
@routes.delete("/{conversation_id}/activities/{activity_id}")
5153
async def delete_activity(request: Request):
5254
return await handler.handle_delete_activity(
5355
request.headers.get("Authorization"),
5456
request.match_info["conversation_id"],
55-
request.match_info["activity_id"]
57+
request.match_info["activity_id"],
5658
)
5759

5860
@routes.get("/{conversation_id}/activities/{activity_id}/members")

libraries/botbuilder-core/botbuilder/core/integration/channel_service_handler.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ async def handle_send_to_conversation(
5050
self, auth_header, conversation_id, activity
5151
9E88 ) -> ResourceResponse:
5252
claims_identity = await self._authenticate(auth_header)
53-
return await self.on_send_to_conversation(claims_identity, conversation_id, activity)
53+
return await self.on_send_to_conversation(
54+
claims_identity, conversation_id, activity
55+
)
5456

5557
async def handle_reply_to_activity(
5658
self, auth_header, conversation_id, activity_id, activity
@@ -118,7 +120,9 @@ async def handle_delete_conversation_member(
118120
self, auth_header, conversation_id, member_id
119121
):
120122
claims_identity = await self._authenticate(auth_header)
121-
await self.on_delete_conversation_member(claims_identity, conversation_id, member_id)
123+
await self.on_delete_conversation_member(
124+
claims_identity, conversation_id, member_id
125+
)
122126

123127
async def handle_send_conversation_history(
124128
self, auth_header, conversation_id, transcript: Transcript
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
from abc import ABC, abstractmethod
5+
from typing import Tuple
6+
7+
8+
class SkillConversationIdFactory(ABC):
9+
@abstractmethod
10+
def create_skill_conversation_id(
11+
self, conversation_id: str, service_url: str
12+
) -> str:
13+
raise NotImplementedError()
14+
15+
@abstractmethod
16+
def get_conversation_info(self, encoded_conversation_id: str) -> Tuple[str, str]:
17+
raise NotImplementedError()

libraries/botbuilder-skills/botbuilder/skills/__init__.py renamed to libraries/botbuilder-core/botbuilder/core/skills/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# --------------------------------------------------------------------------
77

88
from .about import __version__
9-
from .adapters import *
9+
from .bot_framework_skill import BotFrameworkSkill
10+
from .skill_handler import SkillHandler
1011

11-
__all__ = []
12+
13+
__all__ = ["BotFrameworkSkill", "SkillHandler"]

0 commit comments

Comments
 (0)
0