MichelNivard / gptstudio

GPT RStudio addins that enable GPT assisted coding, writing & analysis
https://michelnivard.github.io/gptstudio/
Other
905 stars 109 forks source link

Feature Request: Use Functions to Evaluate R Code #113

Open MichelNivard opened 1 year ago

MichelNivard commented 1 year ago

OpenAI now offers "function calling" where the developers (us) can specify functions for chatGPT 3.5/4 to call when it encounters an situation where it feels this is appropriate.

Documentation here: https://platform.openai.com/docs/guides/gpt/chat-completions-api

Should we give our chat model a function to run R code to evaluate? Obviously there are other potential factions we could build like a function to look at the user environment etc?

I am thinking when a user asks "why doesn't this code work d <- dentiy(ddf$X)" the app could test the code, catch the error and use the error i its answer?

JamesHWade commented 1 year ago

Wonderful idea. I need to learn more about how functions work. This extensibility could be a good challenge for our S3 class over in #105.

lizongzhang commented 1 year ago

It would be very helpful to R users.

calderonsamuel commented 1 year ago

I'll look into it. I honestly don't totally understand how to implement this just following the docs, but I'll be checking out some examples in youtube

calderonsamuel commented 1 year ago

I just want to say that I've looked for examples in youtube and mostly found the same examples provided in the docs. The two other related projects I know about for VSCode (Genie and chatbot-ui) have nothing on functions

JamesHWade commented 8 months ago

This now exists in gpttools. I'll add this to the queue to add to gptstudio.