pub struct LLMProgram {
pub program_path: String,
pub config: ProgramConfig,
/* private fields */
}Fields§
§program_path: String§config: ProgramConfigImplementations§
Source§impl LLMProgram
impl LLMProgram
pub fn new(program_path: &str) -> Result<Self>
pub fn new_with_options( program_path: &str, api_key: Option<String>, base_url: Option<String>, enable_cache: bool, redis_url: &str, ) -> Result<Self>
pub fn validate_input(&self, input: &Value) -> Result<(), Vec<String>>
pub fn validate_output(&self, output: &Value) -> Result<(), Vec<String>>
pub fn render_template(&self, context: &Context) -> Result<String>
pub async fn run(&self, inputs: &HashMap<String, Value>) -> Result<Value>
pub async fn stream( &self, inputs: &HashMap<String, Value>, ) -> Result<impl Stream<Item = Result<Value>>>
pub async fn batch_process( &self, inputs_list: &[HashMap<String, Value>], ) -> Result<Vec<Value>>
Auto Trait Implementations§
impl !Freeze for LLMProgram
impl !RefUnwindSafe for LLMProgram
impl Send for LLMProgram
impl !Sync for LLMProgram
impl Unpin for LLMProgram
impl UnsafeUnpin for LLMProgram
impl !UnwindSafe for LLMProgram
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