Expand description
Protocol bridge helpers.
This crate owns gateway/protocol conversion code that can be consumed by
both the siumai facade and siumai-extras without moving provider-specific
bridge logic into siumai-core or creating a facade/extras dependency cycle.
The current focus is explicit request bridging with reusable internal structure:
- planner
- request primitives
- request pair modules
- request inspection
- request serialization
- response inspection / serialization
- stream inspection / serialization
Re-exports§
pub use planner::RequestBridgePath;pub use planner::RequestBridgePlan;pub use planner::plan_chat_request_bridge;pub use request::bridge_chat_request_to_json;pub use request::bridge_chat_request_to_json_with_options;pub use request::inspect_chat_request_bridge;pub use response::bridge_chat_response_to_json_bytes;pub use response::bridge_chat_response_to_json_bytes_with_options;pub use response::bridge_chat_response_to_json_value;pub use response::bridge_chat_response_to_json_value_with_options;pub use response::inspect_chat_response_bridge;pub use stream::bridge_chat_stream_to_bytes;pub use stream::bridge_chat_stream_to_bytes_with_options;pub use stream::inspect_chat_stream_bridge;pub use stream::transform_chat_stream_with_bridge_options;pub use request::bridge_chat_request_to_openai_chat_completions_json;pub use request::bridge_chat_request_to_openai_chat_completions_json_with_options;pub use request::bridge_chat_request_to_openai_responses_json;pub use request::bridge_chat_request_to_openai_responses_json_with_options;pub use request::bridge_openai_chat_completions_json_to_chat_request;pub use request::bridge_openai_chat_completions_json_to_chat_request_with_options;pub use request::bridge_openai_responses_json_to_chat_request;pub use request::bridge_openai_responses_json_to_chat_request_with_options;pub use response::bridge_chat_response_to_openai_chat_completions_json_bytes;pub use response::bridge_chat_response_to_openai_chat_completions_json_bytes_with_options;pub use response::bridge_chat_response_to_openai_chat_completions_json_value;pub use response::bridge_chat_response_to_openai_chat_completions_json_value_with_options;pub use response::bridge_chat_response_to_openai_responses_json_bytes;pub use response::bridge_chat_response_to_openai_responses_json_bytes_with_options;pub use response::bridge_chat_response_to_openai_responses_json_value;pub use response::bridge_chat_response_to_openai_responses_json_value_with_options;pub use stream::bridge_chat_stream_to_openai_chat_completions_sse;pub use stream::bridge_chat_stream_to_openai_chat_completions_sse_with_options;pub use stream::bridge_chat_stream_to_openai_responses_sse;pub use stream::bridge_chat_stream_to_openai_responses_sse_with_options;
Modules§
- planner
- Bridge planning helpers.
- request
- Request bridge implementation.
- response
- Response bridge implementation.
- stream
- Stream bridge implementation.
Structs§
- Bridge
Options - Shared bridge configuration surface.
- Bridge
Options Override - Partial bridge configuration override.
- Bridge
Primitive Context - Primitive remap context shared by request/response/stream remappers.
- Bridge
Report - Structured bridge diagnostics.
- Bridge
Result - A bridge result paired with its diagnostic report.
- Bridge
Warning - A structured warning attached to a bridge report.
- Default
Bridge Loss Policy - Default mode-aware loss policy.
- Provider
Tool Rewrite Customization - Ready-made bridge customization that rewrites provider-defined tools before request serialization.
- Provider
Tool Rewrite Rule - Declarative provider-defined tool rewrite rule for request bridging.
- Request
Bridge Context - Request bridge lifecycle context.
- Response
Bridge Context - Response bridge lifecycle context.
- Stream
Bridge Context - Stream bridge lifecycle context.
Enums§
- Bridge
Decision - Overall bridge outcome.
- Bridge
Loss Action - Final decision emitted by loss policies.
- Bridge
Mode - Bridge strictness policy.
- Bridge
Primitive Kind - Typed bridge primitive categories exposed to remap policies.
- Bridge
Target - Named protocol targets that bridge implementations can produce or consume.
- Bridge
Warning Kind - Typed warning categories emitted during bridging.
- Request
Bridge Phase - Request bridge lifecycle phase.
Traits§
- Bridge
Customization - Unified bridge customization trait.
- Bridge
Loss Policy - Policy for deciding whether a bridge report should continue or reject.
- Bridge
Primitive Remapper - Primitive remapper for small, reusable semantic rewrites.
- Request
Bridge Hook - Request bridge customization hook shared by source-normalization and target-serialization paths.
- Response
Bridge Hook - Response bridge customization hook.
- Stream
Bridge Hook - Stream bridge customization hook.