diff --git a/generate_synthetic_table/notion_uploader.py b/generate_synthetic_table/notion_uploader.py index f7390d1..90bdafd 100644 --- a/generate_synthetic_table/notion_uploader.py +++ b/generate_synthetic_table/notion_uploader.py @@ -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( @@ -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 = { @@ -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)