pull/372/head
Travis Fischer 2023-02-19 03:21:13 -06:00
rodzic 218bdf81ab
commit 2460e5af93
1 zmienionych plików z 13 dodań i 1 usunięć

Wyświetl plik

@ -117,6 +117,18 @@ async function example() {
}
```
You can override the default `model` (`text-davinci-003`) and any [OpenAI completion params](https://platform.openai.com/docs/api-reference/completions/create) using `completionParams`:
```ts
const api = new ChatGPTAPI({
apiKey: process.env.OPENAI_API_KEY,
completionParams: {
temperature: 0.5,
top_p: 0.8
}
})
```
If you want to track the conversation, you'll need to pass the `parentMessageid` and `conversationid`:
```ts
@ -178,7 +190,7 @@ You'll notice that we're using a reverse-engineered `promptPrefix` and `promptSu
```ts
const res = await api.sendMessage('what is the answer to the universe?', {
promptPrefix: `You are ChatGPT, a large language model trained by OpenAI. You answer as concisely as possible for each response (e.g. dont be verbose). It is very important that you answer as concisely as possible, so please remember this. If you are generating a list, do not have too many items. Keep the number of items short.
promptPrefix: `You are ChatGPT, a large language model trained by OpenAI. You answer as concisely as possible for each responseIf you are generating a list, do not have too many items.
Current date: ${new Date().toISOString()}\n\n`
})
```