Merge pull request #21 from ItzBlinkzy/main

pull/25/head
Travis Fischer 2022-12-05 22:52:51 -06:00 zatwierdzone przez GitHub
commit cf5e775713
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -95,7 +95,7 @@ the response.
| :------ | :------ | :------ | | :------ | :------ | :------ |
| `message` | `string` | The plaintext message to send. | | `message` | `string` | The plaintext message to send. |
| `opts` | `Object` | - | | `opts` | `Object` | - |
| `opts.converstationId?` | `string` | - | | `opts.conversationId?` | `string` | - |
| `opts.onProgress?` | (`partialResponse`: `string`) => `void` | - | | `opts.onProgress?` | (`partialResponse`: `string`) => `void` | - |
#### Returns #### Returns

Wyświetl plik

@ -86,11 +86,11 @@ export class ChatGPTAPI {
async sendMessage( async sendMessage(
message: string, message: string,
opts: { opts: {
converstationId?: string conversationId?: string
onProgress?: (partialResponse: string) => void onProgress?: (partialResponse: string) => void
} = {} } = {}
): Promise<string> { ): Promise<string> {
const { converstationId = uuidv4(), onProgress } = opts const { conversationId = uuidv4(), onProgress } = opts
const accessToken = await this.refreshAccessToken() const accessToken = await this.refreshAccessToken()
@ -107,7 +107,7 @@ export class ChatGPTAPI {
} }
], ],
model: 'text-davinci-002-render', model: 'text-davinci-002-render',
parent_message_id: converstationId parent_message_id: conversationId
} }
const url = `${this._backendApiBaseUrl}/conversation` const url = `${this._backendApiBaseUrl}/conversation`