Git Product home page Git Product logo

demo-gpt-4-temporal's Introduction

A Cloud Dev Assistant with GPT-4 and Pinecone on Gitpod

Gitpod Temporal Environment

A demo using Gitpod and Temporal to demonstrate GPT-4 coding assistant workflows.

tldr; adds the text from webpages to augment GPT-4's knowledge of the question you want to ask

Builds a Pinecone vector database index to augment queries to GPT-4, based loosely on this link, but with the data pipeline running in Temporal.

The vector database can then be used to add your data / context to your prompt, adding your knowledge to what GPT-4 has as context.

Open in Gitpod

Setup

You'll need to make sure the following environment variables are set in Gitpod:

  • OPENAI_API_KEY - OpenAI API key, grab one from here
  • PINECONE_API_KEY - Pinecone API key, grab one from here
  • PINECONE_ENVIRONMENT - Pinecone environment, you'll have this after you create an index. (Should be something like us-east4-gcp)
  • PINECONE_INDEX - The name of your actual Pinecone index
  • PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION - Set this to python, as it's needed because of a gRPC bug

With these environment variables set, you're ready to run the application.

Running the Retrieval Augmentation workflow

This example workflow scrapes a set of webpages from the Gitpod website, looking to steer GPT-4 with augmented data as to how to build a Gitpodified project.

It uses Pinecone as our Vector database, so you'll need to create a database with 1536 dimensions with dotproduct as the engine in order to run GPT-4 embeddings.

The free tier of Pinecone works well enough to run this example.

Gitpod Temporal Environment

To run the Temporal workers you'll need to run the following:

$ cd src
$ python3 worker.py

In another terminal, you can create and send the jobs to the workers with the starter:

$ cd src
$ python3 starter.py

Check the output by going to port 8233 in Gitpod, you'll see your workflows executing.

If you want to add your own URLs, look at the list of URLs at the beginning of the starter.py file.

Running Augmented Inference

Once you've created your knowledge base by running your Temporal Workflows, you can then query your augmented GPT-4 assisstant:

$ python3 ask-embeddings.py

There's more in the accompanying blog post.

Otherwise, you can see the example output in the gpt-4-output directory.

Running an Interactive Agent

There's an interactive version of the GPT-4 API running by default in this repo. It's called interactive-playground.py.

You can use this to query GPT-4 via the API and keep track of the questions you ask over time.

Check out the blog post

demo-gpt-4-temporal's People

Contributors

burningion avatar

Watchers

 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.