I’m having a problem applying the memory in my agent system, although my agent manages to return the response correctly in its output, after that I receive an error:
Failed to add to long term memory: Failed to convert text into a Pydantic model due to the following error: litellm.AuthenticationError: geminiException - {
“error”: {
“code”: 400,
“message”: “API key not valid. Please pass a valid API key.”,
“status”: “INVALID_ARGUMENT”,
“details”: [
{
“@type”: “type.googleapis.com/google.rpc.ErrorInfo”,
“reason”: “API_KEY_INVALID”,
“domain”: “googleapis.com”,
“metadata”: {
“service”: “generativelanguage.googleapis.com”
}
},
{
“@type”: “type.googleapis.com/google.rpc.LocalizedMessage”,
“locale”: “en-US”,
“message”: “API key not valid. Please pass a valid API key.”
}
]
}
}
When I switch to the Gemini key for the OpenAi one, this problem does not occur.
To use the memory I had to configure an embedder model, I chose an ollama model with 1536 embedding dimension, because without this it would give another error.
my crew setup:
crew = Crew(
agents=[agent],
tasks=[task],
verbose=True,
memory=True,
embedder={
“provider”: “ollama”,
“config”: {
“model”: “rjmalagon/gte-qwen2-1.5b-instruct-embed-f16:latest”
}
},
knowledge_sources=[json_source],
)