Skip to content
Merged
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
26 changes: 26 additions & 0 deletions generate_synthetic_table/notion_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ def _ensure_database_properties(self, database_id: str) -> str:
if "Provider" not in db_properties:
properties_to_add["Provider"] = {"select": {}}

if "reasoning_annotation" not in db_properties:
properties_to_add["reasoning_annotation"] = {"rich_text": {}}

if "context" not in db_properties:
properties_to_add["context"] = {"rich_text": {}}

if properties_to_add:
print(f" 📝 Adding missing properties: {list(properties_to_add.keys())}")
self.client.databases.update(
Expand Down Expand Up @@ -231,6 +237,8 @@ def build_property_value(prop_name: str, value: str, preferred_type: str = "sele
question = qa.get("question", qa.get("Q", ""))
answer = qa.get("answer", qa.get("A", ""))
qa_type = qa.get("type", "unknown")
reasoning_annotation = qa.get("reasoning_annotation", "")
context = qa.get("context", "")

# Build page properties for this QA
properties = {
Expand Down Expand Up @@ -283,6 +291,24 @@ def build_property_value(prop_name: str, value: str, preferred_type: str = "sele
"number": tokens_per_qa
},
"Provider": build_property_value("Provider", provider, "select"),
"reasoning_annotation": {
"rich_text": [
{
"text": {
"content": reasoning_annotation[:2000] if reasoning_annotation else ""
}
}
]
},
"context": {
"rich_text": [
{
"text": {
"content": context[:2000] if context else ""
}
}
]
},
}

# Create the page (row)
Expand Down