mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Get ID, QUERY, TYPE, CATEGORY properties from org property drawer when present
This commit is contained in:
parent
0263d4d068
commit
7ee3007070
1 changed files with 8 additions and 0 deletions
|
@ -120,6 +120,14 @@ def convert_org_entries_to_jsonl(entries, verbose=0):
|
|||
if verbose > 2:
|
||||
print(f"Body: {entry.Body()}")
|
||||
|
||||
for property_key in ('ID', 'QUERY', 'TYPE', 'CATEGORY'):
|
||||
if entry.Property(property_key):
|
||||
if 'Property' not in entry_dict:
|
||||
entry_dict['Property'] = dict()
|
||||
entry_dict['Property'][property_key] = entry.Property(property_key)
|
||||
if verbose > 2:
|
||||
print(f'Property: {entry_dict["PROPERTY"][property_key]}')
|
||||
|
||||
if entry_dict:
|
||||
# Convert Dictionary to JSON and Append to JSONL string
|
||||
jsonl += f'{json.dumps(entry_dict, ensure_ascii=False)}\n'
|
||||
|
|
Loading…
Reference in a new issue