Skip to content

Commit

Permalink
py changes for invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyydu committed Sep 12, 2024
1 parent ce53a82 commit 1398fd1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/packages/ai/teams/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ async def __handler__(context: TurnContext, state: StateT):
if not context.activity.value:
return False
await func(context, state, context.activity.value)
await context.send_activity(
Activity(
type=ActivityTypes.invoke_response,
value=InvokeResponse(status=200, body={}),
)
)
return True

self._routes.append(Route[StateT](__selector__, __handler__, True))
Expand Down Expand Up @@ -483,6 +489,12 @@ async def __handler__(context: TurnContext, state: StateT):
if not context.activity.value:
return False
await func(context, state, context.activity.value)
await context.send_activity(
Activity(
type=ActivityTypes.invoke_response,
value=InvokeResponse(status=200, body={}),
)
)
return True

self._routes.append(Route[StateT](__selector__, __handler__, True))
Expand Down

0 comments on commit 1398fd1

Please sign in to comment.