You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In app/api/chat.ts, the previewToken is being sent in the request's body, and is then being used here:
if (previewToken) {
configuration.apiKey = previewToken;
}
I modified the code to store the previewKey in the browser's local storage, and send it in the request, assuming that the OpenAIApi config would be updated with the new key in the post request, but that doesn't seem to be happening. The OpenAIApi object is being created outside the post request So I wonder what purpose the above code serves? Would we have to create a new OpenAIApi object inside the post request everytime we wanted to use the a user defined api key that isn't stored in a db?
The text was updated successfully, but these errors were encountered:
In app/api/chat.ts, the previewToken is being sent in the request's body, and is then being used here:
I modified the code to store the previewKey in the browser's local storage, and send it in the request, assuming that the OpenAIApi config would be updated with the new key in the post request, but that doesn't seem to be happening. The OpenAIApi object is being created outside the post request So I wonder what purpose the above code serves? Would we have to create a new OpenAIApi object inside the post request everytime we wanted to use the a user defined api key that isn't stored in a db?
The text was updated successfully, but these errors were encountered: