Coder Social home page Coder Social logo

r2's Introduction

R2

R2 is a service that pulls events from different sources and use each event as context to start a GTP-4 chat and generate ideas, recommendations and information which might be relevant. Responses are persisted and displayed from a web app.

Demo wep app: https://app-leia-4vzghxfo4t7t2.azurewebsites.net/ Demo video:

R2-Demo.mp4

Demo notes:

  • A collection of events were used as input for R2 to generate each response displayed within the demo.

Deploying your own R2 instance

R2 uses the Azure Developer CLI to deploy the entire solution from a few steps.

  1. Install azd

  2. If you have alredy cloned the repository, run azd init from the root. Otherwise, you can run azd init -t vhvb1989/R2 and azd will pull the repo. To complete the init step, select a name for your environment.

  3. Configure your Azure OpenAI connection by running:

azd env set R2_OPENAI_ENDPOINT paste-open-ai-url-here
azd env set R2_AZURE_API_KEY paste-azure-api-key
  1. Run azd up. azd will create the next required Azure services:
  • Azure Key Vault: Holds connection to DB
  • Azure Cosmos DB: For the data persistance
  • Azure Web Apps:
    • padme: micro-service that interacts with OpenAI.
    • yoda: micro-service to handle DB and event sources.
    • leia: static front-end application.
  1. The final step is to inject persist the first events. This is because the yoda service is still learning how to automatically pull events from external sources. Hence, it provides the endpoit /reset/naboo/events where a collection of events can be pushed by you. All you need to do is do an HTTP POST call to the yoda url like:
  http post yoda-url/reset/naboo/events
  payload = [{event},{event}, ...]

You can find an example of a collection of events here.

  1. Now call padme service like:
  http get padme-url/generate

This will make padme to ask yoda for the list of events and start creating chats with OpenAI.

  1. Open leia front end to see the responses that are generated.

To run the demo again and generate new responses, repeate from step 5 ahead.

r2's People

Contributors

karishmaghiya avatar vhvb1989 avatar

Watchers

 avatar

r2's Issues

Create chat module

Based on an event like

{
  "title": "this is an event",
   "description": "this is the event description",
   "dateTime": "2023/10/31",
}

Use azure-sdk-for-node and talk to openAI to create a chat using the title, description and datetime. Add a final question at the end of the chat. Example:

Start chat with := I have an event named <title> where <description> on <date>. <final question>

For the final question, use something like provide interesting ideas about this event that I can use to make it better.

The module then should return the response from OpenAI service.

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.