#help to Dalle2

28 messages · Page 1 of 1 (latest)

frosty escarp
#

i have added dalle2 in telegram bot. on request, it issues other links, and issues pictures from the Internet. here is the code: def openai_Image(prompt):
response = openai.Image.create(
prompt=prompt,
n=1,
size="256x256",
)
image_url = response['data'][0]['url']
def image_command(message: types.Message):
bot.send_message(message.chat.id, ['image_url'])

Help pls!

spark ferry
#

What do you mean it issues other links and pictures from the internet? @frosty escarp

spark ferry
# frosty escarp

Can you print the response that happens after you call

    response = openai.Image.create(
    prompt=prompt,
    n=1,
    size="256x256",
)
```?
#

do a print(response) after

frosty escarp
#

@spark ferry

#

in python it gives out the url correctly, but in the telegram bot it doesn't

spark ferry
#

in the last line change the ['image'] to just image and see if that helps

frosty escarp
#

???
def openai_Image(prompt):
response = openai.Image.create(
prompt=prompt,
n=1,
size="256x256",
)
image = response['data'][0]['url']
def image_command(message: types.Message):
bot.send_message(message.chat.id, ['image'])

Help pls!

fresh pier
# frosty escarp

this seems to be an answer that GPT-3 would return, not DALL-E. are you sure your command is doing the correct API call?

spark ferry
#

Yup ^^

#

This is definitely not what you're getting from an image.create call.

#

Are you sure you're not using an answer from GPT3?

#

Also, in

  bot.send_message(message.chat.id, ['image'])
#

It doesn't make sense to pass image as ['image']

#

pass it as just image

frosty escarp
#

Thank you! I will try today

frosty escarp
frosty escarp
#

def openai_Image(prompt):
response = openai.Image.create(
prompt=prompt,
n=1,
size="256x256",
)
image = response['data'][0]['url']
def image_command(message: types.Message):
bot.send_message(message.chat.id, ['image'])

#

(((

frosty escarp
#

Pls

#

where to click to create api dalle2 token?