Spaces:
Sleeping
Sleeping
added documentation to the Sources schema
Browse files- rag_app/database/schema.py +13 -2
rag_app/database/schema.py
CHANGED
|
@@ -1,9 +1,20 @@
|
|
| 1 |
from sqlmodel import SQLModel, Field
|
| 2 |
from typing import Optional
|
| 3 |
-
|
| 4 |
import datetime
|
| 5 |
|
| 6 |
class Sources(SQLModel, table=True):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
id: Optional[int] = Field(default=None, primary_key=True)
|
| 8 |
url: str = Field()
|
| 9 |
title: Optional[str] = Field(default="NA", unique=False)
|
|
@@ -12,4 +23,4 @@ class Sources(SQLModel, table=True):
|
|
| 12 |
summary: str = Field(default="")
|
| 13 |
embedded: bool = Field(default=False)
|
| 14 |
|
| 15 |
-
__table_args__ = {"extend_existing": True}
|
|
|
|
| 1 |
from sqlmodel import SQLModel, Field
|
| 2 |
from typing import Optional
|
|
|
|
| 3 |
import datetime
|
| 4 |
|
| 5 |
class Sources(SQLModel, table=True):
|
| 6 |
+
"""
|
| 7 |
+
Database schema for the Sources table.
|
| 8 |
+
|
| 9 |
+
Attributes:
|
| 10 |
+
id (Optional[int]): The primary key for the table.
|
| 11 |
+
url (str): The URL of the source.
|
| 12 |
+
title (Optional[str]): The title of the source.
|
| 13 |
+
hash_id (str): A unique identifier for the source.
|
| 14 |
+
created_at (float): Timestamp indicating when the entry was created.
|
| 15 |
+
summary (str): A summary of the source content.
|
| 16 |
+
embedded (bool): Flag indicating whether the source is embedded.
|
| 17 |
+
"""
|
| 18 |
id: Optional[int] = Field(default=None, primary_key=True)
|
| 19 |
url: str = Field()
|
| 20 |
title: Optional[str] = Field(default="NA", unique=False)
|
|
|
|
| 23 |
summary: str = Field(default="")
|
| 24 |
embedded: bool = Field(default=False)
|
| 25 |
|
| 26 |
+
__table_args__ = {"extend_existing": True}
|