diff --git a/src/ml_interface.rs b/src/ml_interface.rs index a7aa8f2..d0070e4 100644 --- a/src/ml_interface.rs +++ b/src/ml_interface.rs @@ -75,11 +75,15 @@ impl MlInterface { } #[allow(unused)] - pub fn make_request( - &mut self, - gen_data: MlBody, - ) -> Result { + pub fn make_request(&mut self, gen_data: MlBody) -> Result { + if gen_data.prompt.len() < 1 { + panic!("No prompt provided"); + } let json_body = serde_json::to_string(&gen_data).unwrap(); - self.client.post(OLLAMA_ENDP).body(json_body).send() + let res = self.client.post(OLLAMA_ENDP).body(json_body).send(); + if res.is_err() { + panic!("Failed to send ollama payload"); + } + Ok(res.unwrap()) } }