#Error while trying to use the API

8 messages · Page 1 of 1 (latest)

wild solar
#

While trying to use the text-davinci-002 engine i get the error

In content: Must be 2000 or fewer in length. ``` 
and was wondering what i was doing wrong. here's the code im using 
```async def chatgpt(ctx):
    response = openai.Completion.create(
        engine="text-davinci-002",
        prompt=f"{ctx.message.content}",
        max_tokens=1024
    )
    response_text = response["choices"][0]["text"]
        await ctx.channel.send(response_text)```
eternal jetty
#

You're sending more text than is allowed in a discord message

wild solar
#

huh

#

good to know

gusty spruce
#

i am getting error but idk why?

wild solar