Skip to content

Commit

Permalink
OpenAI: log errors (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
navidemad authored Feb 9, 2025
1 parent 35f12df commit c66cd86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

* Set `log_errors: true` on OpenAI::Client options in order to display HTTP client errors. [#614](https://github.com/glebm/i18n-tasks/pull/614)
* Uses AST-parser for all ERB-files, not just `.html.erb`
* [Fixed regex in `PatternScanner`] (https://github.com/glebm/i18n-tasks/issues/572)
* Adds contextual parser to support more Rails-translations
Expand Down
2 changes: 1 addition & 1 deletion lib/i18n/tasks/translators/openai_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def no_results_error_message
private

def translator
@translator ||= OpenAI::Client.new(access_token: api_key)
@translator ||= OpenAI::Client.new(access_token: api_key, log_errors: true)
end

def api_key
Expand Down

0 comments on commit c66cd86

Please sign in to comment.