Open-ChatGPT-Plugins 😎
Read this in other languages: English, 中文.
Open-ChatGPT-Plugins is an open-source project🌟 aimed at building an open and diverse ecosystem of chatbot plugins. This project enables developers to easily add new functionalities and interactive experiences to the ChatGPT model✨.
Background 📚
At the Developer Conference, OpenAI introduced GPT-4 Turbo, proposing the concept of "Assistants". This was seen by developers as a plugin marketplace for the general public version (non-plugin developers). With the increased context length of GPT-4 Turbo and its high comprehension ability, we can replicate the capabilities of ChatGPT-Plugins, thus building an open-source local version of ChatGPT-Plugins.
Features 💡
- Unlike other tool projects, this project is fully compatible with the ChatGPT-Plugins API service. This means that if you have previously written an API for ChatGPT-Plugins, you can directly interface with the previous API service using this project, without the need for redevelopment🚀.
- Experience Plugins services without purchasing ChatGPT Plus🎉.
Installation 🔧
To install the necessary packages for this plugin, run the following command:
pip install openplugins
Usage 🖥️
- First method: Upload the API's YAML file
import openplugins
assistant = openplugins.Assistants(yaml_file_path='../openai.yaml', tools_model='gpt-4-1106-preview', openai_api_key='sk-xxxx')
print(assistant.run('Please check the historical stock data of Guizhou Maotai for yesterday'))
print(assistant.id)
- Second method: Use via Assistant ID
import openplugins
assistant = openplugins.Assistants(assistant_id='eafa9807-7cff-4afb-b069-ce3437c076fb', tools_model='gpt-4-1106-preview', openai_api_key='sk-xxxx')
print(assistant.run('Please check the historical stock data of Guizhou Maotai for yesterday'))
- Third method: Update the YAML file
import openplugins
assistant = openplugins.Assistants(yaml_file_path='openai.yaml', assistant_id='eafa9807-7cff-4afb-b069-ce3437c076fb', tools_model='gpt-4-1106-preview', openai_api_key='sk-xxxx')
print(assistant.run('Please check the historical stock data of Guizhou Maotai for yesterday'))
Note: The API service must be run first. For the API service, refer to the StockMarketAssistant project🔗.Or check out the official openai projectplugins-quickstart return is a dict
import openplugins
assistant = openplugins.Assistants(yaml_file_path='openai.yaml', tools_model='gpt-4-1106-preview', openai_api_key='sk-xxxxxxxx')
print(assistant.run('result of 1+1'))
{'plan': [{'tool': '', 'plan': 'Reply with the result of "1+1", which is "2".'}], 'response': '2'}
View currently available assistants
import openplugins
data = openplugins.DataInfo()
print(data.get_all_assistants_info())
Delete currently available assistants
import openplugins
data = openplugins.DataInfo()
data.delete_assistant(assistant_id = 'cf1f114a-019c-4e36-a8d4-681f5027ef8c')
Principle 🤖
This project replicates ChatGPT-Plugins and requires a YAML file to describe the interface, with one YAML corresponding to the initialization of an Assistant. The main process includes:
- Reading the YAML file and creating an Assistant based on the file description.
- Starting a thread.
- First, recommend tools.
- Formulate a plan based on the recommendation list.
- Call the services step by step according to the plan.
- Generate the final result by combining the results of each step.
TODO List:
- Check if the YAML file meets requirements (To be completed)📝.
- Integrate Streamlit UI (To be completed)🖌️.
📝 License
MIT License Disclaimer: We share this code for academic purposes under the MIT educational license.
Metadata
Release files for openplugins 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openplugins-0.1.9.tar.gz | 18.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openplugins-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.0 kB
Release files / openplugins-0.1.9.tar.gz
| Download URL | openplugins-0.1.9.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
638a716dd07f706fe7f34ab30c99faee66f945a8fd98b03eb2f370f12934b4b1
|
|
BLAKE2b-256 checksum How to use checksums |
fc3b45aa73fbe3b1bf774bbd68aa597d225e5517e9ce9b6dbcf348ff7dfa57e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / openplugins-0.1.9-py3-none-any.whl
| Download URL | openplugins-0.1.9-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99cda7391fb626b8cfb43ca569f8a34a3fcd6ff2f4aeb0a21e8825e699c255c8
|
|
BLAKE2b-256 checksum How to use checksums |
882e475f65518b17d6cb10923c8e2ff00ae313d2c3da124ff1684a169f1159e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|