It looks like the format the Gemini model expects has changed and this causes an error.
site-packages/langchain_google_genai/chat_models.py", line 188, in _chat_with_retry
raise ChatGoogleGenerativeAIError(
langchain_google_genai.chat_models.ChatGoogleGenerativeAIError: Invalid argument provided to Gemini: 400 * GenerateContentRequest.contents: contents is not specified
* GenerateContentRequest.tools[0].function_declarations[0].parameters.properties: should be non-empty for OBJECT type
* GenerateContentRequest.tools[0].function_declarations[1].parameters.properties[message].type: must be specified
Example Code
from dotenv import load_dotenv
import os
from langchain_google_genai import ChatGoogleGenerativeAI
import controlflow as cf
load_dotenv(verbose=True, override=True)
os.environ["GOOGLE_API_KEY"] = os.environ.get('GOOGLE_API_KEY')
cf.default_model = ChatGoogleGenerativeAI(
model="gemini-1.5-flash",
temperature=0,
max_tokens=None,
timeout=None,
max_retries=2,
)
# provide the model to an agent
agent = cf.Agent(name="writer")
# assign the agent to a task
task = cf.Task('Write a short poem about LLMs', agents=[agent])
# (optional) run the task
task.run()
### Version Information
```Text
controlflow==0.8.2
I believe this was solved in the 0.9x versions, as the example code works now, but please let me know if not! 0.9x included a new compilation pipeline for per-provider formatting.
Description
It looks like the format the Gemini model expects has changed and this causes an error.
Example Code
Additional Context
No response