pub trait StructuredPrompt:
Debug
+ Send
+ Sync
+ DynClone {
// Required method
fn structured_prompt<'life0, 'async_trait, T>(
&'life0 self,
prompt: Prompt,
) -> Pin<Box<dyn Future<Output = Result<T, LanguageModelError>> + Send + 'async_trait>>
where T: 'async_trait + Serialize + DeserializeOwned + JsonSchema,
Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn name(&self) -> &'static str { ... }
}
Expand description
Given a string prompt, queries an LLM to return structured data
Required Methods§
fn structured_prompt<'life0, 'async_trait, T>(
&'life0 self,
prompt: Prompt,
) -> Pin<Box<dyn Future<Output = Result<T, LanguageModelError>> + Send + 'async_trait>>where
T: 'async_trait + Serialize + DeserializeOwned + JsonSchema,
Self: 'async_trait,
'life0: 'async_trait,
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.