letta-ai / letta

Letta (formerly MemGPT) is a framework for creating LLM services with memory.
https://letta.com
Apache License 2.0
13.09k stars 1.43k forks source link

KeyError: 'candidates' #1557

Open Gavinmine opened 4 months ago

Gavinmine commented 4 months ago

Describe the bug It runs into KeyError: 'candidates' if I try use existing agent

Please describe your setup

Screenshots

Screenshot 2024-07-21 at 17 19 41 Screenshot 2024-07-21 at 17 20 03

Additional context I try to use existing agent with same human and persona, and it runs into KeyError: 'candidates' after I hit enter to begin. it works well if I setup with new agent.

MemGPT Config Please attach your ~/.memgpt/config file or copy past it below.

[model]
model = gemini-pro
model_endpoint_type = google_ai
context_window = 30720

[embedding]
embedding_endpoint_type = local
embedding_model = BAAI/bge-small-en-v1.5
embedding_dim = 384
embedding_chunk_size = 300

[archival_storage]
type = chroma
path = /Users/gavin/.memgpt/chroma

[recall_storage]
type = sqlite
path = /Users/gavin/.memgpt

[metadata_storage]
type = sqlite
path = /Users/gavin/.memgpt

[version]
memgpt_version = 0.3.19

Gavinmine commented 4 months ago

Looks like the response format doesn't correct, there is not any function_call or tool_calls. It cannot pass the "verify_first_message_correctness" so it will keep retrying until LLM response with null candidates.

{'candidates': [{'content': {'parts': [{'text': " Is there anything else you'd like to tell me about yourself?"}], 'role': 'model'}, 'finishReason': 'STOP',
'index': 0, 'safetyRatings': [{'category': 'HARM_CATEGORY_SEXUALLY_EXPLICIT', 'probability': 'NEGLIGIBLE'}, {'category': 'HARM_CATEGORY_HATE_SPEECH', 'probability': 'NEGLIGIBLE'},
{'category': 'HARM_CATEGORY_HARASSMENT', 'probability': 'NEGLIGIBLE'}, {'category': 'HARM_CATEGORY_DANGEROUS_CONTENT', 'probability': 'NEGLIGIBLE'}]}], 'usageMetadata':
{'promptTokenCount': 3964, 'candidatesTokenCount': 14, 'totalTokenCount': 3978}}