anubhav77 commited on
Commit
1acc6c8
·
1 Parent(s): 62b5a09
Files changed (2) hide show
  1. src/chroma_intf.py +2 -0
  2. src/main.py +1 -1
src/chroma_intf.py CHANGED
@@ -146,6 +146,8 @@ def addText(inStr:str,metadata):
146
  md[key]=metadata[key]
147
  if "timestamp" not in metadata.keys():
148
  md['timestamp']=datetime.now()
 
 
149
  md['ID']=md['timestamp'].strftime("%Y-%m-%d %H:%M:%S::%f")+"-conversation"
150
 
151
  docs = [
 
146
  md[key]=metadata[key]
147
  if "timestamp" not in metadata.keys():
148
  md['timestamp']=datetime.now()
149
+ else:
150
+ md['timestamp']=datetime.fromisoformat(md['timestamp'])
151
  md['ID']=md['timestamp'].strftime("%Y-%m-%d %H:%M:%S::%f")+"-conversation"
152
 
153
  docs = [
src/main.py CHANGED
@@ -21,7 +21,7 @@ class PathRequest(BaseModel):
21
  dir: str = "/"
22
 
23
  class MetaD(BaseModel):
24
- timestamp: Optional[datetime]= datetime.now()
25
  class Config:
26
  allow_population_by_field_name = True
27
  extra = Extra.allow
 
21
  dir: str = "/"
22
 
23
  class MetaD(BaseModel):
24
+ timestamp: Optional[str]= datetime.now().isoformat()
25
  class Config:
26
  allow_population_by_field_name = True
27
  extra = Extra.allow