appleboy / CodeGPT

A CLI written in Go language that writes git commit messages or do a code review brief for you using ChatGPT AI (gpt-4o, gpt-4-turbo, gpt-3.5-turbo model) and automatically installs a git prepare-commit-msg hook.
MIT License
1.16k stars 100 forks source link

Error Message: Post "https://api.openai.com/v1/chat/completions": net/http: request canceled (Client.Timeout exceeded while awaiting headers) #133

Closed ayugioh2003 closed 7 months ago

ayugioh2003 commented 8 months ago

What happened

When I use codegpt review or codegpt commit --preview command CLI says Error: Post "https://api.openai.com/v1/chat/completions": net/http: request canceled (Client.Timeout exceeded while awaiting headers)

It has been like this for many days. (maybe 1 ~ 2 weeks) These tasks was successfully executed in the past.

Log

$ codegpt review 

Code review your changes using gpt-3.5-turbo model
We are trying to review code changes
Error: Post "https://api.openai.com/v1/chat/completions": net/http: request canceled (Client.Timeout exceeded while awaiting headers)
$ codegpt commit --preview

Summarize the commit message use gpt-3.5-turbo model
We are trying to summarize a git diff
PromptTokens: 2361, CompletionTokens: 100, TotalTokens: 2461
We are trying to summarize a title for pull request
Error: Post "https://api.openai.com/v1/chat/completions": net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Config list

$ codegpt config list           

Key                       Value             
git.diff_unified          3                 
git.exclude_list                            
git.template_file                           
git.template_string                         
openai.api_key            ****************  
openai.api_version                          
openai.base_url                             
openai.frequency_penalty  <nil>             
openai.headers                              
openai.max_tokens         300               
openai.model              gpt-3.5-turbo     
openai.model_name                           
openai.org_id                               
openai.presence_penalty   <nil>             
openai.provider           openai            
openai.proxy                                
openai.skip_verify        false             
openai.socks                                
openai.temperature        0.7               
openai.timeout            10s               
openai.top_p              <nil>             
output.lang               en       
appleboy commented 7 months ago

I will take it.

appleboy commented 7 months ago

@ayugioh2003 Please update the timeout value

codegpt config set openai.timeout 1m
ayugioh2003 commented 7 months ago

It works. Thanks!