You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was trying out the fixes for gemini in v1.1.4 and got a strange error once hooking up memory with sqlite to an agent.
Steps to Reproduce
Add tools, memory and storage to an agent and set everything to True:
create_user_memories=True,
create_session_summary=True, # seems especially troublesome
update_user_memories_after_run=True,
update_session_summary_after_run=True,
agent = Agent(
model=model_flash,
tools=[DuckDuckGoTools(), CsvTools(csvs=[imdb_csv])],
markdown=True,
show_tool_calls=True,
telemetry=False,
monitoring=False,
instructions=[
"You have a local CSV file named imdb.csv with IMDB movie data",
"You can run a query with this csv file to answer questions.",
"You can also search the internet with DuckDuckGo.",
],
storage=SqliteAgentStorage(table_name="chat_agent", db_file=agent_storage),
# Adds the current date and time to the instructions
add_datetime_to_instructions=True,
# Adds the history of the conversation to the messages
add_history_to_messages=True,
# Number of history responses to add to the messages
num_history_responses=15,
memory=AgentMemory(
db=SqliteMemoryDb(db_file="tmp/agent_memory.db"),
create_user_memories=True,
create_session_summary=True, # troublesome
update_user_memories_after_run=True,
update_session_summary_after_run=True,
classifier=MemoryClassifier(model=model_flash),
summarizer=MemorySummarizer(model=model_pro),
manager=MemoryManager(model=model_flash),
),
)
Agent Configuration (if applicable)
Agent using the most recent gemini fixes.
Expected Behavior
Expected memory/session summaries to work
Actual Behavior
Odd error kept occurring:
return self.get_client().models.generate_content(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jeffbryner/development/agno-playground/.venv/lib/python3.12/site-packages/google/genai/models.py", line 4672, in generate_content
response = self._generate_content(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jeffbryner/development/agno-playground/.venv/lib/python3.12/site-packages/google/genai/models.py", line 3807, in _generate_content
request_dict = _GenerateContentParameters_to_vertex(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jeffbryner/development/agno-playground/.venv/lib/python3.12/site-packages/google/genai/models.py", line 1180, in _GenerateContentParameters_to_vertex
for item in t.t_contents(
^^^^^^^^^^^^^
File "/Users/jeffbryner/development/agno-playground/.venv/lib/python3.12/site-packages/google/genai/_transformers.py", line 321, in t_contents
raise ValueError('contents are required.')
ValueError: contents are required.
Environment
Agno Version: v1.1.4
External Dependency Versions: duckduck go tools, csv tools
Possible Solutions (optional)
A simple exit if empty will fix the issue for me locally:
if not formatted_messages:
return GenerateContentResponse()
try:
return self.get_client().models.generate_content(
model=self.id,
contents=formatted_messages,
**request_kwargs,
)
...
in each of the functions that gather formatted messages before calling the model
Description
Was trying out the fixes for gemini in v1.1.4 and got a strange error once hooking up memory with sqlite to an agent.
Steps to Reproduce
Add tools, memory and storage to an agent and set everything to True:
create_user_memories=True,
create_session_summary=True, # seems especially troublesome
update_user_memories_after_run=True,
update_session_summary_after_run=True,
Agent Configuration (if applicable)
Agent using the most recent gemini fixes.
Expected Behavior
Expected memory/session summaries to work
Actual Behavior
Odd error kept occurring:
Environment
Possible Solutions (optional)
A simple exit if empty will fix the issue for me locally:
in each of the functions that gather formatted messages before calling the model
Additional Context
It appears that the
which is made before calling the gemini model
can result in empty 'formatted_messages' .
When I added some logging I got logs showing calls with no messages:
The text was updated successfully, but these errors were encountered: