Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
EventStreamNotFoundError,
streams,
)
from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled
from azure.ai.agentserver.invocations import InvocationAgentServerHost

try:
Expand All @@ -82,6 +83,12 @@

app = InvocationAgentServerHost()

# Opt into resilient-task startup recovery. This sample declares a durable
# task, so the framework would enable recovery automatically; we set the switch
# explicitly to make the intent clear and to keep recovery working even if the
# task is ever registered lazily (after startup).
set_resilient_tasks_enabled(True)
Comment thread
Shivakishore14 marked this conversation as resolved.


async def _sse_from_stream(
stream: EventStream, invocation_id: str, *, initial_status: str = "queued"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from starlette.requests import Request
from starlette.responses import JSONResponse, Response

from azure.ai.agentserver.core.tasks import TaskConflictError
from azure.ai.agentserver.core.tasks import TaskConflictError, set_resilient_tasks_enabled
from azure.ai.agentserver.invocations import InvocationAgentServerHost

try:
Expand All @@ -46,6 +46,12 @@

app = InvocationAgentServerHost()

# Opt into resilient-task startup recovery. This sample declares a durable
# task, so the framework would enable recovery automatically; we set the switch
# explicitly to make the intent clear and to keep recovery working even if the
# task is ever registered lazily (after startup).
set_resilient_tasks_enabled(True)


@app.invoke_handler
async def handle_invoke(request: Request) -> Response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
EventStreamNotFoundError,
streams,
)
from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled
from azure.ai.agentserver.invocations import InvocationAgentServerHost

try:
Expand All @@ -101,6 +102,12 @@

app = InvocationAgentServerHost()

# Opt into resilient-task startup recovery. This sample declares a durable
# task, so the framework would enable recovery automatically; we set the switch
# explicitly to make the intent clear and to keep recovery working even if the
# task is ever registered lazily (after startup).
set_resilient_tasks_enabled(True)


# --- SSE rendering ---------------------------------------------------------

Expand Down
Loading