Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/activities/check_funding_relevance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@

"""LLM-based funding relevance check activity."""

from datetime import timedelta

from pydantic import BaseModel, Field
from temporalio import activity
from temporalio.common import RetryPolicy

from app.agent import build_agent
from app.config import get_settings
from app.observability import propagate_langfuse_context
from app.workflows.specs import WorkflowContext

FUNDING_WORKFLOW_RETRY_POLICY = RetryPolicy(
initial_interval=timedelta(seconds=5),
backoff_coefficient=2,
maximum_interval=timedelta(seconds=20),
maximum_attempts=3,
)


class CheckFundingRelevanceRequest(BaseModel):
"""Request to check if record metadata matches an award description."""
Expand Down
2 changes: 2 additions & 0 deletions app/workflows/check_funding_relevance_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from temporalio import workflow

from app.activities.check_funding_relevance import (
FUNDING_WORKFLOW_RETRY_POLICY,
CheckFundingRelevanceRequest,
CheckFundingRelevanceResponse,
check_funding_relevance,
Expand Down Expand Up @@ -61,6 +62,7 @@ async def run(
context,
],
start_to_close_timeout=timedelta(minutes=2),
retry_policy=FUNDING_WORKFLOW_RETRY_POLICY,
)
except Exception:
await workflow.execute_activity(
Expand Down