Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
theoforger committed Sep 25, 2024
1 parent ef79a1e commit 6ed4946
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
let args = Args::parse();
dotenv().ok();

// Create an API instance and get all available models
// Create an API instance and get all available models from API
let api_instance = api::Instance::new()?;
let models_response = api_instance.get_models().await?;
let model_collection = ModelCollection::new(models_response);

// If -g is set, call the models API endpoint instead
// If -g is set, display models and exit the program
if args.get {
model_collection.display_list();
return Ok(());
Expand Down Expand Up @@ -74,6 +74,7 @@ async fn obtain_clue_collection(
for model_id in selected_model_ids {
// Validate each selected model
model_collection.validate_model_id(model_id)?;
// Get response from API
let response = api_instance
.post_chat_completions(&link_words, &avoid_words, model_id)
.await?;
Expand All @@ -86,7 +87,6 @@ async fn obtain_clue_collection(
}

fn handle_output(args: &Args, clue_collection: ClueCollection) -> Result<(), Box<dyn Error>> {
// Output
if clue_collection.is_empty() {
println!("The language model didn't return any useful clues. Maybe try again?");
} else if let Some(output_path) = &args.output {
Expand Down

0 comments on commit 6ed4946

Please sign in to comment.