kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
Merge pull request #464 from adi6409/main
commit
5fef0f6ead
|
@ -49,7 +49,7 @@ export class ChatGPTAPI {
|
||||||
constructor(opts: types.ChatGPTAPIOptions) {
|
constructor(opts: types.ChatGPTAPIOptions) {
|
||||||
const {
|
const {
|
||||||
apiKey,
|
apiKey,
|
||||||
apiBaseUrl = 'https://api.openai.com',
|
apiBaseUrl = 'https://api.openai.com/v1',
|
||||||
debug = false,
|
debug = false,
|
||||||
messageStore,
|
messageStore,
|
||||||
completionParams,
|
completionParams,
|
||||||
|
@ -170,7 +170,7 @@ export class ChatGPTAPI {
|
||||||
|
|
||||||
const responseP = new Promise<types.ChatMessage>(
|
const responseP = new Promise<types.ChatMessage>(
|
||||||
async (resolve, reject) => {
|
async (resolve, reject) => {
|
||||||
const url = `${this._apiBaseUrl}/v1/chat/completions`
|
const url = `${this._apiBaseUrl}/chat/completions`
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: `Bearer ${this._apiKey}`
|
Authorization: `Bearer ${this._apiKey}`
|
||||||
|
|
Ładowanie…
Reference in New Issue