letta-ai / letta

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

Pydantic schema error with AsyncGenerator in llama-index integration #2077

Closed svetly closed 1 day ago

svetly commented 1 day ago

Describe the bug When trying to run letta with Python 3.10, getting a Pydantic schema generation error related to AsyncGenerator typing. The error occurs when trying to import the letta package, specifically in the llama-index integration.

Error: PydanticSchemaGenerationError: Unable to generate pydantic-core schema for typing.AsyncGenerator[str, NoneType]

Please describe your setup

Setup Details:

Python 3.12.7 (first attempt from your system Python)
Python 3.10.x (our second attempt via Homebrew)

Virtual Environment: Yes
Package versions:
- letta==0.5.3
- openai==1.55.0
- python-dotenv==1.0.1
- pydantic==1.10.13
- llama-index==0.8.54

Error Reproduction Steps:

  1. Create virtual environment with Python 3.10
  2. Install packages
  3. Run letta run command
  4. Error occurs during package import

Screenshots Screenshot 2024-11-20 at 5 47 01 PM

Additional context The error seems to be related to version compatibility between pydantic v2 and llama-index's AsyncGenerator usage in the QueryEndEvent class. Have tried multiple package version combinations but the error persists.


Not using local LLM, using OpenAI API.

d4tocchini commented 1 day ago

Same error on my end on MacOS 14.4.1 & Python 3.12.4

mattzh72 commented 1 day ago

We're actively fixing this, seems like a bug on llamaindex's end: https://github.com/run-llama/llama_index/issues/17016