forked from temporalio/samples-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathend_chat.py
More file actions
25 lines (17 loc) · 707 Bytes
/
end_chat.py
File metadata and controls
25 lines (17 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import asyncio
import sys
from temporalio.client import Client
from temporalio.envconfig import ClientConfig
from workflows import EntityBedrockWorkflow
async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(**config)
workflow_id = "entity-bedrock-workflow"
handle = client.get_workflow_handle_for(EntityBedrockWorkflow.run, workflow_id)
# Sends a signal to the workflow
await handle.signal(EntityBedrockWorkflow.end_chat)
if __name__ == "__main__":
print("Sending signal to end chat.")
asyncio.run(main())