Coder Social home page Coder Social logo

hellowolaiye / chatgpt-plugins Goto Github PK

View Code? Open in Web Editor NEW

This project forked from serp-ai/chatgpt-plugins

0.0 0.0 0.0 87 KB

Repo for giving ChatGPT the ability to use web browsing, python code execution, and custom plugins

Home Page: https://serp.ai/tools/chatgpt-plugins/

Python 63.85% Jupyter Notebook 36.15%

chatgpt-plugins's Introduction

Welcome to SERP AI github.

Our goal is to advance AI, help others participate & learn, and create software together that we can all benefit from and enjoy.

  • If you'd like to be a part of the community, please join the Discord.
  • If you'd like to contribute to the mission, please join the Discord & DM @devinschumacher so we can add you to our ๐Ÿง™ Open Sorcerers team.

Links:


ChatGPT-Plugins

Repo for giving ChatGPT the ability to use web browsing, python code execution, and custom plugins

How to use

  • Make sure you have an openai account and have created an API key
  • Open plugins.ipynb
  • Insert your api key into the api_key variable in the first cell
  • Run all of the setup cells
  • Edit the example with your desired prompt.

How to edit what the model can do

  • Create a function that takes the arguments (last_action_input, chatgpt, max_tokens) and outputs the result of the truncate_text function (Don't forget to validate the input string matches what your function logic expects) (example in notebook)
  • Add the function name, definition, and the function as a dictionary to the function_definitions list (example in notebook)

How to use assistant class

  • The assistant class is a wrapper around chat style openai models. It has support for short term memory, long term memory, knowledge retrieval, memory summarization, and more. In order to use the action loop, make sure you do not use short or long term memory. If you want to use long term memory, you need to set up a docker container for (Qdrant)[https://qdrant.tech/] (free).
  • You can set it up like:
api_key = ''
system_prompt = None
debug = False
use_long_term_memory = False
use_short_term_memory = False
use_knowledge_retrieval = False
summarize_short_term_memory = False
summarize_long_term_memory = False
summarize_knowledge_retrieval = False
short_term_memory_max_tokens = 750
long_term_memory_max_tokens = 500
knowledge_retrieval_max_tokens = 1000
short_term_memory_summary_max_tokens = 300
long_term_memory_summary_max_tokens = 300
knowledge_retrieval_summary_max_tokens = 600
long_term_memory_collection_name = 'long_term_memory'

assistant = OpenAIAssistant(api_key, system_prompt=system_prompt, long_term_memory_collection_name=long_term_memory_collection_name, use_long_term_memory=use_long_term_memory, use_short_term_memory=use_short_term_memory, memory_manager=None, debug=debug, summarize_short_term_memory=summarize_short_term_memory, summarize_long_term_memory=summarize_long_term_memory, short_term_memory_max_tokens=short_term_memory_max_tokens, long_term_memory_max_tokens=long_term_memory_max_tokens, short_term_memory_summary_max_tokens=short_term_memory_summary_max_tokens, long_term_memory_summary_max_tokens=long_term_memory_summary_max_tokens, use_knowledge_retrieval=use_knowledge_retrieval, summarize_knowledge_retrieval=summarize_knowledge_retrieval, knowledge_retrieval_max_tokens=knowledge_retrieval_max_tokens, knowledge_retrieval_summary_max_tokens=knowledge_retrieval_summary_max_tokens)
  • You can then use the assistant like:
assistant.get_chat_response(prompt)

Depending on your settings, the class will handle the short term memory, long term memory, memory summarization, and messages contruction.

chatgpt-plugins's People

Contributors

francislabountyjr avatar devinschumacher avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.