Git Product home page Git Product logo

gpt4-expertmanager's Introduction

GPT4-ExpertManager

Prompt Library Manager

This library allows you to generate, store, and improve AI assistants (called "experts" in the code). The assistants are represented by the LanguageExpert class and can generate responses using either the OpenAI or Anthropic API.

Installation To install, clone this repo and install the requirements (Langchain, OpenAI, Anthropic)

You'll also need API keys for OpenAI and Anthropic, which should be stored in a config.py file like this:

OPENAI_API_KEY = "YOUR_KEY_HERE" 
ANTHROPIC_API_KEY = "YOUR_KEY_HERE"

Usage You can create a new Manager to store your experts:

manager = Manager() #Supply an existing library to load in existing experts.

Generate a new expert using the gen_prompt function:

expert = gen_prompt(manager) #Include prompt idea in ./promptpad.txt in same directory.

This will generate a prompt using the PromptGenerator and PromptIdeaGenerator experts, parse that into an expert, and add it to the manager.

You can then generate responses from the expert:

response = expert("Hello!")
print(response)
# Prints the expert's response to "Hello!"

Improve an existing expert with the improve function:

improved_expert = improve(expert, manager) 

This will use the PromptImprover and PromptSuggestionIncorporator to generate suggestions for improving the prompt, incorporate those into a new prompt, parse that into an expert, and return the new expert.

You can save all experts in the manager to a JSON file:

manager.save("experts.json")

And load experts from a JSON file into a manager:

manager.load("experts.json")

Let me know if you have any other questions!

gpt4-expertmanager's People

Contributors

bradybry 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.