Skip to content

Commit

Permalink
Merge pull request #3 from oltoko/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
oltoko authored Sep 1, 2024
2 parents 0e133a0 + 25e23bc commit 5310ee5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mangpt"
version = "0.1.0"
version = "0.2.0"
description = "CLI program to ask ChatGPT how to use other CLI programs"
authors = ["Oliver Koch <oltoko@gmail.com>"]
repository = "https://github.com/oltoko/mangpt"
Expand All @@ -12,11 +12,11 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-openai = "0.17.1"
clap = { version = "4.4.12", features = ["derive"] }
dirs = "5.0.1"
futures = "0.3.30"
rpassword = "7.3.1"
serde = { version = "1.0.193", features = ["derive"] }
serde_yaml = "0.9.29"
tokio = { version = "1.35.1", features = ["full"] }
async-openai = "0.17"
clap = { version = "4.4", features = ["derive"] }
dirs = "5.0"
futures = "0.3"
rpassword = "7.3"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.9"
tokio = { version = "1.35", features = ["full"] }
7 changes: 5 additions & 2 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pub struct ManGPTConfig {
}

const FILE_NAME: &str = "mangpt-config.yml";
const DEFAULT_MODEL: &str = "gpt-4";
const DEFAULT_MAX_TOKENS: u16 = 512u16;
const DEFAULT_MODEL: &str = "gpt-4o-mini";
const DEFAULT_MAX_TOKENS: u16 = 1024u16;

pub fn load() -> Result<ManGPTConfig, Box<dyn std::error::Error>> {
let config_dir = dirs::config_local_dir().ok_or("Can't find config directory")?;
Expand All @@ -30,6 +30,9 @@ pub fn load() -> Result<ManGPTConfig, Box<dyn std::error::Error>> {
fn create_config_file(
config_file_path: &std::path::PathBuf,
) -> Result<(), Box<dyn std::error::Error>> {
println!(
"You can create an OpenAI API-Key in your account https://platform.openai.com/api-keys"
);
let api_key = rpassword::prompt_password("Please Enter your OpenAI API-Key: ")?;

let config = ManGPTConfig {
Expand Down

0 comments on commit 5310ee5

Please sign in to comment.