pub struct TranslatedRequest {
pub function_id: Uuid,
pub prompt: String,
pub prompt_len_hint: i32,
pub args: Vec<WasmArg>,
pub stream: bool,
}Expand description
Translation output: the resolved Uuid function id, the
fully-assembled prompt text, and the synthetic WasmArg vector to
pass into call_export_with_args.
args policy: the args vector is empty, deliberately. The
standard WASI command export is _start () -> (), and the executor’s
call_export_with_args switches to wasmtime’s dynamic call path for
any non-empty arg slice — which validates param arity against the
export signature exactly and would reject a ()-arity guest handed
an argument. The prompt is a bytes payload, not a numeric arg, so
it travels through the wasi:tensor/host pull-model input channel
(input-len / read-input) rather than args: the handler moves
prompt into
SpawnConfig::input
at spawn time. See the module-level “Prompt → guest input channel”
section for the full rationale. Guests stream their reply via
wasi:tensor/host.emit-chunk — the host buffers / forwards every
emitted chunk.
Fields§
§function_id: UuidResolved function id.
prompt: StringFully-assembled prompt text (concatenated messages array for
/v1/chat/completions). The handler stages these bytes on
SpawnConfig::input
so the guest can pull them via wasi:tensor/host.read-input.
prompt_len_hint: i32Byte length of the assembled prompt, clamped to i32::MAX.
Preserved as an observability hint (e.g. for tracing the staged
prompt size); the prompt itself is delivered to the guest via the
wasi:tensor/host input channel.
args: Vec<WasmArg>Args to pass into the executor. Empty in v0.4 so the standard
_start () -> () guest links via the typed fast path; see the
struct-level note.
stream: booltrue if the original request had stream: true.
Trait Implementations§
Source§impl Clone for TranslatedRequest
impl Clone for TranslatedRequest
Source§fn clone(&self) -> TranslatedRequest
fn clone(&self) -> TranslatedRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TranslatedRequest
impl RefUnwindSafe for TranslatedRequest
impl Send for TranslatedRequest
impl Sync for TranslatedRequest
impl Unpin for TranslatedRequest
impl UnsafeUnpin for TranslatedRequest
impl UnwindSafe for TranslatedRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more