feat(pr_handler): Create PR title and description generation rules #1

Merged
tristonarmstrong merged 20 commits from dev into master 2025-01-12 19:06:43 +00:00
Showing only changes of commit 8445e2f076 - Show all commits

View File

@ -75,11 +75,15 @@ impl MlInterface {
} }
#[allow(unused)] #[allow(unused)]
pub fn make_request( pub fn make_request(&mut self, gen_data: MlBody) -> Result<reqwest::blocking::Response, &str> {
&mut self, if gen_data.prompt.len() < 1 {
gen_data: MlBody, panic!("No prompt provided");
) -> Result<reqwest::blocking::Response, reqwest::Error> { }
let json_body = serde_json::to_string(&gen_data).unwrap(); 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())
} }
} }