moved /v1 to the default base url, to enable support for pawan's free api.

pull/464/head
Adi Stroianu 2023-03-10 23:57:17 +02:00
rodzic 950100ab64
commit e16296d471
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -49,7 +49,7 @@ export class ChatGPTAPI {
constructor(opts: types.ChatGPTAPIOptions) {
const {
apiKey,
apiBaseUrl = 'https://api.openai.com',
apiBaseUrl = 'https://api.openai.com/v1',
debug = false,
messageStore,
completionParams,
@ -170,7 +170,7 @@ export class ChatGPTAPI {
const responseP = new Promise<types.ChatMessage>(
async (resolve, reject) => {
const url = `${this._apiBaseUrl}/v1/chat/completions`
const url = `${this._apiBaseUrl}/chat/completions`
const headers = {
'Content-Type': 'application/json',
Authorization: `Bearer ${this._apiKey}`