kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
Merge pull request #21 from ItzBlinkzy/main
commit
cf5e775713
|
@ -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
|
||||||
|
|
|
@ -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`
|
||||||
|
|
Ładowanie…
Reference in New Issue