From 5f51c833c7ae3db5c9ff3698a3ba5cd5beec0a26 Mon Sep 17 00:00:00 2001 From: Mick Clarke Date: Tue, 2 Jan 2024 18:41:52 +1300 Subject: [PATCH] chore: Package updates. --- Cargo.toml | 19 +++++++++---------- src/provider/google.rs | 3 +++ src/review/report.rs | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 513b630..2a9468b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmonaut_code" -version = "0.2.0" +version = "0.2.1" edition = "2021" license = "CC BY-NC-ND 4.0" readme = "README.md" @@ -18,26 +18,25 @@ name = "cosmonaut_code" path = "src/main.rs" [dependencies] -openai-api-rs = "2.1.6" -# openai-api-rs = { git = "https://github.com/cosmonaut-nz/openai-api-rs.git"} +openai-api-rs = "2.1.7" google-generative-ai-rs = "0.1.4" # google-generative-ai-rs = { git = "https://github.com/avastmick/google-generative-ai-rs.git", version = "0.1.3" } -thiserror = "1.0.50" +thiserror = "1.0.55" log = "0.4.20" env_logger = "0.10.1" inquire = "0.6.2" -tokio = { version = "1.34.0", features = ["full"] } -reqwest = { version = "0.11.22", features = ["json"] } +tokio = { version = "1.35.1", features = ["full"] } +reqwest = { version = "0.11.23", features = ["json"] } config = "0.13.4" serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" +serde_json = "1.0.109" chrono = { version = "0.4.31", features = ["serde"] } walkdir = "2.4.0" regex = "1.10.2" -async-trait = "0.1.74" +async-trait = "0.1.76" git2 = "0.18.1" sha2 = "0.10.8" -handlebars = "4.5.0" +handlebars = "5.0.0" # linguist-rs = "1.1.2" # Using direct repository fetch in place of crates.io as version is out of date (local code changes) linguist-rs = { git = "https://github.com/cosmonaut-nz/linguist-rs.git", version = "1.1.2" } gcp_auth = "0.10.0" @@ -48,7 +47,7 @@ futures = "0.3.30" [dev-dependencies] -tempfile = "3.8.1" +tempfile = "3.9.0" [build-dependencies] linguist-rs-build = { git = "https://github.com/cosmonaut-nz/linguist-rs.git", version = "1.1.1" } diff --git a/src/provider/google.rs b/src/provider/google.rs index ca46bf4..30056af 100644 --- a/src/provider/google.rs +++ b/src/provider/google.rs @@ -159,6 +159,9 @@ pub(super) mod data { google_response: &PostResult, ) -> ProviderCompletionResponse { let mut messages: Vec = vec![]; + // TODO: If this is a streamed response, it has much finer-tuned harm handling + // than the REST response (right now). It may be rejecting the prompt input as harmful + // and stopping the feed. I need to handle this and flag it to the user. match google_response { PostResult::Rest(response) => { for candidate in &response.candidates { diff --git a/src/review/report.rs b/src/review/report.rs index 6fcfc87..4a7b2bf 100644 --- a/src/review/report.rs +++ b/src/review/report.rs @@ -162,7 +162,7 @@ impl fmt::Display for OutputType { /// Handlebars [`Helper`] to round a `f64` to two decimal places fn format_percentage( - h: &Helper<'_, '_>, + h: &Helper<'_>, _: &Handlebars<'_>, _: &Context, _: &mut RenderContext<'_, '_>, @@ -174,7 +174,7 @@ fn format_percentage( } /// Handlebars [`Helper`] to render a '\n' character to ", + h: &Helper<'_>, _: &Handlebars, _: &Context, _: &mut RenderContext<'_, '_>,