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

Overview

Azure Open AI is a Large Language Model provided by Microsoft in partnership with Open AI that allows developers to incooperate AI into web services.

By intergrating Azure 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 Azure Open AI account that you can create here.

Obtaining Azure Open AI Keys

To intergrate with Ocular you need the AZURE_OPEN_AI_KEY, AZURE_OPEN_AI_ENDPOINT, DEPLOYMENT_NAME, and the MODEL

You can follow this guide to get an API Key, Model Name, Deployment Name, Endpoint.

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 obtained from above.

AZURE_OPEN_AI_KEY=<API_KEY>
AZURE_OPEN_AI_ENDPOINT=<ENDPOINT>
AZURE_OPEN_AI_CHAT_DEPLOYMENT_NAME=<DEPLOYMENT_NAME>
AZURE_OPEN_AI_CHAT_MODEL=<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: "azure-open-ai",
         options: {
        open_ai_key: process.env.AZURE_OPEN_AI_KEY,
        open_ai_version: "2023-05-15",
        endpoint: process.env.AZURE_OPEN_AI_ENDPOINT,
        chat_deployment_name: process.env.AZURE_OPEN_AI_CHAT_DEPLOYMENT_NAME,
        chat_model: process.env.AZURE_OPEN_AI_CHAT_MODEL,
        rate_limiter_opts: {
          requests: 1, // Number of Tokens
          interval: 1, // Interval in Seconds
        },
      },
 },
]