Expand description
Procedural macros for the Caravan RPC SDK.
The single attribute macro #[wagon] marks a trait as a seam interface.
Behaviour depends on the trait shape:
-
Sync trait (no
#[async_trait], noasync fn) — args may be owned (String,Vec<T>) or borrowed in the narrow set the macro knows how to lower (&str→String,&[T]→Vec<T>,&[&str]→Vec<String>). Emits<Trait>HttpClient+impl <Trait> for <Trait>HttpClient(calls go over HTTP viadispatch::dispatch_sync)build_<trait_snake>_router(impl_arc)axum router builder.
-
Anything else (async-trait, async fn, exotic arg types) → expand to the trait unchanged (identity behaviour, same as the B0p macro). Async-trait support lands later in M2 Session 4.
Code-rag’s traits at Session 4-narrow:
- Embedder (sync +
&str+&[&str]) → full codegen, suitable fordev-split-light’sEmbedder: containermode flip. - Reranker (sync +
&str+Vec<String>) → would be full codegen except for the third-partyfastembed::RerankResultreturn type lacking serde; left identity until M5. - LlmClient + VectorReader (
#[async_trait]) → identity until Session 4-async lands.
Attribute Macros§
- wagon
- Mark a trait as a Caravan RPC seam interface.