Group Abstract Group Abstract

Message Boards Message Boards

Change OpenAI API key for Chatbook

Posted 1 year ago
POSTED BY: Malte Weigelt
6 Replies
Posted 1 year ago

Solve It! Just changed AI Model to another and that back to Open AI

POSTED BY: Sergey Scorin

I suggest trying to access the API via Python to see if it is an OpenAI key issue or a Wolfram Language issue

pip install openai

Execute this Python code after changing YOUR_API_KEY to your key

import os
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY")

completion = client.chat.completions.create(model="gpt-3.5-turbo",
messages=[
  {"role": "user", "content": "What is ChatGPT?"}
])

print(completion.choices[0].message.content)
POSTED BY: Rohit Namjoshi

Try

ServiceConnect["OpenAI", "New"]
POSTED BY: Rohit Namjoshi
Posted 1 year ago

hi, thanks for you reply, i am using wolframcloud.com chat enabled notebooks did everything like you suggested, but only get one line of code saying
print completion.choices[0].message.content

enter image description here

POSTED BY: Sergey Scorin
Posted 1 year ago

the windows with field to insert the api key pops up, inserting it, and nothing changes, the api key in the error still wrong

enter image description here

POSTED BY: Sergey Scorin
Posted 1 year ago

Same here

find 7 identical issues on the forum!

community.wolfram.com/groups/-/m/t/3090214

community.wolfram.com/groups/-/m/t/3075200

community.wolfram.com/groups/-/m/t/2989628

community.wolfram.com/groups/-/m/t/2954069

community.wolfram.com/groups/-/m/t/2946932

community.wolfram.com/groups/-/m/t/3090245

community.wolfram.com/groups/-/m/t/3089393?ppauth=tiDLPi4o

any suggestions ?

POSTED BY: Sergey Scorin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard