Message Boards Message Boards

Chat Notebook Settings - The new button in 13.2

Posted 1 year ago

I recently watched the video featured on youtube; Chat Notebooks Bring the Power of Notebooks to LLMs. I set up my notebook to work with the new button on the top right of the notebook, but I'm getting rate limited whenever I submit a request. I currently pay for ChatGPT Plus, and it should not be limited. I can only assume I made an error when inputting my API secret. However, I need help finding where to update the API secret I shared after installing the plugin. I cannot find anything in the options.

Where can I update my API secret inside my notebook? Is there some sort of global issue with rate limiting going on right now?

enter image description here

POSTED BY: Ziggy Stardust
20 Replies
Posted 1 year ago

Does anyone know how to set the OPENAI_API_BASE for a chat notebook? I have an OpenAI key that corresponds to a specific API base, not the default base https://api.openai.com/v1. This allows me to run it successfully. curl $OPENAI_API_BASE/models \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "OpenAI-Organization: org-mvUSw9fFhNVVqQUesafVo0F6"

POSTED BY: Wang Qlong

Looks like you're paying for ChatGPT Plus subscription and then separately for API usage. Yeah, it is what it is. Technically, you don't need the Plus subscription, but I think it's worth it.

POSTED BY: Tamas Simon

Now with OpenAI launching support for fine-tuning of GPT-3.5 it is becoming urgent to be able to set model names properly. Can we please get an ETA for when this will be added and how it will work?

Talking about this: enter image description here

POSTED BY: Tamas Simon

Hi, this feature has been implemented in the main branch but not publicly available via the paclet yet (pull request: https://github.com/WolframResearch/Chatbook/pull/304 ). Should hopefully have a paclet with the update out soon!

POSTED BY: Avery Davis

Wolfram badly needs a product manager!

Thanks

POSTED BY: Tamas Simon

Thanks so much, Rohit -- that was exactly the problem I was having. After restarting Mathematica, all seems to work fine :) I realize I have only a limited credit, but it's not zero!

POSTED BY: John Bechhoefer

I am trying to create a resource definition notebook to set up a "Persona" prompt along with some LLMTools and config. First time I clicked "Install From URL..." I saw a pop-up dialog but then got an error. Now the dialog no longer appears and I just get an error when I invoke this menu option.

Something got "stuck"

How can I clean it up?

POSTED BY: Tamas Simon

Hello! The Chat Notebooks functionality is still in active development so please keep reporting issues you come across :)

You can try deleting this directory and restarting the front end (evaluate Quit) Wolfram`Chatbook`PersonaInstaller`$PersonaInstallationDirectory There's also an undocumented function to remove named personas Wolfram`Chatbook`PersonaInstaller`Private`uninstallPersona["AnimalSpeak"] That would for example remove the AnimalSpeak persona

POSTED BY: Avery Davis

Apologies that it's not clear on https://resources.wolframcloud.com/PacletRepository/resources/Wolfram/Chatbook ! We should be able to make an update so it's more clear about SystemCredential usage

You can do: SystemCredential["OPENAI_API_KEY"] = "key" to reset what the current key is.

If you're still having an issue, my recommendation would be to check that the key is functional with the API using a curl command from the command-line (OpenAI has an example here: https://platform.openai.com/docs/api-reference/chat/create)

Here's an example OpenAI has documented

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"}]
  }'

If you still see an issue with your API key then there's something that has gone wrong with the API key generation and I'd recommend reaching out to OpenAI for a solution!

POSTED BY: Avery Davis

Thank you! I was able to update my API key, and now the bot is working correctly. I think it's important to note the below as well. It looks like the API and Plus subscription are billed separately.

ChatGPT API and ChatGPT Plus subscription are billed separately. The API has its own pricing, which can be found at Pricing. The ChatGPT Plus subscription covers usage on chat.openai.com only and costs $20/month.

Oh yes, and the code SystemCredential["OPENAI_API_KEY"] = "key" prompted me to enter my API key again in the dialog box regardless of the fact that I entered it into the "key" field.

Thanks for your quick response!

Ziggy

POSTED BY: Ziggy Stardust

I'm having an issue that may be related. I have unfortunately two openai accounts. I had trouble with the first, opened a second, and then found out that there are no free credits with the second. I now know how to use the first account, but I had already logged into the second in Mathematica 13.3. Executing

chat = ChatEvaluate[chat, "What's the tallest mountain?"]

returns a "You exceeded your quota..." message. Is there a way to get Mathematica to "log out" of an openai account, so that I can log in again using the proper account? (I thought changing the API, as above would work, but it does not.)

Attachments:
POSTED BY: John Bechhoefer

There is a another discussion on: https://community.wolfram.com/groups/-/m/t/2946932 to address similar issues.

For the OpenAI Mathematica notebook features (including chat) to work you need an OpenAI API key. You can get a key to use the API in a trial for 3 months (with a max rate and max $5, but it can get you far enough).

The ChatGPT Plus subscription and the OpenAI API are billed separately. The ChatGPT Plus subscription covers usage exclusively on the chat.openai.com platform and costs $20 per month, providing benefits such as general access even during peak times, faster response times, and priority access to new features and improvements.

On the other hand, the OpenAI API has its own separate pricing structure. It allows developers to integrate the OpenAI models, including ChatGPT, into their own applications or software. The API usage is billed based on the number of API calls made and the amount of tokens processed. The API usage is not covered by the ChatGPT Plus subscription, and it requires a separate subscription and separate payment.

POSTED BY: Dave Middleton

Thanks, Dave. I do have an OpenAI key -- in fact, two of them, one for each account. I think that one of these accounts does have some credit, but the second account has no credits (because OpenAI doesn't want people to use multiple accts to get around paying for more usage, which is reasonable). Anyway, executing

SystemCredentialKeys[All]

returns

{"wolframcloudconnect:www.wolframcloud.com&johnb@sfu.ca"}

The latter email address is also the user name of the "bad" account. I want to start over and use the "good" account, but I don't see how to do this. Executing

SystemCredential["OPENAI_API_KEY"] =.

does not work. (But maybe I didn't get your point -- does using any of the new LLM features in Mathematica require a paid subscription?)

POSTED BY: John Bechhoefer

Hi John,

Evaluate the following to set or reset the API key

ServiceConnect["OpenAI", "New"]
POSTED BY: Rohit Namjoshi

John, Rohit answered the question on how to change or set your OpenAI key (Thanks Rohit).

For the OpenAI key to work within Mathematica you need an API key that can draw tokens from the OpenAI platform either through a trial or a pay-per-use account.

If your trial expired, you need to top-up your funds to continue drawing tokens with the existing key.

POSTED BY: Dave Middleton

Dear Avery,

Thanks for the offer to clarify the SystemCredentials use, especially now after the new OpenAI features have been introduced in version 13.3. Maybe you could explain for first-time users, how:

  • Mathematica will prompt for an API key upon first time use of certain services like OpenAI.
  • one can verify which services have been registered in Mathematica e.g. through SystemCredentialKeys one can view which keys have been registered. Or specifically what key has been registered e.g. SystemCredential["OPENAIAPIKEY"]
  • How to manually set or change any API key required for a service like OpenAI i.e. SerrviceConnect["OpenAI","New"]. Some users may have clicked away the Key registration form at the initial start of a service.

Also can you spend a few words on the different openAI subscriptions required for each service as there is some confusion about this as well?

  • OpenAI API key is required for Mathematica services that connect through a notebook e,g. chat-notebooks, LLMFunction etc.
  • OpenAI ChatGPT Plus for the online functionality with Wolfram Alpha plugins.

Even for more experienced users, these are usually options you will "set-and-forget". Ask me 6 months from now and I will have to look it up again.

POSTED BY: Dave Middleton

Apologies for not being able to respond sooner.

Mathematica will prompt for an API key upon first time use of certain services like OpenAI.

Yes, Wolfram Language will prompt you for an API key to access the OpenAI API that allows using the LLM in a Notebook.

one can verify which services have been registered in Mathematica e.g. through SystemCredentialKeys one can view which keys have been registered. Or specifically what key has been registered e.g. SystemCredential["OPENAIAPIKEY"]

Chat Notebooks and the LLMFunctions paclet (this includes functions like LLMSynthesize, ImageSynthesize, ChatEvaluate, etc.) use the API slightly differently internally. Chat Notebooks really only looks for SystemCredential["OPENAIAPIKEY"] where the LLMFunctions paclet can look at SystemCredential, an OpenAI service connection, an environment variable, and you can explicitly set your API key in the programmatic call.

How to manually set or change any API key required for a service like OpenAI i.e. SerrviceConnect["OpenAI","New"]. Some users may have clicked away the Key registration form at the initial start of a service.

If you're only using Chat Notebooks, the SystemCredential method is the way to go. If you have used or will use LLMFunctions paclet (this is new 13.3 symbols like LLMSynthesize, see: https://reference.wolfram.com/language/guide/LLMFunctions.html) then you will want to use ServiceConnect["OpenAI", "New"] to create a new connection. You can see a list of saved connections by doing ServiceConnections`SavedConnections[] and you can delete a specific connection by doing ServiceConnections`DeleteConnection[]

You only need to be able to create a valid API key from OpenAI for the services to work within Wolfram Language. OpenAI has documented what ChatGPT Plus gives you here: https://help.openai.com/en/articles/6950777-what-is-chatgpt-plus

Is the ChatGPT API included in the ChatGPT Plus subscription?

No, the ChatGPT API and ChatGPT Plus subscription are billed separately. The API has its own pricing, which can be found at https://openai.com/pricing. The ChatGPT Plus subscription covers usage on chat.openai.com only and costs $20/month.

POSTED BY: Avery Davis

Some better info on how to handle going from free 'openAI' to paid version would be helpful on the Wolfram side. For example, created a free account with chatGPTAPIkey. After upgrading to paid version do you need to generate new key? Seems like you would. Wolfram please put all of this in an easy to understand version in one place. Too many rabbit holes right now - and I only have a few good years left!!

POSTED BY: Steven Shippee

when you sign up for a free account with OpenAI they give you a little quota so you can generate API keys and use apps that access OpenAI via API and ask for such key... This quickly runs out. at that point you need to start paying to OpenAI. I don't think you need to generate new key... I think you can keep using it. You can check usage at https://platform.openai.com/account/usage you can also see when a particular API key was last used at https://platform.openai.com/account/api-keys (well, if it doesn't work you will know very quick)

POSTED BY: Tamas Simon

I ended up paying for 2 buckets, one https://chat.openai.com/ and second https://platform.openai.com/ I'm guessing platform? Mathematica uses which one, thanks.

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

Group Abstract Group Abstract