Normana234因为googel2.0fe支持生图了,自己用的前端还没适配,想用api试试调用 中发帖

然后按照官网的调用代码,怎么都报错,问AI一轮轮也没解决 
抱歉,一个不懂代码的不该碰这玩意的,就该老老实实等适配。
谷歌文档写的调用代码
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO

client = genai.Client()

contents = ('Hi, can you create a 3d rendered image of a pig '
'with wings and a top hat flying over a happy '
'futuristic scifi city with lots of greenery?')

response = clien...