Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gpt4o #6

Merged
merged 4 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions experiments/project-review.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
find ./src -name '*.rs' | sort -r | while read -r file; do
echo "Processing $file"
echo "File: $file" >> all_outputs.txt
cat "$file" | target/debug/pipe-gpt -p "Can this code be improved for efficiency? Be very concise." >> all_outputs.txt
done
cat all_outputs.txt | target/debug/pipe-gpt --markdown -p "Provide the top 10 improvements from the above suggestions."
4 changes: 4 additions & 0 deletions experiments/scripts-review.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### pipe-gpt for en mass single-file code reviews
find ./src -name '*.rs' | while read -r file; do cat "$file" | pipe-gpt --markdown -p "Can this code be improved for efficiency?"; done

find ./src -name '*.rs' | while read -r file; do cat "$file" | pipe-gpt --markdown -p "Can this code be improved for readability?"; done
2 changes: 0 additions & 2 deletions src/api/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use openai_api_rust::{
};
use regex::Regex;

use crate::config::models::MAX_TOKENS;

pub enum AssistantPurpose {
CodeReviewer,
Default,
Expand Down
2 changes: 1 addition & 1 deletion src/cli/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ mod tests {
let input = "Test".to_string();
let (chat_body, render_markdown) = parse_arguments(&input, command);

assert_eq!(chat_body.model, "gpt-4");
assert_eq!(chat_body.model, "gpt-4o");
assert_eq!(chat_body.max_tokens.unwrap(), *MAX_TOKENS);
assert_eq!(chat_body.temperature.unwrap(), *TEMPERATURE);
assert_eq!(render_markdown, false);
Expand Down
4 changes: 2 additions & 2 deletions src/config/models.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Defines which gpt model to use. Currently set to "gpt-4"
pub const MODEL: &str = "gpt-4";
/// Defines which gpt model to use. Currently set to "gpt-4o"
pub const MODEL: &str = "gpt-4o";
/// Defines default maximum number of tokens available in conversation and response
pub const MAX_TOKENS: &i32 = &4096;
/// Defines default temperature of response
Expand Down
Loading