xtekky / gpt4free

The official gpt4free repository | various collection of powerful language models
https://g4f.ai
GNU General Public License v3.0
60.23k stars 13.23k forks source link

TypeError: 'NoneType' object is not subscriptable (Image Generation) #2069

Closed BadPotato1007 closed 3 months ago

BadPotato1007 commented 3 months ago

Bug description So I am trying to run the image generation code, but I get a TypeError: 'NoneType' object is not subscriptable everytime I try. I have tried the example code, and this, but nothing seems to work.


from g4f.cookies import set_cookies
client = Client()
set_cookies(".google.com", {
  "__Secure-1PSID": ""
  "__Secure-1PSIDCC": "",
  "__Secure-1PSIDTS": ""
})

def g4f_generate_image():

  client = Client()
  query_en = "illustration of time"

  response = client.images.generate(
      model="gemini",
      prompt=query_en,
  )
  image_url = response.data[0].url
  return image_url

g4f_generate_image()```

![image](https://github.com/xtekky/gpt4free/assets/70943638/16dce6cf-9cfb-4de5-8e8d-f140d865025a)
github-actions[bot] commented 3 months ago

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] commented 3 months ago

Closing due to inactivity.