I am running exactly this example which is also defined as a test:
import typing_extensions as typing
class Recipe(typing.TypedDict):
recipe_name: str
model = genai.GenerativeModel("gemini-1.5-pro-latest")
result = model.generate_content(
"List a few popular cookie recipes.",
generation_config=genai.GenerationConfig(
response_mime_type="application/json", response_schema=list([Recipe])
),
)
Description of the bug:
I am running exactly this example which is also defined as a test:
The code is presented here for method
models.generateContent
: https://ai.google.dev/api/generate-content?hl=pt-br#method:-models.generatecontentThis is also a test defined here: https://github.com/google-gemini/generative-ai-python/blob/42d952a2429fa72c0f2617d71eb9aa3f708b6867/samples/controlled_generation.py#L18
It is raising TypeError:
TypeError: pop expected at most 1 argument, got 2
Actual vs expected behavior:
I expected the example to work with no errors and maybe this test is not being used.
Any other information you'd like to share?
Python version:
Python 3.10.12
Working on Databricks using the runtime:14.3 LTS