1.0.2 • Published 6 months ago
openaibackend v1.0.2
openAIBackend
This is the backend component of the openAIBackend project, which allows you to interact with the OpenAI API.
Introduction
The "openAIBackend" is a Node.js application that integrates with the OpenAI API. It provides a wrapper for easy interaction with the API to perform tasks such as text generation, language translation, and more.
Getting Started
To get started with the openAIBackend, follow the instructions below:
Prerequisites
Before using the backend, you need to have the npm_open_ai
package installed and obtain an API key from OpenAI.
You can install the npm_open_ai
package using npm:
npm install npm_open_ai
How to Use
To utilize the "openAIBackend," you can make API requests to the server as follows:
const { createOpenAIWrapper } = require('npm_open_ai');
const apiKey = 'your api key'; // Replace with your own API key
const openai = createOpenAIWrapper(apiKey);
(async () => {
const prompt = 'Translate the following English text to French: "Hello, world."';
const answer = await openai.ask(prompt);
console.log(answer);
})();