nxt::ai::responses namespace

Classes

template <typename Transport>
class openai_response_stream
struct openai_responses_request
Parameters for one OpenAI Responses API request.
struct protocol_error
struct stream_event
One decoded server-sent event from a streaming Responses request.

Functions

auto input_items_from_request(const openai_responses_request& request) →  nlohmann::json
Return the structured input array represented by a request.
auto openai_responses_body(const openai_responses_request& request) →  nlohmann::json
Serialize a request into a JSON body for POST /v1/responses.
auto openai_responses_http_request(const openai_responses_request& request) →  nxt::http::request
Build the HTTP request envelope for the OpenAI Responses endpoint.
auto response_id_from_event(const stream_event& event) →  std::optional<std::string>
Extract a response id from events that carry one.

Function documentation

nlohmann::json nxt::ai::responses::input_items_from_request(const openai_responses_request& request)

Return the structured input array represented by a request.

nlohmann::json nxt::ai::responses::openai_responses_body(const openai_responses_request& request)

Serialize a request into a JSON body for POST /v1/responses.

nxt::http::request nxt::ai::responses::openai_responses_http_request(const openai_responses_request& request)

Build the HTTP request envelope for the OpenAI Responses endpoint.

std::optional<std::string> nxt::ai::responses::response_id_from_event(const stream_event& event)

Extract a response id from events that carry one.