@@ -151,6 +151,12 @@ def _ensure_database_properties(self, database_id: str) -> str:
151151 if "Provider" not in db_properties :
152152 properties_to_add ["Provider" ] = {"select" : {}}
153153
154+ if "reasoning_annotation" not in db_properties :
155+ properties_to_add ["reasoning_annotation" ] = {"rich_text" : {}}
156+
157+ if "context" not in db_properties :
158+ properties_to_add ["context" ] = {"rich_text" : {}}
159+
154160 if properties_to_add :
155161 print (f" 📝 Adding missing properties: { list (properties_to_add .keys ())} " )
156162 self .client .databases .update (
@@ -231,6 +237,8 @@ def build_property_value(prop_name: str, value: str, preferred_type: str = "sele
231237 question = qa .get ("question" , qa .get ("Q" , "" ))
232238 answer = qa .get ("answer" , qa .get ("A" , "" ))
233239 qa_type = qa .get ("type" , "unknown" )
240+ reasoning_annotation = qa .get ("reasoning_annotation" , "" )
241+ context = qa .get ("context" , "" )
234242
235243 # Build page properties for this QA
236244 properties = {
@@ -283,6 +291,24 @@ def build_property_value(prop_name: str, value: str, preferred_type: str = "sele
283291 "number" : tokens_per_qa
284292 },
285293 "Provider" : build_property_value ("Provider" , provider , "select" ),
294+ "reasoning_annotation" : {
295+ "rich_text" : [
296+ {
297+ "text" : {
298+ "content" : reasoning_annotation [:2000 ] if reasoning_annotation else ""
299+ }
300+ }
301+ ]
302+ },
303+ "context" : {
304+ "rich_text" : [
305+ {
306+ "text" : {
307+ "content" : context [:2000 ] if context else ""
308+ }
309+ }
310+ ]
311+ },
286312 }
287313
288314 # Create the page (row)
0 commit comments