Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
cake-bot
Commits
d61f7754
Commit
d61f7754
authored
Jan 27, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
health-check fixed
parent
38c6e7a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
33 deletions
+34
-33
app.py
app.py
+34
-33
No files found.
app.py
View file @
d61f7754
...
@@ -199,37 +199,39 @@ async def v1_get_health_check(_request: Request) -> Response:
...
@@ -199,37 +199,39 @@ async def v1_get_health_check(_request: Request) -> Response:
# key = await KEY_VAULT_CLIENT.create_key("pumpalot")
# key = await KEY_VAULT_CLIENT.create_key("pumpalot")
# encrypted_data = await KEY_VAULT_CLIENT.encrypt(key, b"hello")
# encrypted_data = await KEY_VAULT_CLIENT.encrypt(key, b"hello")
# decrypted_data = await KEY_VAULT_CLIENT.decrypt(key, encrypted_data)
# decrypted_data = await KEY_VAULT_CLIENT.decrypt(key, encrypted_data)
conversation_reference
=
await
BOT
.
cosmos_client
.
get_conversation
(
"a:1aStwF-2DE5JiwY3D56l6w1tEnb0N13ITGJL3Sj4fwnXwFblV1csv3EOsFEqvqQiKfOCvuaXoKuIpsU47QTnb4Pb_65G89EfgDzzL9EbhTDAi4eq4EG18xQGsjogUhlEo"
,
# conversation_reference = await BOT.cosmos_client.get_conversation(
"d3c0e3f9-060e-43d8-9d64-57fbb51d2003"
# "a:1aStwF-2DE5JiwY3D56l6w1tEnb0N13ITGJL3Sj4fwnXwFblV1csv3EOsFEqvqQiKfOCvuaXoKuIpsU47QTnb4Pb_65G89EfgDzzL9EbhTDAi4eq4EG18xQGsjogUhlEo",
)
# "d3c0e3f9-060e-43d8-9d64-57fbb51d2003"
conversation_reference
.
activity_id
=
'1674824975220'
# )
# conversation_reference.activity_id = '1674824975220'
async
def
cb
(
turn_context
:
TurnContext
):
#
""" callback """
# async def cb(turn_context: TurnContext):
activity
=
Activity
(
id
=
'1674825125020'
,
# """ callback """
type
=
ActivityTypes
.
message
)
# activity = Activity(id='1674825125020',
# type=ActivityTypes.message)
activity
.
attachments
=
[
#
CardFactory
.
adaptive_card
({
# activity.attachments = [
"type"
:
"AdaptiveCard"
,
# CardFactory.adaptive_card({
"$schema"
:
"http://adaptivecards.io/schemas/adaptive-card.json"
,
# "type": "AdaptiveCard",
"version"
:
"1.5"
,
# "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"body"
:
[
# "version": "1.5",
{
# "body": [
"type"
:
"TextBlock"
,
# {
"text"
:
"The card to be purged2"
,
# "type": "TextBlock",
"wrap"
:
True
# "text": "The card to be purged2",
}
# "wrap": True
]
# }
})
# ]
]
# })
response
=
await
turn_context
.
update_activity
(
activity
)
# ]
print
(
f
"response: {response}"
)
# response = await turn_context.update_activity(activity)
print
(
f
"activity: {activity}"
)
# print(f"response: {response}")
# print(f"activity: {activity}")
await
ADAPTER
.
continue_conversation
(
conversation_reference
,
cb
,
#
app_config
.
APP_ID
)
# await ADAPTER.continue_conversation(conversation_reference, cb,
# app_config.APP_ID)
Log
.
i
(
TAG
,
"v1_health_check::ok"
)
Log
.
i
(
TAG
,
"v1_health_check::ok"
)
return
Response
(
status
=
HTTPStatus
.
OK
,
content_type
=
"application/json"
)
return
Response
(
status
=
HTTPStatus
.
OK
,
content_type
=
"application/json"
)
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -289,8 +291,7 @@ async def v1_pa_message(request: Request) -> Response:
...
@@ -289,8 +291,7 @@ async def v1_pa_message(request: Request) -> Response:
try
:
try
:
request_text
=
await
request
.
text
()
request_text
=
await
request
.
text
()
body
=
json_loads
(
request_text
,
dict
())
body
=
json_loads
(
request_text
,
dict
())
# Add TTL here!
pa_message
=
PAMessage
.
get_schema
(
unknown
=
EXCLUDE
)
.
load
(
body
)
pa_message
=
PAMessage
.
get_schema
()
.
load
(
body
)
print
(
f
"request body: {body}, pa_message: {pa_message}
\r\n
"
)
print
(
f
"request body: {body}, pa_message: {pa_message}
\r\n
"
)
response
=
await
BOT
.
send_message
(
pa_message
)
response
=
await
BOT
.
send_message
(
pa_message
)
Log
.
d
(
TAG
,
f
"v1_pa_message::notification: '{response}'"
)
Log
.
d
(
TAG
,
f
"v1_pa_message::notification: '{response}'"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment