Unlock additional perks by upgrading to Pro today!

Documentation

Example Use Case: Running PR Agent Locally

Consider the scenario where you wish to run a local instance of PR Agent. The standard documentation indicates the necessity of an OpenAI API key. While this is accurate, the structure of these systems allows for a more direct approach. You can utilize the Naga API without modifying any existing code.

Leveraging Official OpenAI Packages

The official OpenAI packages available on PyPI utilize PATH variables such as

OPENAI_API_KEY
OPENAI_BASE_URL

Similarly, this extends to projects developed using OpenAI's packages. Consider it like this: Any application that incorporates an OpenAI package can be seamlessly integrated with Naga. This flexibility is not only highly convenient but also enables the straightforward migration of existing applications that utilize OpenAI's API to Naga.

export OPENAI_API_KEY=YourNagaKeyGoesHere
export OPENAI_BASE_URL=https://api.naga.ac/v1

Or alternatively if you are running NT (Windows)

$env:OPENAI_API_KEY=YourNagaKeyGoesHere
$env:OPENAI_BASE_URL=https://api.naga.ac/v1

You can also source these variables in your shell startup files

Unix only!
curl https://raw.githubusercontent.com/segmentationf4u1t/NagaWeb/main/sourcemeUnix.txt >> ~/.bashrc

This script will append the path variables to your shell startup file. You can then replace the values with your Naga API key and Naga API base URL.

Example Codes & Implementations

On the right side of this webpage, you'll find sample code for Python and JavaScript. While similar in implementation, they differ in syntax, reflecting the architectural distinctions between the two languages. While not exhaustive, these examples serve as a solid starting point for using both OpenAI and NagaAI APIs.

All of Naga Endpoints as of today:

For other references, parameters, and endpoints please visit those resources:

Simple Chat Completions

Simple Embedding Generation

Simple Image Generation

Simple Vision Generation

Simple TTS Generation