qcobjects-openai-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

QCObjects OpenAI API

Install

npm i qcobjects-openai-api

Setup in your config.json

"backend":{
    "routes":[
        {
          "name":"QCObjects Open AI API Proxy",
          "description":"This endpoint returns same response like if you were calling to OpenAI API",
          "path": "^/api/openai$",
          "microservice":"qcobjects-openai-api",
          "headers": {
            "content-type": "text/html; charset=utf-8"
          },
          "responseHeaders":{
          },
          "cors":{
            "allow_origins":"*"
          }
        }
    ]
}

The way of using it

import {chatbotComponent} from "qcobjects-openai-api/components";

document.addEventListener("DOMContentLoaded", ()=>{
    document.body.append(chatbotComponent.body);
});

# Visit

Visit https://localhost:port/api/openai

Create your own microservice

To make your own microservice, you can generate it with QCObjects CLI using this package as template:

qcobjects create --custom=qcobjects-openai-api myown-handler-microservice

Package Sidebar

Install

npm i qcobjects-openai-api

Weekly Downloads

1

Version

1.0.14

License

LGPL-3.0-or-later

Unpacked Size

96.6 kB

Total Files

97

Last publish

Collaborators

  • jeanmachuca