Skip to content

Commit

Permalink
refactor(decode): update decode.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
omarabid committed Feb 4, 2024
1 parent 2a26e00 commit d3ab54d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub enum ResponseStatus {
pub fn decode_gpt_response(response: String) -> Result<GPTResult> {
let response = response.trim();

if response.starts_with("NOT_VALID:") {
let explanation = response.replace("NOT_VALID:", "");
if response.starts_with("NOT VALID:") {
let explanation = response.replace("NOT VALID:", "");

return Ok(GPTResult::Success(GPTResponse {
status: ResponseStatus::NotValid,
Expand All @@ -34,8 +34,8 @@ pub fn decode_gpt_response(response: String) -> Result<GPTResult> {
}));
}

if response.starts_with("NOT_POSSIBLE:") {
let explanation = response.replace("NOT_POSSIBLE:", "");
if response.starts_with("NOT POSSIBLE:") {
let explanation = response.replace("NOT POSSIBLE:", "");

return Ok(GPTResult::Success(GPTResponse {
status: ResponseStatus::NotPossible,
Expand Down

0 comments on commit d3ab54d

Please sign in to comment.