d1egoaz / c3po.el

🤖 Meet c3po.el, the Emacs droid you’ve been looking for! This package will take your workflow to a galaxy far, far away. 🌟 C3PO.el is an Emacs package for interacting with the ChatGPT API. May the source be with you!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

changed the defvar c3po-model argumento from "gpt-3.5" to "gpt-4" but still getting errors, any help, please?

touxstone opened this issue · comments

Hi, everyone!
As said in the title, I was having the following error when trying with this gorgeous contribution. So tried changing the defvar argument at line 36 in the source code from gpt-3.5-turbo to gpt-4 but not success, I keep getting the same error, any help, with this, please??

error in process filter: Wrong type argument: arrayp, nil

Can you try again? It might be you didn't have access to gpt-4 API last week.

Funny enough, since last week gpt-4 API access is GA and should be available.
https://openai.com/blog/gpt-4-api-general-availability

@touxstone I've published a new version, please give a try if you can change the model.
This version is the one that I've been using internally for many months and I can change easily the model between 3.5 and 4 with c3po-toggle-c3po-model

I have a similar problem. After doing toggle-debug-on-error. The error output is:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  c3po--extract-content-answer((:error (error http 429) ...
  url-http-activate-callback()
  url-http-content-length-after-change-function(382 605 223)
  url-http-wait-for-headers-change-function(1 618 617)
  url-http-generic-filter(#<process api.openai.com> "HTTP/1.1 429 Too Many Requests\15\nDate:...

I hope this helps on detecting the problem :)

@ferzcam if you change the model to gpt-3.5 would it work?

It seems the error is related to rate limiting.

Might want to check the full error message to get the full error details, possible with the cause of the rate limiting.

https://help.openai.com/en/articles/6891829-error-code-429-rate-limit-reached-for-requests
https://help.openai.com/en/articles/5955604-how-can-i-solve-429-too-many-requests-errors

Hi @d1egoaz. I have tried both models (3.5 and 4) but it does not work. I have been using this package for a long time and this error used to happen sometimes only. However, now it seems to happen always. Not sure what is the issue :')

See above, I think you're going over your plan limit of API calls.

@ferzcam does an API call via curl works for you?

curl -s https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR-API-KEY" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [{"role": "user", "content": "Hello world"}]
  }'

@d1egoaz I cannot do API calls via curl. I noticed what my problem was. I was using a free account and it turns out that API requests had initial free credit that at some point expires. Thanks for taking your time helping on this.

@touxstone I've published a new version, please give a try if you can change the model. This version is the one that I've been using internally for many months and I can change easily the model between 3.5 and 4 with c3po-toggle-c3po-model

Hi, I have just tried it but not success, the output I got is the following to give an idea:

Contacting host: api.openai.com:443
error in process filter: let*: Wrong type argument: arrayp, nil
error in process filter: Wrong type argument: arrayp, nil

@touxstone can you get the current value of the variable? (describe-variable 'c3po-model)

and try running M-x toggle-debug-on-error and then try the variable toggle, the contents of the *Backtrace* might help to verify why it doesn't work for you.