0

I am testing using the Open AI API with the end-point:

https://api.openai.com/v1/completions

But, I find that on the website https://chat.openai.com/chat , we can simplely use the continue to ask the AI to give the answer with the context. And we can use continue mulittime to expand more the the max token limit.

Is it possible to use "continue" in the API or have the same effect?

I have try to use the user field in the API, but still not work.

Rubén
  • 34,714
  • 9
  • 70
  • 166
qus
  • 9
  • 3
  • My understanding is that ChatGPT does not expose APIs yet. Is the api link above for the other language models like davinci – Rajib Deb Dec 25 '22 at 06:41

1 Answers1

2

Yes, you can, if you send the prehistory of your correspondence, or the part that needs to be finished and use Stop word/s.:

continue: your text that was not finished

There is also an option to just use 'n' param and higher 'max_tokens'

const response = await openai.createCompletion({
    model: 'text-davinci-003',
    prompt: 'continue: your text that was not finished \n',
    n: 5,
    temperature: 0.5,
    max_tokens: 2000,
    stop: '\n', // or ['AI:', 'user:']
})

It means AI will send you 5 * 2000 tokens and text after your stop word. Here is good example.