Код: Выделить всё
llama_index
Код: Выделить всё
from llama_index.core.schema import Document, TextNode
Код: Выделить всё
schema
raise PydanticSchemaGenerationError(
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() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
For further information visit https://errors.pydantic.dev/2.10/u/schema-for-unknown-type
I would understand what to do if this was one of my classes throwing this error (just add in the class attribute of arbitrary_types_allowed=True ).
Код: Выделить всё
File "/home/stevea/repos/interne/document-processing/.venv/lib/python3.12/site-packages/llama_index/core/instrumentation/events/query.py", line 21, in
class QueryEndEvent(BaseEvent):
File "/home/stevea/repos/interne/document-processing/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 226, in __new__
complete_model_class(
File "/home/stevea/repos/interne/document-processing/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 658, in complete_model_class
schema = cls.__get_pydantic_core_schema__(cls, handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Код: Выделить всё
[[package]]
name = "llama-index-core"
version = "0.11.23"
description = "Interface between LLMs and your data"
optional = false
python-versions = "=3.8.1"
files = [
{file = "llama_index_core-0.11.23-py3-none-any.whl", hash = "sha256:25a0cb4a055bfb348655ca4acd1b475529bd8537a7b81874ef14ed13f56e06c1"},
{file = "llama_index_core-0.11.23.tar.gz", hash = "sha256:e150859696a0eae169fe19323f46e9a31af2c12c3182012e4d0353ea8eb06d24"},
]
[package.dependencies]
...
pydantic = ">=2.7.0,=3.8"
Подробнее здесь: https://stackoverflow.com/questions/792 ... f-a-sudden