Skip to content

Commit f46d750

Browse files
mingchengCopilot
andcommitted
Add a feat to auto sign off the commit if the environment is provided. (#12)
Signed-off-by: mingcheng <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Update src/openai.rs Co-authored-by: Copilot <[email protected]> Update src/openai.rs Co-authored-by: Copilot <[email protected]>
1 parent 2b0b378 commit f46d750

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

Cargo.lock

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,11 +1329,12 @@ dependencies = [
13291329

13301330
[[package]]
13311331
name = "nu-ansi-term"
1332-
version = "0.50.1"
1332+
version = "0.46.0"
13331333
source = "registry+https://github.com/rust-lang/crates.io-index"
1334-
checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399"
1334+
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
13351335
dependencies = [
1336-
"windows-sys 0.52.0",
1336+
"overload",
1337+
"winapi",
13371338
]
13381339

13391340
[[package]]
@@ -1493,6 +1494,12 @@ dependencies = [
14931494
"vcpkg",
14941495
]
14951496

1497+
[[package]]
1498+
name = "overload"
1499+
version = "0.1.1"
1500+
source = "registry+https://github.com/rust-lang/crates.io-index"
1501+
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
1502+
14961503
[[package]]
14971504
name = "parking_lot"
14981505
version = "0.12.4"
@@ -2050,9 +2057,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
20502057

20512058
[[package]]
20522059
name = "slab"
2053-
version = "0.4.11"
2060+
version = "0.4.10"
20542061
source = "registry+https://github.com/rust-lang/crates.io-index"
2055-
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
2062+
checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
20562063

20572064
[[package]]
20582065
name = "smallvec"
@@ -2406,9 +2413,9 @@ dependencies = [
24062413

24072414
[[package]]
24082415
name = "tracing-subscriber"
2409-
version = "0.3.20"
2416+
version = "0.3.19"
24102417
source = "registry+https://github.com/rust-lang/crates.io-index"
2411-
checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
2418+
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
24122419
dependencies = [
24132420
"nu-ansi-term",
24142421
"sharded-slab",
@@ -2628,6 +2635,28 @@ version = "0.1.10"
26282635
source = "registry+https://github.com/rust-lang/crates.io-index"
26292636
checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3"
26302637

2638+
[[package]]
2639+
name = "winapi"
2640+
version = "0.3.9"
2641+
source = "registry+https://github.com/rust-lang/crates.io-index"
2642+
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
2643+
dependencies = [
2644+
"winapi-i686-pc-windows-gnu",
2645+
"winapi-x86_64-pc-windows-gnu",
2646+
]
2647+
2648+
[[package]]
2649+
name = "winapi-i686-pc-windows-gnu"
2650+
version = "0.4.0"
2651+
source = "registry+https://github.com/rust-lang/crates.io-index"
2652+
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
2653+
2654+
[[package]]
2655+
name = "winapi-x86_64-pc-windows-gnu"
2656+
version = "0.4.0"
2657+
source = "registry+https://github.com/rust-lang/crates.io-index"
2658+
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
2659+
26312660
[[package]]
26322661
name = "windows-link"
26332662
version = "0.1.3"

src/openai.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ impl OpenAI {
5959

6060
// Set up HTTP client builder with default headers
6161
let mut http_client_builder = ClientBuilder::new()
62-
.user_agent(format!("{}({})", CMD, CMD_ABOUT))
62+
.user_agent(format!("{} ({})", CMD, CMD_ABOUT))
6363
.default_headers({
6464
let mut headers = HeaderMap::new();
6565
headers.insert("HTTP-Referer", HeaderValue::from_static(CMD_ABOUT_URL));
6666
headers.insert("X-Title", HeaderValue::from_static(CMD));
67-
headers.insert("X-Client", HeaderValue::from_static(CMD));
6867
headers.insert("X-Client-Type", HeaderValue::from_static("CLI"));
6968
headers
69+
7070
});
7171

7272
// Set up proxy if specified

0 commit comments

Comments
 (0)