Skip to content

maintenance: update default engine #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

bootcoder
Copy link

Problem

Fresh install today and encountered the following error while building out a straight CLI wrapper:

chatgpt-ruby-2.1.1/lib/chatgpt/client.rb:89:in `handle_error': 
The model `text-davinci-002` has been deprecated, 
learn more here: https://platform.openai.com/docs/deprecations 
(ChatGPT::APIError)

Solution

Updates default model per openai docs from text-davinci-002 👉 gpt-4o-mini with a simple find & replace

Checks

  • rake test: 19 run / 46 assertions / 0 failures / 0 skips
  • rubocop: 16 inspected / 0 offenses
  • yard doc: no change

Rubocop Cleanup

  • branch main contains 13 offenses which are resolved via:
  • client.rb#request_streaming - reduce complexity
    • Main Change: chunk.split("\n").filter { |c| c.start_with?('data:') }.each do |line|
    • Secondary: New method request_options (Happy to rm, lmk. May be unneeded in hindsight)
  • test/test_helper.rb - multiple violations
    • Main Change: new mock_response_body method with uniform signature

Additional Changes

  • Gems
    • bundle generates diff in gemfile.lock Observed on both main && feature branches
      • Been a few years since I've done public gem work, not sure if these should be committed or discarded.
      • Seems like commit but not sure... 🤷 (Happy to rm, lmk)
    • gem yard
      • README.md includes a reference to docs with bundle exec yard doc but it is not included in the bundle
      • gem 'yard' added to development, enabling above command
      • Not sure how you feel about expanding dependencies vs this trivial thing..... (Happy to rm, lmk)
  • .DS_Store
    • Nit: OSX files clutter up your repo
    • Solution: Cleaned up + added to .gitignore
    • Tip: Setup ~/.gitignore_global to cover things like this in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant