Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: A bug fix Update models.py #3484

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update models.py
fix error
File "/Users/baizhe/PycharmProjects/myquivr/.venv1/lib/python3.11/site-packages/pydantic/v1/validators.py", line 765, in find_validators
    raise RuntimeError(f'no validator found for {type_}, see `arbitrary_types_allowed` in Config')
RuntimeError: no validator found for <class 'langchain_core.documents.base.Document'>, see `arbitrary_types_allowed` in Config
  • Loading branch information
haozheng95 authored Nov 18, 2024
commit fe6259fd7addf83889198576dc96575cec566b62
6 changes: 5 additions & 1 deletion core/quivr_core/rag/entities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class ChatMessage(BaseModelV1):
msg: AIMessage | HumanMessage
message_time: datetime
metadata: dict[str, Any]

class Config:
arbitrary_types_allowed = True

class KnowledgeStatus(str, Enum):
ERROR = "ERROR"
Expand Down Expand Up @@ -112,3 +113,6 @@ class QuivrKnowledge(BaseModel):
class SearchResult(BaseModelV1):
chunk: Document
distance: float

class Config:
arbitrary_types_allowed = True
Loading