pub struct Predict {
pub signature: Box<dyn MetaSignature>,
}Fields§
§signature: Box<dyn MetaSignature>Implementations§
Source§impl Predict
impl Predict
Sourcepub fn new(signature: impl MetaSignature + 'static) -> Self
pub fn new(signature: impl MetaSignature + 'static) -> Self
Examples found in repository?
examples/05-heterogenous-examples.rs (lines 25-27)
14async fn main() -> anyhow::Result<()> {
15 configure(
16 LM::builder()
17 .api_key(SecretString::from(std::env::var("OPENAI_API_KEY")?))
18 .build(),
19 ChatAdapter {},
20 );
21
22 let exp = example! {
23 "number": "input" => 10,
24 };
25 let predict = Predict::new(sign! {
26 (number: i32) -> number_squared: i32, number_cubed: i32
27 });
28
29 let prediction = predict.forward(exp).await?;
30 println!("{prediction:?}");
31
32 Ok(())
33}Trait Implementations§
Source§impl Optimizable for Predict
impl Optimizable for Predict
fn get_signature(&self) -> &dyn MetaSignature
fn parameters(&mut self) -> IndexMap<String, &mut dyn Optimizable>
fn update_signature_instruction(&mut self, instruction: String) -> Result<()>
Auto Trait Implementations§
impl Freeze for Predict
impl !RefUnwindSafe for Predict
impl Send for Predict
impl Sync for Predict
impl Unpin for Predict
impl !UnwindSafe for Predict
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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