Merge branch 'main' of https://huggingface.co/spaces/anubhav77/chroma
Browse files
main.py
CHANGED
@@ -134,13 +134,14 @@ def raw_sql(raw_sql: RawSql):
|
|
134 |
print("Received raw_sql request")
|
135 |
return bkend.raw_sql(raw_sql.raw_sql)
|
136 |
|
137 |
-
@app.
|
138 |
def walk(path: PathRequest):
|
139 |
print("Received walk request")
|
140 |
-
items=os.walk(path.dir)
|
141 |
response= JSONResponse(content= {"dirs":[]})
|
142 |
for item in items:
|
143 |
-
|
|
|
144 |
return response
|
145 |
|
146 |
@app.get(api_base+"/heartbeat")
|
|
|
134 |
print("Received raw_sql request")
|
135 |
return bkend.raw_sql(raw_sql.raw_sql)
|
136 |
|
137 |
+
@app.post(api_base+"/walk")
|
138 |
def walk(path: PathRequest):
|
139 |
print("Received walk request")
|
140 |
+
root,items,files =os.walk(path.dir)
|
141 |
response= JSONResponse(content= {"dirs":[]})
|
142 |
for item in items:
|
143 |
+
print(item)
|
144 |
+
response.content.dirs.extend(item)
|
145 |
return response
|
146 |
|
147 |
@app.get(api_base+"/heartbeat")
|