Skip to content

Commit

Permalink
refactor: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mehul-m-prajapati committed Dec 18, 2024
1 parent bdea221 commit d97c68e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/cli/llm/infer_type_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ impl InferTypeName {
total
);

// TODO: case where suggested names are already used, then extend the base
// question with `suggest different names, we have already used following
// TODO: case where suggested names are already used, then
// extend the base question with
// `suggest different names, we have already used following
// names: [names list]`
}
Err(e) => {
Expand Down
12 changes: 7 additions & 5 deletions src/cli/llm/wizard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ use genai::adapter::AdapterKind;
use genai::chat::{ChatOptions, ChatRequest, ChatResponse};
use genai::resolver::AuthResolver;
use genai::Client;
use super::error::{Error, Result};
use reqwest::{StatusCode};
use tokio_retry::strategy::{ExponentialBackoff};
use reqwest::StatusCode;
use tokio_retry::strategy::ExponentialBackoff;
use tokio_retry::RetryIf;

use super::error::{Error, Result};

#[derive(Setters, Clone)]
pub struct Wizard<Q, A> {
client: Client,
Expand Down Expand Up @@ -57,7 +58,8 @@ impl<Q, A> Wizard<Q, A> {
.exec_chat(self.model.as_str(), request, None) // Execute chat request
.await
.map_err(Error::from)
.and_then(A::try_from) // Convert the response into the desired result
.and_then(A::try_from) // Convert the response into the
// desired result
},
|err: &Error| {
// Check if the error is a ReqwestError and if the status is 429
Expand All @@ -67,7 +69,7 @@ impl<Q, A> Wizard<Q, A> {
}
}
false
}
},
)
.await
}
Expand Down

0 comments on commit d97c68e

Please sign in to comment.