728x90
Error
from llama_index.core.bridge.langchain import Document
위 코드에서 아래와 같은 에러 발생
pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for typing.AsyncGenerator[str, NoneType]. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.
For further information visit https://errors.pydantic.dev/2.10/u/schema-for-unknown-type
해결방법
pydantic 버전을 명시해서 패키지를 다운그레이드 했음pydantic = "2.9.2"
원인
나는 아래와 같이 두 개의 패키지가 업데이트 되면서 에러가 나왔었다
- Updating pydantic-core (2.23.4 -> 2.27.0)
- Updating pydantic (2.9.2 -> 2.10.0)
728x90
'개발 > 파이썬' 카테고리의 다른 글
python pakage manage using uv (0) | 2024.12.10 |
---|---|
[SQLModel] Composite Key 설정 (0) | 2024.11.20 |
Langchain mulltiple edges error, Graph Parallel Processing (0) | 2024.11.12 |
PGVector Insert using SQLModel (2) | 2024.11.07 |
[pandas] (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape (0) | 2023.04.26 |