From 94bd3e830cfb2c5132a0d2d2f4b72e713b1cec4e Mon Sep 17 00:00:00 2001 From: HouXiaoxuan Date: Mon, 30 Sep 2024 21:19:13 +0800 Subject: [PATCH 1/2] chorn: Update async-openai version to 0.24.1 and fix content type in OpenAIClient Signed-off-by: HouXiaoxuan --- atlas/Cargo.toml | 2 +- atlas/src/api/openai.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atlas/Cargo.toml b/atlas/Cargo.toml index af6ae6ed0..68a014baa 100644 --- a/atlas/Cargo.toml +++ b/atlas/Cargo.toml @@ -8,4 +8,4 @@ tokio = { workspace = true, features = ["macros"] } reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -async-openai = "0.23.4" +async-openai = "0.24.1" diff --git a/atlas/src/api/openai.rs b/atlas/src/api/openai.rs index 399841974..b3f04ba3e 100644 --- a/atlas/src/api/openai.rs +++ b/atlas/src/api/openai.rs @@ -63,7 +63,7 @@ impl AskModel for OpenAIClient { ChatRole::User => { messages.push( ChatCompletionRequestSystemMessageArgs::default() - .content(content) + .content(content.as_str()) .build()? .into(), ); From 0cca9250033cac08db0091351e8f578a6707024d Mon Sep 17 00:00:00 2001 From: HouXiaoxuan Date: Mon, 30 Sep 2024 21:24:57 +0800 Subject: [PATCH 2/2] chron: add debug log when lfs update file Signed-off-by: HouXiaoxuan --- ceres/src/lfs/handler.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ceres/src/lfs/handler.rs b/ceres/src/lfs/handler.rs index f4d29adaa..efa9c2824 100644 --- a/ceres/src/lfs/handler.rs +++ b/ceres/src/lfs/handler.rs @@ -300,6 +300,7 @@ pub async fn lfs_upload_object( let meta = lfs_get_meta(storage.clone(), &request_vars.oid) .await .unwrap(); + tracing::debug!("upload lfs object {} size: {}", meta.oid, meta.size); if config.enable_split && meta.splited { // assert!(request_vars.size == body_bytes.len() as i64, "size didn't match: {} != {}", request_vars.size, body_bytes.len()); // TODO: git client, request_vars.size is `0`!! // split object to blocks @@ -320,6 +321,8 @@ pub async fn lfs_upload_object( } sub_ids.push(sub_id); } + tracing::debug!("lfs object {} split into {} chunks", meta.oid, sub_ids.len()); + // save the relationship to database let mut offset = 0; for sub_id in sub_ids {