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

fix: convert openai.timeout to nanoseconds in calculations #92

Closed x4base closed 6 months ago

x4base commented 11 months ago

The docs says openai.timeout defaults to 10s, which implies the unit of the parameter should be seconds. However, if the output language is not English (e.g. zh-tw), it times out immediately. It is because the default unit for durations is nanoseconds. This commit help convert the units.

x4base commented 11 months ago

And this make it more natural, as the users would not know it should actually be in nanoseconds.

codecov-commenter commented 11 months ago

Codecov Report

Merging #92 (f958537) into main (99b47bc) will not change coverage. The diff coverage is n/a.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main      #92   +/-   ##
=======================================
  Coverage   28.28%   28.28%           
=======================================
  Files           6        6           
  Lines         251      251           
=======================================
  Hits           71       71           
  Misses        175      175           
  Partials        5        5