Files
nanobot/nanobot/providers/openai_responses/__init__.py
T
chengyongru 5be1e589f2 feat(providers): share Responses backend with Codex WebSocket continuation (#6096)
* feat(codex): continue sessions over Responses WebSocket

* fix(codex): retain API errors with repeated handshake headers

* test(codex): assert attachment paths before JSON escaping

* refactor(providers): share Responses transport and state backend

* fix(grok): update subscription client version

* docs: keep Codex configuration focused on user settings
2026-10-08 11:54:23 +08:00

59 lines
1.6 KiB
Python

"""Shared backend for providers that implement the OpenAI Responses protocol."""
from nanobot.providers.openai_responses.backend import ResponsesBackend, ResponsesWebSocketOptions
from nanobot.providers.openai_responses.converters import (
convert_messages,
convert_tools,
convert_user_message,
split_tool_call_id,
)
from nanobot.providers.openai_responses.parsing import (
FINISH_REASON_MAP,
ResponsesStreamCapture,
consume_responses_events,
consume_sdk_stream,
consume_sse,
consume_sse_with_reasoning,
is_replayable_finish_reason,
iter_sse,
map_finish_reason,
parse_response_output,
)
from nanobot.providers.openai_responses.state import (
build_responses_compaction_state,
build_responses_state,
is_compaction_compatibility_error,
prepare_responses_input,
resolve_compact_threshold,
responses_state_context_tokens,
responses_state_items,
responses_state_matches,
)
__all__ = [
"ResponsesBackend",
"ResponsesWebSocketOptions",
"convert_messages",
"convert_tools",
"convert_user_message",
"split_tool_call_id",
"iter_sse",
"consume_sse",
"consume_sse_with_reasoning",
"consume_responses_events",
"consume_sdk_stream",
"ResponsesStreamCapture",
"is_replayable_finish_reason",
"map_finish_reason",
"parse_response_output",
"build_responses_compaction_state",
"build_responses_state",
"is_compaction_compatibility_error",
"prepare_responses_input",
"resolve_compact_threshold",
"responses_state_context_tokens",
"responses_state_items",
"responses_state_matches",
"FINISH_REASON_MAP",
]