Closed timscott closed 1 year ago
@timscott please provide steps to reproduce, in which context, maybe screenshot what you were doing.
This is why: gem 'pry-rails'
. I removed it, and that error went away. I assume that would be a new feature to support pry based console.
Now it works, but no matter what command I get the same output:
irb(main):010:0> gpt.unit_test(User)
-
=> nil
strange, can you try to clone this repo and open test/dummy app
then try to add some gems from your Gemfile to it and see when it will break. I assume the "inspect" is not executed? Or it's something else.
also do you have API key in the initializer/env?
@timscott try now, ask_chatgpt-0.3.1.gem
PS: #7 fixed here
It works with pry now, but I'm still getting no results.
[5] pry(main)> gpt.improve('User.full_name')
|
=>
[6] pry(main)> gpt.explain Events::Item
/
=>
[7] pry(main)> gpt.ask('how to read a text file')
|
=>
Please share your gemfile
looks like with your gemfile it works (I commented some CSS/JS related gems because dummy app doesn't support them), and it works. I first thought problem might be because of "hirb" or "awesome_print" but looks like it works
can you do the following
When it's in call_async
, I get an error:
[1] pry(main)> gpt.ask('how to read a text file')
|ERROR: Pry started inside Pry.
This can happen if you have a binding.pry inside a #to_s or #inspect function.
|
=>
When it's in call_sync
, it's the same empty result.
[1] pry(main)> gpt.ask('how to read a text file')
/
=>
I don't think the empty result is related to pry. When I remove gem 'pry-rails'
I get this:
irb(main):001:0> gpt.ask('how to read a text file')
/
=> nil
try to use "puts" and just output what you receive. a very basic way to debug things, but probably the only one possible here.
Also maybe you can enable debug mode. With gpt.debug!
Also try to switch to sync mode gpt.sync!
(and call call_sync)
finally I'm ready to jump on the call and if you can share screen we can try to fix it together, just find me in the skype: igorkasyanchuk
Okay, now we're getting somewhere. After I ran both gpt.debug!
and gpt.sync!
I got this:
irb(main):005:0> gpt.ask('how to read a text file')
{:model=>"gpt-3.5-turbo",
:temperature=>0.1,
:messages=>
[{:role=>"user",
:content=>
"I have a Ruby on Rails Application, Rails Version 6.1.7, Ruby Version: 3.1.2, Database: postgresql"},
{:role=>"user", :content=>"how to read a text file"}]}
\{"error"=>
{"message"=>"You exceeded your current quota, please check your plan and billing details.",
"type"=>"insufficient_quota",
"param"=>nil,
"code"=>nil}}
\
You exceeded your current quota, please check your plan and billing details.
=> nil
Now, when I use ChatGPT in desktop or web (https://chat.openai.com/), it works. However, when I try from https://platform.openai.com/playground, it says I'm over my rate limit. Same account. Not sure how to square that.
Obviously, it's not your problem, except you should probably show me the error without debug or sync on.
since you have this error can you debug and show error message, basically code is present for sync
if response["error"]
puts(response["error"]["message"])
else
and for async maybe something similar should be added.
Also, as for the limits - chat.openai.com works differently, API has its own rate limits: https://platform.openai.com/docs/guides/rate-limits/overview
But I think 3 calls per minute you should have anyway. So it looks strange. Maybe from your IP you have many other developers who are calling service?
Getting this error:
undefined method 'main' for nil:NilClass
here.