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.
class McpResponse: (source)
Compose protocol content without knowing the transport or DI container.
| Class Method | audio |
Encode raw audio bytes once. |
| Class Method | error |
Return an application-visible tool error, with an explicit safe message. |
| Class Method | image |
Encode raw image bytes once. |
| Class Method | progress |
Yield progress; the dispatcher suppresses it without client opt-in. |
| Class Method | resource |
Serialize and embed resource content according to its MIME type. |
| Class Method | resource |
Link to a resource without loading it. |
| Class Method | structured |
Return any JSON value and the recommended serialized text content. |
| Class Method | text |
Return text content. |
| Method | _copy |
Retain generated-text ownership when cloning content metadata. |
| Method | as |
Assign the assistant role for a prompt response. |
| Method | as |
Assign the user role for a prompt response. |
| Method | with |
Set audience, priority and modification hints on content blocks. |
| Method | with |
Attach application metadata to each content block. |
| Method | with |
Attach result metadata without allowing reserved protocol keys. |
| Class Variable | _structured |
Generated text block owned by structured content, excluding manual text. |
| Class Variable | content |
Content blocks carried by this protocol value. |
| Class Variable | is |
Is error flag used by McpResponse. |
| Class Variable | meta |
Meta produced by field. |
| Class Variable | progress |
Progress notification emitted independently of response content. |
| Class Variable | role |
user. |
Encode raw audio bytes once.
| Parameters | |
value:bytes | Value to inspect, transform or validate. |
mimestr | Value supplied for mime_type. |
| Returns | |
typing.Self | Result of the operation described above. |
Return an application-visible tool error, with an explicit safe message.
| Parameters | |
message:str | Value supplied for message. |
| Returns | |
typing.Self | An application-visible tool error, with an explicit safe message. |
Encode raw image bytes once.
| Parameters | |
value:bytes | Value to inspect, transform or validate. |
mimestr | Value supplied for mime_type. |
| Returns | |
typing.Self | Result of the operation described above. |
float, total: float | None = None, message: str | None = None) -> Self:
(source)
¶
Yield progress; the dispatcher suppresses it without client opt-in.
| Parameters | |
current:float | Value supplied for current. |
total:float | None | Value supplied for total. |
message:str | None | Value supplied for message. |
| Returns | |
typing.Self | Result of the operation described above. |
Serialize and embed resource content according to its MIME type.
| Parameters | |
uri:str | Value supplied for uri. |
value:object | Native msgspec-compatible data, or already encoded content. JSON data is normalized to builtins before strict validation. JSON strings and binary buffers are retained without re-encoding. |
mimestr | None | Declared media type. Structured data defaults to application/json; MessagePack is emitted as Base64 binary resource content. |
| Returns | |
typing.Self | Embedded content usable by tools, resources and prompts. |
str, name: str, *, title: str | None = None, description: str | None = None, mime_type: str | None = None) -> Self:
(source)
¶
Link to a resource without loading it.
| Parameters | |
uri:str | Value supplied for uri. |
name:str | Value supplied for name. |
title:str | None | Value supplied for title. |
description:str | None | Value supplied for description. |
mimestr | None | Value supplied for mime_type. |
| Returns | |
typing.Self | Result of the operation described above. |
Return any JSON value and the recommended serialized text content.
| Parameters | |
value:object | Native msgspec-compatible data normalized to a finite JSON value. |
| Returns | |
typing.Self | Any JSON value and the recommended serialized text content. |
Return text content.
| Parameters | |
value:str | Value to inspect, transform or validate. |
| Returns | |
typing.Self | Text content. |
Retain generated-text ownership when cloning content metadata.
| Parameters | |
content:tuple[orionis.mcp.protocol.content.ContentBlock, ...] | Transformed content preserving the original blocks' order. |
| Returns | |
typing.Self | Independent response retaining the corresponding generated block. |
Assign the assistant role for a prompt response.
| Returns | |
typing.Self | Result of the operation described above. |
Assign the user role for a prompt response.
| Returns | |
typing.Self | Result of the operation described above. |
Set audience, priority and modification hints on content blocks.
| Parameters | |
annotations:orionis.mcp.ContentAnnotations | Value supplied for annotations. |
| Returns | |
typing.Self | Result of the operation described above. |
Attach application metadata to each content block.
| Parameters | |
metadata:dict[str, object] | Metadata associated with the current operation. |
| Returns | |
typing.Self | Result of the operation described above. |
Attach result metadata without allowing reserved protocol keys.
| Parameters | |
metadata:dict[str, object] | Metadata associated with the current operation. |
| Returns | |
typing.Self | Result of the operation described above. |