Where can I find a roadmap of fucntions and methods that is use by openai

Basically I got a metal road block right now.

I am looking for documentation that would help me write code in node.js

Right now I am only seeing a piece of code to login… but where do I find all of the other pieces to add an input message for example? how to extract vector files?

For example I am looking at this code below:

const openai = new OpenAIApi(configuration);
const result = await openai.listEngines();

However I have seen YouTube videos with code like:

const result = await openai.createCompletion()

Is there a place where I can find the information for current methods / functions and know what they do and what parameters they can take?

Your source of resources will depend on the language and platform. For a start, you can see API reference on the forum sidebar.

It looks like you are posting openai node.js code, which was recently revised with a new release.

Example present-day code for obtaining a response.

import OpenAI from 'openai';

const openai = new OpenAI({
  apiKey: 'my api key', // defaults to process.env["OPENAI_API_KEY"]
});

async function main() {
  const chatCompletion = await openai.chat.completions.create({
    messages: [{ role: 'user', content: 'Say this is a test' }],
    model: 'gpt-3.5-turbo',
  });

  console.log(chatCompletion.choices);
}

main();

You don’t obtain a “vector” from a language model. You get language.

1 Like

Ok thank you!

Question… is the github samples the best reference that we have to build code?

For example this code below:

async function main() {
const chatCompletion = await openai.chat.completions.create({
messages: [{ role: ‘user’, content: ‘Say this is a test’ }],
model: ‘gpt-3.5-turbo’,
});

^^ this is a good sample, but with so random samples, how do I know the correct code is not something like:

const response = await openai.createChatCompletion({
model: “gpt-3.5-turbo”,
messages: messages,
temperature: 0,
});

How do I know what is the correct method/function I want to use after:

openai.something.somethingelse

I am also interested in knowing about the parameters taken… such as messages taking an array of objects with key and values of role: and content:… ← I know of these just by looking at other people’s code, but not much from the docs…

Also interested in creating a Q & A document with specific information that the bot can take for answers.

How do you know the documentation is correct? You get the documentation right from the code library that you are using. Like how I gave you a link to openai’s node.js library and then pasted the code right out of their example.

If the documentation is short enough, you can provide it with input along with the question to be answered, just like you might do in ChatGPT.

1 Like