Skip to main content

Crate car_inference_types

Crate car_inference_types 

Source
Expand description

Pure-serde conversation/message wire types for CAR inference.

These types — Message, ToolCall, ContentBlock — define the multi-turn conversation wire form that car-inference’s protocol handlers and local chat templates consume. They were extracted out of car-inference (where they still live as re-exports) so a dependency- light consumer can build and pattern-match the REAL types without pulling the Candle/MLX inference stack:

  • car-inference re-exports every type here (pub use car_inference_types::{Message, ToolCall, ContentBlock}), so its own callers are unchanged.
  • car-sync’s transcript-resume projection (multi-device sync B2) builds Vec<Message> directly from folded conversation ops. Because it depends on this crate — not on a hand-copied mirror — a change to Message’s shape is a compile error at the resume site, not a runtime from_value::<Message> break in the daemon (the drift trap the kernel review flagged).

The crate is deliberately serde-only. Anything that needs Candle, a tokenizer, or a model backend belongs in car-inference, not here.

Structs§

ThinkingBlock
A single assistant extended-thinking block, preserved for verbatim replay.
ToolCall
A tool call returned by the model.

Enums§

ContentBlock
A content block in a multimodal message.
Message
A message in a multi-turn conversation.
Provenance
Where a tool result’s bytes came from, relative to the runtime’s trust boundary.

Constants§

EXTERNAL_CLOSE
Closing delimiter for externally-sourced tool output.
EXTERNAL_OPEN
Opening delimiter for externally-sourced tool output.

Functions§

fence_external
Wrap externally-sourced tool output so its status is legible in the prompt.