pub trait TypedPrompt: WasmCompatSend + WasmCompatSync {
type TypedRequest<T>: IntoFuture<Output = Result<T, StructuredOutputError>>
where T: JsonSchema + DeserializeOwned + WasmCompatSend + 'static;
// Required method
fn prompt_typed<T>(
&self,
prompt: impl Into<Message> + WasmCompatSend,
) -> Self::TypedRequest<T>
where T: JsonSchema + DeserializeOwned + WasmCompatSend;
}Expand description
High-level typed structured prompting for the classic runtime.
Required Associated Types§
Sourcetype TypedRequest<T>: IntoFuture<Output = Result<T, StructuredOutputError>>
where
T: JsonSchema + DeserializeOwned + WasmCompatSend + 'static
type TypedRequest<T>: IntoFuture<Output = Result<T, StructuredOutputError>> where T: JsonSchema + DeserializeOwned + WasmCompatSend + 'static
Request type returned for one target output type.
Required Methods§
Sourcefn prompt_typed<T>(
&self,
prompt: impl Into<Message> + WasmCompatSend,
) -> Self::TypedRequest<T>
fn prompt_typed<T>( &self, prompt: impl Into<Message> + WasmCompatSend, ) -> Self::TypedRequest<T>
Send a prompt and deserialize the accepted structured response as T.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".