d08200d00e
* Bump Python package versions for 1.12.0 release Bump packages represented in the 1.12.0 changelog, promote Foundry Hosting, Azure Content Understanding, Gemini, Mistral, Monty, and Tools to beta, and apply the requested beta cohort date stamp. Root and core move to 1.12.0, released and RC packages use their selected increments, alpha packages including Hosting MCP use the 260721 stamp, and core floors are raised only for proven consumers. Copilot-Session: 2dd9980a-b869-4c16-8642-75b7a6d6ebdf * fix version in readme * Add Responses conversation ID changes to release notes Include the breaking Hosting Responses conversation ID helper changes from #7234 in the Python 1.12.0 changelog. Copilot-Session: 2dd9980a-b869-4c16-8642-75b7a6d6ebdf
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 priorresp_*response id orconv_*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 anAgentResponseinto a Responses-compatible JSON payload.responses_from_streaming_run(...)— convert an Agent FrameworkResponseStreaminto 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.
The base execution-state helpers live in
agent-framework-hosting.