Instructions on how to install and use the Open AI plugin.

Overview

Open AI is a Large Language Model provider that allows developers to incoperate AI into web services.

By integrating Open AI with Ocular, developers will be able access embedding and chat completion capabilities.

Prerequisites

Before going further with guide make sure Ocular is set up. You also need an Open AI you can create here.

Obtaining Open AI Keys

To intergrate with Ocular you need the OPEN_AI_KEY and the OPEN_AI_CHAT_MODEL

You can follow this guide to get an API key and the Model name.

Install the Plugin

Navigate to Ocular home directory.

Add Keys

Locate the env.local or env.dev file depending on the environment you are running Ocular. Add the following keys:

OPEN_AI_KEY=<YOUR_API_KEY>
OPEN_AI_CHAT_MODEL=<OPEN_AI_MODEL>

Replace <YOUR_API_KEY> with your API Key and <OPEN_AI_MODEL> with your Open AI model.

Add Plugin to Ocular Config

Locate the core-config-local.js or core-config-dev.js file depending on the environment you are running Ocular. Add the following keys:

core-config-xxx.js
plugins: [
 // ...
 {
     resolve: "open-ai",
     options: {
       open_ai_key: process.env.OPEN_AI_KEY,
       chat_model: process.env.OPEN_AI_CHAT_MODEL,
       rate_limiter_opts: {
         requests: 1000000, // Number of Tokens
         interval: 60, // Interval in Seconds
       },
     },
 },
]