Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Use my openAI account #12

Open
pedromartip opened this issue Mar 13, 2023 · 1 comment
Open

Use my openAI account #12

pedromartip opened this issue Mar 13, 2023 · 1 comment

Comments

@pedromartip
Copy link

Hello there,

I would like to use my openAI account instead of this one:

function getGPTResponse(question) {

var options = {
'method' : 'post',
'contentType': 'application/json',
// Convert the JavaScript object to a JSON string.
'payload' : JSON.stringify({
'message': question
})
};

const response = UrlFetchApp.fetch('https://chatgpt-api.kesarx.repl.co/chat', options);
const json = JSON.parse(response.getContentText());
return json.choices[0].message.content;
}

Does anyone know how to change it for the openAI chat API? (https://platform.openai.com/docs/api-reference/chat)

Thanks!

@cesarhuret
Copy link
Owner

hey @pedromartip , to add your own OpenAI account, you can spin up your own server using the code provided in the server folder, and change the url in the code you provided above to the URL of your own server. Lmk if you need any help with that!

@github-staff github-staff deleted a comment from maulanaayub May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants