Skip to content

Commit 9783b75

Browse files
committed
docs: Address proxy setting
1 parent a74995c commit 9783b75

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -242,21 +242,21 @@ Options:
242242
```
243243

244244
```
245-
$ gptcommit config -h
246-
Read and modify settings
247-
248-
Usage: gptcommit config [OPTIONS] <COMMAND>
249-
250-
Commands:
251-
keys List all config keys
252-
list List all config values
253-
get Read a config value
254-
set Set a config value
255-
delete Clear a config value
256-
help Print this message or the help of the given subcommand(s)
257-
258-
Options:
259-
-v, --verbose Enable verbose logging
260-
-h, --help Print help
261-
-V, --version Print version
245+
$ gptcommit config keys
246+
allow_amend
247+
file_ignore
248+
model_provider
249+
openai.api_base
250+
openai.api_key
251+
openai.model
252+
openai.proxy
253+
openai.retries
254+
output.conventional_commit
255+
output.lang
256+
output.show_per_file_summary
257+
prompt.commit_summary
258+
prompt.commit_title
259+
prompt.conventional_commit_prefix
260+
prompt.file_diff
261+
prompt.translation
262262
```

src/llms/openai.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ impl OpenAIClient {
4141
}
4242

4343
if let Some(proxy) = settings.proxy {
44-
let http_client = reqwest::Client::builder()
45-
.proxy(reqwest::Proxy::all(proxy)?)
46-
.build()?;
47-
client = client.with_http_client(http_client);
44+
if !proxy.is_empty() {
45+
let http_client = reqwest::Client::builder()
46+
.proxy(reqwest::Proxy::all(proxy)?)
47+
.build()?;
48+
client = client.with_http_client(http_client);
49+
}
4850
}
4951

5052
if settings.retries.unwrap_or_default() > 0 {

src/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl Settings {
230230
api_key: None,
231231
model: Some(DEFAULT_OPENAI_MODEL.to_string()),
232232
retries: Some(2),
233-
proxy: None,
233+
proxy: Some("".to_string()),
234234
}),
235235
)?
236236
.set_default(

src/toml.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ the-force = { value = "surrounds-you" }
7676
"openai.api_base",
7777
"openai.api_key",
7878
"openai.model",
79+
"openai.proxy",
7980
"openai.retries",
8081
"output.conventional_commit",
8182
"output.lang",

0 commit comments

Comments
 (0)