ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

Undocumented

Function _compact_frame Build a compact representation of one traceback frame.
Function _compact_header Build a bounded header for the diagnostic prompt.
Function _compact_prompt Build a compact prompt when the full traceback does not fit.
Function _encode_bounded Encode a bounded UTF-8 prefix or suffix.
Function _encode_field Encode a field and mark any truncation.
Function _frame_parts Yield frame locations and optional source lines.
Function _header_parts Yield the diagnostic request and exception fields.
Function _prompt_parts Yield the diagnostic header and captured frames.
Function _try_prompt Encode a prompt only when all fields fit within the limit.
Function build_chatgpt_url Build a compact, encoded diagnostic link within a local URL budget.
Constant _CHATGPT_URL_PREFIX Undocumented
Constant _ESCAPE_WIDTH Undocumented
Constant _FRAME_HEADING Undocumented
Constant _MIN_FRAME_BUDGET Undocumented
Constant _PROMPT_BUDGET Undocumented
Constant _PROMPT_START Undocumented
Constant _SOURCE_NOTICE Undocumented
Constant _TRUNCATION_NOTICE Undocumented
Constant CHATGPT_URL_MAX_LENGTH Undocumented
def _compact_frame(frame: dict[str, Any], budget: int) -> str: (source)

Build a compact representation of one traceback frame.

Parameters
frame:dict[str, Any]Parsed traceback frame.
budget:intMaximum encoded length assigned to the frame.
Returns
strEncoded compact frame location.
def _compact_header(traceback_data: dict[str, Any], locale: str, request_method: str, request_path: str) -> str: (source)

Build a bounded header for the diagnostic prompt.

Parameters
traceback_data:dict[str, Any]Parsed exception data.
locale:strRequested response locale.
request_method:strHTTP method associated with the request.
request_path:strHTTP path associated with the request.
Returns
strEncoded diagnostic header.
def _compact_prompt(traceback_data: dict[str, Any], locale: str, request_method: str, request_path: str) -> str: (source)

Build a compact prompt when the full traceback does not fit.

Parameters
traceback_data:dict[str, Any]Parsed exception data.
locale:strRequested response locale.
request_method:strHTTP method associated with the request.
request_path:strHTTP path associated with the request.
Returns
strEncoded prompt within the configured URL budget.
def _encode_bounded(value: str, limit: int, *, tail: bool = False) -> tuple[str, bool]: (source)

Encode a bounded UTF-8 prefix or suffix.

Parameters
value:strText to encode.
limit:intMaximum encoded length.
tail:bool, optionalPreserve the suffix instead of the prefix.
Returns
tuple[str, bool]Encoded text and whether the value was shortened.
def _encode_field(value: str, limit: int, *, tail: bool = False) -> str: (source)

Encode a field and mark any truncation.

Parameters
value:strText to encode.
limit:intMaximum encoded length before the truncation marker.
tail:bool, optionalPreserve the suffix instead of the prefix.
Returns
strEncoded text with a truncation marker when necessary.
def _frame_parts(frames: Iterable[dict[str, Any]], *, sources: bool) -> Iterator[str]: (source)

Yield frame locations and optional source lines.

Parameters
frames:Iterable[dict[str, Any]]Traceback frames in most-recent-first order.
sources:boolWhether to include failing source lines.
Returns
Iterator[str]Unencoded frame fields.
def _header_parts(traceback_data: dict[str, Any], locale: str, request_method: str, request_path: str) -> Iterator[str]: (source)

Yield the diagnostic request and exception fields.

Parameters
traceback_data:dict[str, Any]Parsed exception data.
locale:strRequested response locale.
request_method:strHTTP method associated with the request.
request_path:strHTTP path associated with the request.
Returns
Iterator[str]Individual unencoded header fields.
def _prompt_parts(traceback_data: dict[str, Any], locale: str, request_method: str, request_path: str, *, sources: bool) -> Iterator[str]: (source)

Yield the diagnostic header and captured frames.

Parameters
traceback_data:dict[str, Any]Parsed exception data.
locale:strRequested response locale.
request_method:strHTTP method associated with the request.
request_path:strHTTP path associated with the request.
sources:boolWhether to include failing source lines.
Returns
Iterator[str]Unencoded prompt fields in traceback order.
def _try_prompt(parts: Iterable[str], *, notice: str = '', prefix: str = '', limit: int = _PROMPT_BUDGET) -> str | None: (source)

Encode a prompt only when all fields fit within the limit.

Parameters
parts:Iterable[str]Prompt fields to encode.
notice:str, optionalLimit notice appended to the prompt.
prefix:str, optionalAlready encoded prompt prefix.
limit:int, optionalMaximum encoded prompt length.
Returns
str | NoneComplete encoded prompt, or None when a field does not fit.
def build_chatgpt_url(traceback_data: dict[str, Any], locale: str, request_method: str, request_path: str) -> tuple[str, bool]: (source)

Build a compact, encoded diagnostic link within a local URL budget.

Include every captured frame and its failing source line when they fit. Otherwise omit source snippets before shortening fields or dropping the oldest frames. The limit is an application compatibility policy, not a published ChatGPT maximum. No request data is cached or transmitted here.

Parameters
traceback_data:dict[str, Any]ExceptionParser output, including frames in most-recent-first order.
locale:strLocale requested for the diagnostic response.
request_method:strHTTP method associated with the failed request.
request_path:strHTTP path associated with the failed request.
Returns
tuple[str, bool]ASCII URL and whether source, fields, or frames were omitted.
_CHATGPT_URL_PREFIX: str = (source)

Undocumented

Value
'https://chatgpt.com/?prompt='
_ESCAPE_WIDTH: int = (source)

Undocumented

Value
3
_FRAME_HEADING: str = (source)

Undocumented

Value
'''
Frames (most recent first):
'''
_MIN_FRAME_BUDGET: int = (source)

Undocumented

Value
48
_PROMPT_START: str = (source)

Undocumented

Value
'Diagnose this Orionis Framework/Python error and suggest a fix. Respond in the ↵
language of locale '
_SOURCE_NOTICE: str = (source)

Undocumented

Value
'''
[Source snippets omitted to fit the URL limit.]'''
_TRUNCATION_NOTICE: str = (source)

Undocumented

Value
'''
[Truncated to fit URL: source snippets omitted; {omitted} older frames omitted.]'''
CHATGPT_URL_MAX_LENGTH: int = (source)

Undocumented

Value
2048