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 1847be2 commit f1f55b3
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 f1f55b3

Please sign in to comment.