Document¶
- pydantic model schemas.document.DocumentBase¶
Base class for Document
Show JSON schema
{ "title": "DocumentBase", "description": "Base class for Document", "type": "object", "properties": { "language": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Language" }, "tag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tag" }, "text": { "title": "Text", "type": "string" }, "url": { "title": "Url", "type": "string" } }, "required": [ "text", "url" ] }
- Config:
arbitrary_types_allowed: bool = True
- Fields:
- field language: str | None = None¶
Language of the document text
- field tag: str | None = None¶
Tag of the document text
- field text: str [Required]¶
Content of the document
- field url: str [Required]¶
URL where the document was found
- pydantic model schemas.document.DocumentCreate¶
Create class for Document
Show JSON schema
{ "title": "DocumentCreate", "description": "Create class for Document", "type": "object", "properties": { "language": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Language" }, "tag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tag" }, "text": { "title": "Text", "type": "string" }, "url": { "title": "Url", "type": "string" }, "embedding": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Embedding" }, "source": { "title": "Source", "type": "string" } }, "required": [ "text", "url", "source" ] }
- Config:
arbitrary_types_allowed: bool = True
- Fields:
- field embedding: list[float] | None = None¶
- field language: str | None = None¶
Language of the document text
- field source: str [Required]¶
How the document was found, can be a URL or a file path for example
- field tag: str | None = None¶
Tag of the document text
- field text: str [Required]¶
Content of the document
- field url: str [Required]¶
URL where the document was found
- pydantic model schemas.document.DocumentsCreate¶
Create class for Documents
Show JSON schema
{ "title": "DocumentsCreate", "description": "Create class for Documents", "type": "object", "properties": { "objects": { "items": { "$ref": "#/$defs/DocumentCreate" }, "title": "Objects", "type": "array" } }, "$defs": { "DocumentCreate": { "description": "Create class for Document", "properties": { "language": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Language" }, "tag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tag" }, "text": { "title": "Text", "type": "string" }, "url": { "title": "Url", "type": "string" }, "embedding": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Embedding" }, "source": { "title": "Source", "type": "string" } }, "required": [ "text", "url", "source" ], "title": "DocumentCreate", "type": "object" } }, "required": [ "objects" ] }
- field objects: list[DocumentCreate] [Required]¶
A list of documents to add to the database
- pydantic model schemas.document.DocumentUpdate¶
Update class for Document
Show JSON schema
{ "title": "DocumentUpdate", "description": "Update class for Document", "type": "object", "properties": { "language": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Language" }, "tag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tag" }, "text": { "title": "Text", "type": "string" }, "url": { "title": "Url", "type": "string" }, "source_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Source Id" }, "embedding": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Embedding" } }, "required": [ "text", "url" ] }
- Config:
arbitrary_types_allowed: bool = True
- Fields:
- field embedding: list[float] | None = None¶
- field language: str | None = None¶
Language of the document text
- field source_id: int | None = None¶
- field tag: str | None = None¶
Tag of the document text
- field text: str [Required]¶
Content of the document
- field url: str [Required]¶
URL where the document was found
- pydantic model schemas.document.Document¶
Show JSON schema
{ "title": "Document", "type": "object", "properties": { "language": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Language" }, "tag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tag" }, "text": { "title": "Text", "type": "string" }, "url": { "title": "Url", "type": "string" }, "id": { "title": "Id", "type": "integer" } }, "required": [ "text", "url", "id" ] }
- Config:
arbitrary_types_allowed: bool = True
from_attributes: bool = True
- Fields:
- field id: int [Required]¶
- field language: str | None = None¶
Language of the document text
- field tag: str | None = None¶
Tag of the document text
- field text: str [Required]¶
Content of the document
- field url: str [Required]¶
URL where the document was found