ox icon indicating copy to clipboard operation
ox copied to clipboard

AI features

Open curlpipe opened this issue 1 year ago • 11 comments

Have a plug-in that does the following:

  • [x] Is able to get the context of the file the user is in
  • [x] Prompts the user for what they'd like to do
  • [x] Use the above to send information to an API
    • [x] Google Gemini
    • [x] OpenAI ChatGPT
    • [x] Anthropic Claude
  • [x] Processes the result and inserts it into the code file
  • [x] API key is assigned during set-up assistant
  • [x] Thorough testing
  • [ ] AI prompt
  • [ ] AI sidebar

curlpipe avatar Sep 25 '24 14:09 curlpipe

@curlpipe Could we also get OpenAI API or Claude API?

plyght avatar Nov 19 '24 13:11 plyght

@curlpipe Could we also get OpenAI API or Claude API?

That can be arranged :+1:

curlpipe avatar Nov 19 '24 14:11 curlpipe

@plyght Working on this at the moment, I don't have an API key for ChatGPT or Claude as they are quite expensive, which makes it hard for me to test how they work. Gemini has a free plan (it is rate limited, but these are generous) and seems to be working OK so far.

curlpipe avatar Dec 17 '24 17:12 curlpipe

@curlpipe I have both; let me know when you release it and i'll be happy to test. I could also test now if needed!

plyght avatar Dec 17 '24 17:12 plyght

@plyght Great, I will try my best to write in ChatGPT and Claude support, hopefully they work first time :pray:

curlpipe avatar Dec 18 '24 12:12 curlpipe

@curlpipe Has this been implemented into a release version yet? - Just following up.

plyght avatar Dec 22 '24 11:12 plyght

not yet - I'll let you know when it is released 👍

curlpipe avatar Dec 22 '24 11:12 curlpipe

@plyght released with 0.7.6

Documentation can be found here: https://github.com/curlpipe/ox/wiki/Plugins#ai

Let me know if claude and chatgpt works (they probably won't, but hopefully they magically do)

I'll keep this issue open until claude and chatgpt are working like a charm 👍

curlpipe avatar Dec 24 '24 13:12 curlpipe

@curlpipe

From my testing, it seems that OpenAI/Claude integration doesn’t work as expected. I believe this might be due to the need for the user to specify which “provider” they are using.

Additionally (and this is just based on my personal experience and preferences, so feel free to take it or leave it), I’m not a big fan of using comments in the file as a way to prompt the AI. While it works, I find it a bit odd to use as it feels out of place. Perhaps there’s a way to implement a more UI/X friendly method? Just a thought!

plyght avatar Dec 24 '24 14:12 plyght

From my testing, it seems that OpenAI/Claude integration doesn’t work as expected. I believe this might be due to the need for the user to specify which “provider” they are using.

Did you manually add ai = { model = "chatgpt", key = "api key goes here" } below the load_plugin("ai.lua") in your config file? Or did you use the configuration assistant?

Are there any errors you can see?

I’m not a big fan of using comments in the file as a way to prompt the AI

I really value your feedback - so please feel free to voice more opinions if you have them.

I think you're right, it's not ideal. Maybe by default, I could have it ask the user at the bottom (like it would for searching/replacing/commands/opening a file).

The other option is to have like an AI menu, similar to how file tree works, which is what cursor does. That would take quite a bit of effort to do, but it would make more sense and be more familiar to use.

curlpipe avatar Dec 24 '24 15:12 curlpipe

I manually added ai = { model = "chatgpt", key = "my-api-key-here" } like so: -- Load Plug-Ins -- load_plugin("autoindent.lua") load_plugin("pairs.lua") load_plugin("quickcomment.lua") load_plugin("ai.lua") ai = { model = "gpt-4o", key = "my-api-key-here" }

here is a screenshot for more clarity: image

plyght avatar Dec 24 '24 18:12 plyght