#the prompt works on chat.openai, but executing in code it says that's too long

5 messages · Page 1 of 1 (latest)

plucky epoch
#

I'm sending a long text to the AI analyze and resume, when testing on the chat.openai interface it works well, but when testing executing in code, it shows that error:

    data: {
      error: {
        message: "This model's maximum context length is 4097 tokens, however you requested 15845 tokens (1845 in your prompt; 14000 for the completion). Please reduce your prompt; or completion length.",
        type: 'invalid_request_error',
        param: null,
        code: null
      }

that's my configuration:

  const response = await openai.createCompletion({
    model: "text-davinci-003",
    prompt: "resume the following youtube video text transcription: " + prompt,
    max_tokens: 14000,
    temperature: 0.7,
  });

why is that wrong? does chat.openai use different configuration? if so, what configuration?

queen jungle
#

What is your max_tokens set to?

#

For the request

proven shale
#

Max tokens for davinci 3 doesn't go that high

#

It's 4097