dspy_rs/core/
module.rs

1use anyhow::Result;
2use indexmap::IndexMap;
3
4use crate::{Example, Prediction, core::MetaSignature};
5
6#[allow(async_fn_in_trait)]
7pub trait Module: Send + Sync {
8    async fn forward(&self, inputs: Example) -> Result<Prediction>;
9}
10
11#[allow(unused_variables)]
12pub trait Optimizable {
13    fn get_signature(&self) -> &dyn MetaSignature {
14        todo!()
15    }
16
17    fn parameters(&mut self) -> IndexMap<String, &mut dyn Optimizable>;
18
19    fn update_signature_instruction(&mut self, instruction: String) -> anyhow::Result<()> {
20        todo!()
21    }
22}