Files
microsoft--agent-framework/python/packages/hosting-responses
Giles Odigwe e39a8a2e79
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
Python: Bump Python package versions for 1.13.0 release (#7443)
* Bump Python package versions for 1.13.0 release

Bump all 37 Python package projects because the CHANGELOG-driven release includes cross-package feature-usage telemetry, with core and root advancing to 1.13.0, OpenAI to 1.12.0, patch bumps for other stable packages, and 260730 stamps for alpha and beta packages. No optional beta cohort bump was applied; every prerelease package changed. Raise core floors conservatively across co-released packages.

Copilot-Session: e234a28b-c2fd-4ff4-a51d-3d8917936541

* Align co-released Python package dependencies

Update the four hosting adapter pins to the co-released agent-framework-hosting alpha and raise the Azure Functions Durable Task floor to the co-released beta.

Copilot-Session: e234a28b-c2fd-4ff4-a51d-3d8917936541

* Minimize Python release lockfile updates

Regenerate uv.lock with the pre-commit hook pinned uv version so the release changes only workspace package versions while preserving platform markers and agentlightning 0.3.0.

Copilot-Session: e234a28b-c2fd-4ff4-a51d-3d8917936541

---------

Copilot-Session: e234a28b-c2fd-4ff4-a51d-3d8917936541
2026-07-30 22:47:07 +00:00
..

agent-framework-hosting-responses

OpenAI Responses-shaped helpers for app-owned Agent Framework hosting.

This package provides the Responses-specific conversion layer:

  • responses_to_run(...) — convert a Responses request body into Agent Framework run values.
  • responses_session_id(...) — return (session_id, is_conversation_id) for a prior resp_* response id or conv_* conversation id, or (None, None) when neither is present.
  • create_conversation_id(...) — mint a Responses-shaped conversation id.
  • create_response_id(...) — mint a Responses-shaped response id.
  • responses_from_run(...) — convert an AgentResponse into a Responses-compatible JSON payload.
  • responses_from_streaming_run(...) — convert an Agent Framework ResponseStream into Responses-compatible SSE events.

FastAPI/Starlette/Django/Azure Functions code owns route registration, authentication, status codes, response construction, and background work.

from agent_framework_hosting import AgentState
from agent_framework_hosting_responses import (
    create_response_id,
    responses_from_run,
    responses_session_id,
    responses_to_run,
)
from fastapi import Body, FastAPI
from fastapi.responses import JSONResponse

app = FastAPI()
state = AgentState(agent)


@app.post("/responses")
async def responses(body: dict = Body(...)) -> JSONResponse:
    run = responses_to_run(body)
    session_id, is_conversation_id = responses_session_id(body)
    response_id = create_response_id()
    session = await state.get_or_create_session(session_id or response_id)
    result = await (await state.get_target()).run(
        run["messages"],
        session=session,
        options=run["options"],
    )
    if is_conversation_id:
        # The app must serialize writers that advance this stable id.
        await state.set_session(session_id, session)
    else:
        await state.set_session(response_id, session)
    conversation_id = session_id if is_conversation_id else None
    return JSONResponse(responses_from_run(result, response_id=response_id, conversation_id=conversation_id))

previous_response_id identifies an immutable continuation snapshot: multiple requests may branch from it and store their results under distinct new response ids. conversation_id is a mutable head instead; only one caller should advance it at a time. These helpers do not provide per-conversation locking.

AgentState lives in agent-framework-hosting. The experimental in-memory and file-backed session stores live in core as agent_framework.SessionStore and agent_framework.FileSessionStore.