kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/335/head
rodzic
cea8df65c1
commit
8af7e8311d
|
@ -294,6 +294,7 @@ export class ChatGPTAPI {
|
||||||
if (response?.id) {
|
if (response?.id) {
|
||||||
result.id = response.id
|
result.id = response.id
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response?.choices?.length) {
|
if (response?.choices?.length) {
|
||||||
result.text = response.choices[0].text.trim()
|
result.text = response.choices[0].text.trim()
|
||||||
} else {
|
} else {
|
||||||
|
@ -337,6 +338,14 @@ export class ChatGPTAPI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get apiKey(): string {
|
||||||
|
return this._apiKey
|
||||||
|
}
|
||||||
|
|
||||||
|
set apiKey(apiKey: string) {
|
||||||
|
this._apiKey = apiKey
|
||||||
|
}
|
||||||
|
|
||||||
protected async _buildPrompt(
|
protected async _buildPrompt(
|
||||||
message: string,
|
message: string,
|
||||||
opts: types.SendMessageOptions
|
opts: types.SendMessageOptions
|
||||||
|
|
Ładowanie…
Reference in New Issue