ra-jeev / write-assist-ai

OpenAI-powered Text Rewriter for VS Code. Works with Markdown, LaTeX and text files. Fully customizable through settings.
MIT License
10 stars 1 forks source link

Doesn't work properly #1

Closed vsukhoml closed 8 months ago

vsukhoml commented 8 months ago
  1. I tried to use it and provided my OpenAI API key (starting with sk-). However, all attempts to do something resulted in Failed to process... text being printed. It would be nice to print instead a more detailed error message, as I'm not sure where it fails. OpenAI doesn't show any access to API.
  2. I'd really appreciate activation in TeX/Latex mode (.tex extension).
  3. Would be nice to control some OpenAI parameters which are hard-coded now - model, temperature, etc in addition to max tokens.
ra-jeev commented 8 months ago

Thank you for your suggestions @vsukhoml. My point by point response:

  1. Let me have a look as to why it is not working. I'll also add support for providing detailed error messages.
  2. Sure
  3. I was thinking of providing more config options but then got busy in other stuffs. Will do it now.

Thank you for taking the time to point these out. Really appreciate it.

vsukhoml commented 8 months ago

I suspected I might need to have openai package for npm to be installed, but npm install openai didn't make a difference, and I see it in dependencies anyway, though older version - 3.2.1 vs. 4.28.4 which I got installed.

ra-jeev commented 8 months ago

No, you don't need to install the package.

I've a suspicion that it is because of no OpenAI credits (they recently changed how the billing works and now you need to purchase the credits beforehand), but I need to verify this unless there is some other issue.

vsukhoml commented 8 months ago

I have account funded, it shows credits, usage limits looks fine, so far and it says its active and I can run it in playground. Can't find any mail from OpenAI saying I need to change anything.

vsukhoml commented 8 months ago

I also checked I can send requests with curl & python. But searching for what can be wrong found this migration guide to new node's OpenAI API https://github.com/openai/openai-node/discussions/217 - could it be the reason?

ra-jeev commented 8 months ago

@vsukhoml Have updated the extension with the fix for point 1. Please verify and let me know incase the same issue still persists.

The issue was because of the deprecated model text-davinci-003 which the extension was using internally. OpenAI was returning 404 for that model endpoint. Have changed it to gpt-3.5-turbo-instruct for now. I have also added better error messaging.

For points 2 & 3 in your original message, I'll create separate issues and support them soon.

Thanks a lot :-)

vsukhoml commented 8 months ago

It works now! Thanks a lot!

Yes, having the feature to set model as a text in addition to preset values would make it future proof - some models will be deprecated, new added. Also just thought that adding a custom text with preamble used to instruct model what to do can be handy when you want to set up some context.

ra-jeev commented 8 months ago

@vsukhoml Have added support for LaTeX files and released a new version. You can try checking when the time permits. Feel free to create a new issue in case it doesn't work properly,

Will work on on the remaining items later on (hopefully during the weekend).

Thank you :-)

vsukhoml commented 8 months ago

It works correctly in .tex files now! Not sure if bibtex is needed - it also works for .bib files, but these files are similar to json objects - check https://www.bibtex.com/g/bibtex-format/. But what can be useful is a a work in HTML files, assuming there are some blocks of plain text. Not sure how good models respond when output have to be in markdown format or html - what I tried manually didn't look very promising, but may be it is a matter of prompt engineering.

ra-jeev commented 8 months ago

it also works for .bib files, but these files are similar to json objects - check https://www.bibtex.com/g/bibtex-format/.

Don't know about bibtex. Saw that VSCode extension docs mention it, so I thought let's add it. So it should work fine (.bib is the file extension for bibtex).

But what can be useful is a a work in HTML files, assuming there are some blocks of plain text. Not sure how good models respond when output have to be in markdown format or html - what I tried manually didn't look very promising, but may be it is a matter of prompt engineering.

Started a new discussion here #5.