Skip to content

Commit

Permalink
fix: Start workflows asynchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed Sep 17, 2024
1 parent b1ba790 commit a7ec9d5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions agents-api/agents_api/clients/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,25 @@ async def get_workflow_handle(
async def run_truncation_task(
token_count_threshold: int, developer_id: UUID, session_id: UUID, job_id: UUID
):
from ..workflows.truncation import TruncationWorkflow

client = await get_client()

await client.execute_workflow(
"TruncationWorkflow",
await client.start_workflow(
TruncationWorkflow.run,
args=[str(developer_id), str(session_id), token_count_threshold],
task_queue="memory-task-queue",
id=str(job_id),
)


async def run_summarization_task(session_id: UUID, job_id: UUID):
from ..workflows.summarization import SummarizationWorkflow

client = await get_client()

await client.execute_workflow(
"SummarizationWorkflow",
await client.start_workflow(
SummarizationWorkflow.run,
args=[str(session_id)],
task_queue="memory-task-queue",
id=str(job_id),
Expand Down

0 comments on commit a7ec9d5

Please sign in to comment.