mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-24 15:42:26 +03:00
# Description - Refactor knowledge to a module - This PR breaks the Github Processor function -> need to comment brain and file imports as it creates a circular dependency issue. Should be fixed and reverted in next PR.
17 lines
436 B
Python
17 lines
436 B
Python
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class CreateKnowledgeProperties(BaseModel):
|
|
brain_id: UUID
|
|
file_name: Optional[str] = None
|
|
url: Optional[str] = None
|
|
extension: str = "txt"
|
|
|
|
def dict(self, *args, **kwargs):
|
|
knowledge_dict = super().dict(*args, **kwargs)
|
|
knowledge_dict["brain_id"] = str(knowledge_dict.get("brain_id"))
|
|
return knowledge_dict
|