Giter VIP home page Giter VIP logo

openaiproxybackend's Introduction

openaiproxybackend

Introduce

This project will save session and chat history as a proxy to openai model. When chat become long enough, it will compact chat history.

More features are still under development.

Structure

Ignore the package.json under root directory.

-
|- api  The Azure function app that restore chat session and call openai completion API.
|- openaiproxywebsite  The frontend app based on React.js and Next.js
   |- pages  All webpages
      |- api  The API used by React app to call Azure function app in ./api folder.
   |- components  React frontend components

Local debug api

under api folder. Create a local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureDataStorage": "Your storage connection string",
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "OPENAI_API_KEY": "your api key",
    "CHATGPT_MODEL": "your gpt model",
    "OPENAI_API_BASE": "your gpt endpoint url",
    "OPENAI_API_TYPE": "azure or open_ai",
    "OPENAI_API_VERSION": "2023-03-15-preview or delete this parameter",
    "AzureWebJobsStorage": "Your webjob storage connection string"
  }
}

Install Azure function core tool in this url

then run func start under api folder

local debug website

under openaiproxywebsite folder. See openaiproxywebsite/README.md

endpoints

api trigger endpoint:

POST https://openaiproxybackendapp.azurewebsites.net/api/azopenaitrigger
{
    "promo": "Show me the folder structure of this azure function project.",
    "sessionId": "67214e13-ee31-4c05-b3bf-413f7815fa0d",
    "context": [""], // optional, if you need to add additional context
}

website endpoint:

openaiproxywebsite.azurewebsites.net

TODO

  • Session persistent in server and user browser.
  • User system.
  • Login with Wechat.
  • Create application with preset context.
  • Create knowledge base application with context and vector based search database.

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.