Skip to main content

BoxCodec

Trait BoxCodec 

Source
pub trait BoxCodec {
    type Box: Clone;

    // Required methods
    fn tool_call_box(&mut self, call: &ToolCall) -> Self::Box;
    fn box_text<'a>(&self, box_: &'a Self::Box) -> &'a str;
}
Expand description

Converts between a chat engine’s canonical box type and text visible to Codex.

A shim calls tool_call_box exactly once for each dynamic tool call it receives. box_text must return the complete representation that should be placed into Codex context. Implementations must not add ordering of their own: the shim preserves insertion order.

Required Associated Types§

Source

type Box: Clone

Canonical box type owned by the chat engine.

Required Methods§

Source

fn tool_call_box(&mut self, call: &ToolCall) -> Self::Box

Converts one typed Codex dynamic-tool request into a canonical box.

Source

fn box_text<'a>(&self, box_: &'a Self::Box) -> &'a str

Returns the exact textual representation of one box for Codex.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§