Temporal Cloud support

This commit is contained in:
Steve Androulakis
2025-01-10 14:13:32 -08:00
parent 22f9f6dee4
commit c623029c9d
9 changed files with 155 additions and 104 deletions

View File

@@ -1,12 +1,12 @@
import asyncio
from temporalio.client import Client
from workflows import ToolWorkflow
from shared.config import get_temporal_client
from workflows.tool_workflow import ToolWorkflow
async def main():
# Create client connected to server at the given address
client = await Client.connect("localhost:7233")
client = await get_temporal_client()
workflow_id = "agent-workflow"
handle = client.get_workflow_handle(workflow_id)
@@ -15,16 +15,7 @@ async def main():
history = await handle.query(ToolWorkflow.get_conversation_history)
print("Conversation History")
print(
*(f"{speaker.title()}: {message}\n" for speaker, message in history), sep="\n"
)
# Queries the workflow for the conversation summary
summary = await handle.query(ToolWorkflow.get_summary_from_history)
if summary is not None:
print("Conversation Summary:")
print(summary)
print(history)
if __name__ == "__main__":