Hi everyone. I am trying to create an assistant by assistant API. But it seems like the openai.beta doesn’t exist. I have checked if it’s problem with the set up but the openai.chat.completions run successfully.
Here is my code:
const assistant = await openai.beta.assistants.create({
name: "math tutor",
instructions: `You are a math tutor`,
tools: [{ type: "code_interpreter" },
model: "gpt-4-1106-preview"
});
same issue in my code @PaulBellow … with latest OpenAI and Node.js libraries
const {OpenAI} = require ('openai');
//create OpenAI const
const openai = new OpenAI({
apiKey: "sk-8i4mGLctxxxxxxxxxxxxxc6RJaLa",
});
console.log("1. This is my openai object:", openai);
main();
async function main() {
// Step 1: Create an Assistant
const myAssistant = await openai.beta.assistants.create({
model: "gpt-4",
instructions:
"You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
name: "Math Tutor",
tools: [{ type: "code_interpreter" }],
});
console.log("This is the assistant object: ", myAssistant, "\n");
} //END