ztjhz / BetterChatGPT

An amazing UI for OpenAI's ChatGPT (Website + Windows + MacOS + Linux)
http://bettergpt.chat/
Creative Commons Zero v1.0 Universal
8.19k stars 2.77k forks source link

Plug-in support for BetterChatGPT #300

Open magedhelmy1 opened 1 year ago

magedhelmy1 commented 1 year ago

I am not sure how or if this is even possible, but will be cool to add Plugin support to BetterChatGPT to turn into BestChatGPT.

andriemc commented 1 year ago

This is possible. Plugins could generate / create prompts that would be added to the end of all messages sent. Or they could be used as system messages as well.

XOKP commented 1 year ago

While BetterChatGPT can provides plugin support, it is the plugin developers who create plugins for it. With so many third-party clients for GPT models in existence, one may wonder how many plugin developers will choose to dedicate their time to BetterChatGPT.

veloxy commented 1 year ago

While BetterChatGPT can provides plugin support, it is the plugin developers who create plugins for it. With so many third-party clients for GPT models in existence, one may wonder how many plugin developers will choose to dedicate their time to BetterChatGPT.

You don't need to make plugins specifically for BetterChatGPT, you need to implement them in the same way ChatGPT does it. Thorugh the /.well-known/ai-plugin.json plugin definition file and OpenAPI spec. See:

Some examples:

It sounds like a lot of work to support all the authentication methods and to safely let the model execute openapi calls. I feel the community in general would profit if such a system would be developed standalone and then integrated into all the different projects out there.

Though I'm also wondering if these API's are accessibly using the regular developer portals api keys

lindebuyer commented 1 year ago

Thank you for pointing out the way of possibility that developer of BetterChatGPT can implement plugin support , the official Doc looking very vague about how to implement plugins with Api usage.

I've look through the docs. And I thinkthe doc about how to implement self developed plugin on chat.openai.com, did not find any instructions about how to interact model api with existing plugin.

Please share more if you have more info.

veloxy commented 1 year ago

@lindebuyer langchain apparently already has support for chatgpt plugins (without auth) https://js.langchain.com/docs/modules/agents/tools/aiplugin-tool so that would be a good source.

lindebuyer commented 1 year ago

@lindebuyer langchain apparently already has support for chatgpt plugins (without auth) https://js.langchain.com/docs/modules/agents/tools/aiplugin-tool so that would be a good source.

@veloxy hi thank you for reply with new info.

I took a look of the langchain method. I think there's a performance problem for that agent that it need to figure out wether to use plugin or not in every input prompts from user.

From what I understand.

The chatGPT model don't actually aware and how to use plugin. Which kind of useless since it can simply add 5-8seconds to finalize chat completion.

I have theory that the official openai app is feeding the model special enhanced prompt like plugin manifest to get the evaluation process as it generating answers. So it will know to how and when to use which plugin on the first generation. Not like long-chain method use extra conversation to use plugin. Don't know if I am right. Still trying to figure out this.

If anyone sees this thread please share more.

MonsalvoGeoffrey commented 1 year ago

From OpenAI's documentation: https://platform.openai.com/docs/plugins/introduction

OpenAI will inject a compact description of your plugin in a message to ChatGPT, invisible to end users. This will include the plugin description, endpoints, and examples.

While to my knowledge the exact formatting of this "invisible prompt" is unknown, you are correct in that the official app simply feed the model with an enhanced prompt. At least it appears to according to the documentation.

XOKP commented 1 year ago

An unofficial plugin of Code Interpreter has been developed, hence it's achievable.

https://ricklamers.io/posts/gpt-code/

PriNova commented 1 year ago

Here is the instruction to read out all endpoints from all plugin's currently available:

Open the dev console in the browser. Go to the network tab. Select GPT4 and then go to the plugin store. In the network tab appears “p?offset=0&limit=250&statuses=approved” as name. Inspect this in the preview. Copy the json object from the response and voila… You have all the plugins with their respective ai-plugin.json and openapi.yaml link and their endpoints.

I don’t know if this helps.

But with this, only one plugin could be developed which calls the endpoints browser side. Or you host your own local plugin which calls the endpoints. And the nice part is, no limitations of only 3 plugin's available. Does this makes sence?

PriNova commented 1 year ago

Before I forget it, there is PyScript, a very clever idea to execute python directly in HTML.

https://pyscript.net/

With this, a direct integration of all plugin's without limitations are possible. Even with the GPT-3.5 model.

lindebuyer commented 1 year ago

@PriNova we are on to something 😸

lindebuyer commented 1 year ago

Réf article : https://medium.com/@imicknl/how-do-chatgpt-plugins-and-similar-llm-concepts-work-2c83a4aeedd4

Looks like currently without figure out what secret prompt OpenAI injecting the model. Langchain or semantic kernel are currently the best bet for plugin support of Api use case.

Basically is build a interceptor to run a reasoning result before every prompt submitted by user.

Ps: I posted this ref article above because it has example of inject reasoning prompt for plugin . Similar prompt has been practiced in this article https://eavanvalkenburg.medium.com/harnessing-the-power-of-openai-and-power-bi-datasets-12e926017f1c

I think with collection of released official plugins manifest, is possible for us integrate in our project. At least I think we can add webBrowsing capability. With the prompt in the article

I'm not sure if the project owner @ztjhz has plan incorporate this. Because thought is it one of the official feature. But kind of against BetterChatGPT purpose which is a productivity tool to freely customize and edit prompt at user's client. And with these skills it become a goal oriented service. And the reasoning prompt steps is better processing in the backend. Not at user browser.

veloxy commented 1 year ago

OpenAI just introduced function calling https://openai.com/blog/function-calling-and-other-api-updates

magedhelmy1 commented 1 year ago

@akira0245 and @mariodian can you please help to guide us with how to achieve this? More specifically, it will be cool if we can add browsing capabilities to BetterChatGPT since it is a low hanging fruit that can deliver alot.

LycanDarko666 commented 1 year ago

Do not use this service, they are charging token usage when you give them you're private API keys, even if you haven't used the service. I just performed an audit of their service and they are stealing. Go ahead and try it out yourselves! Delete all your keys, make a new one just for them, link your payment info to OpenAI, and then wait a few hours, without using the service, and watch your usage page on OpenAI and your tokens go up.

I cant believe no one is talking about this.

Edit: https://www.reddit.com/r/ChatGPT/comments/132t5yq/question_using_bettergpt_with_an_api_for_the/

MonsalvoGeoffrey commented 1 year ago

Do not use this service, they are charging token usage when you give them you're private API keys, even if you haven't used the service. I just performed an audit of their service and they are stealing. Go ahead and try it out yourselves! Delete all your keys, make a new one just for them, link your payment info to OpenAI, and then wait a few hours, without using the service, and watch your usage page on OpenAI and your tokens go up.

I cant believe no one is talking about this.

Edit: https://www.reddit.com/r/ChatGPT/comments/132t5yq/question_using_bettergpt_with_an_api_for_the/

Yeah, I have in fact double checked this crazy claim, and it turns out the new key I've linked to BetterChatGPT has a total usage how $0.00, and a last time of use of Never after waiting for a while.

I also in particularily love how the reddit link you sent was someone awknoledging their claim against BettterChatGPT was erroneous.

The reason no one talks about this is simply that this is purely incorrect, but you don't seem mallicious so I can just presume you're missattributing to BetterChatGPT the reason you suddenly paid $0.01

Having in the meantime barely ever exceeded my soft limit of $1.00 while using it intensively for months... It doesn't look suspicious.

LycanDarko666 commented 1 year ago

Really? You "double checked" my "crazy claim" by deleting all your keys, giving them a secret key, and waiting hours? Cause the post hasn't been here long enough for you to "double check" as you put it.

They were the only one I gave my key to. Refute me when you have verified it yourself.

This was on a an account with no previous API usage, this is not a mistake.

magedhelmy1 commented 1 year ago

@fenrirlycan please do not spam this post since this is quite important topic here, please keep this issue in your ticket that you opened, thank you.

mariodian commented 1 year ago

@akira0245 and @mariodian can you please help to guide us with how to achieve this? More specifically, it will be cool if we can add browsing capabilities to BetterChatGPT since it is a low hanging fruit that can deliver alot.

Browsing is discussed in #304

mariodian commented 1 year ago

I just performed an audit of their service and they are stealing

Please show the part of the code that steals your API key and uses it without your knowledge. If you can't, I'd recommend you to delete the comment or I will report it.

turb1te commented 1 year ago

I'm not sure if it would help BetterGPT to add support for plugins, but here's a project that has them: https://chat.pierangelo.info/

Michspirit99 commented 1 year ago

So i want to bump this.

This is also another project that already has functional plugin support in the vein of bettergpt. No reason this can't be adapted. I've used this and it works.

https://github.com/sxqib/ChatGPT-with-Plugins

Michspirit99 commented 1 year ago

This would also solve #362 because i already have a plugin built that performs this function and there are already plugins that offer web support. This really needs to be implemented.