Spaces:
Sleeping
Sleeping
Update index.py
Browse files
index.py
CHANGED
@@ -4,7 +4,7 @@ sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
|
|
4 |
|
5 |
from fastapi import FastAPI, Form
|
6 |
from fastapi.middleware.cors import CORSMiddleware
|
7 |
-
from
|
8 |
|
9 |
app = FastAPI(
|
10 |
title="Mindify Chat API", description="API for Mindify Chat", version="0.1"
|
@@ -28,8 +28,7 @@ def query_chat_route(query: str = Form(...), repo_name: str = Form(...), token:
|
|
28 |
collection_name = repo_name.replace("/", "_")
|
29 |
if repo_name:
|
30 |
files = github_ingestion.ingest_github_repo(repo_name=repo_name, access_token=token)
|
31 |
-
collection = vector_store.
|
32 |
-
collection = vector_store.index_vector_store_chroma(collection=collection, files=files)
|
33 |
if collection != None:
|
34 |
query = vector_store.query_vector_store_chroma(collection=collection, query=query)
|
35 |
else:
|
@@ -38,8 +37,8 @@ def query_chat_route(query: str = Form(...), repo_name: str = Form(...), token:
|
|
38 |
|
39 |
return {"status": "success", "response": query}
|
40 |
|
|
|
41 |
if __name__ == "__main__":
|
42 |
import uvicorn
|
43 |
|
44 |
uvicorn.run(app)
|
45 |
-
|
|
|
4 |
|
5 |
from fastapi import FastAPI, Form
|
6 |
from fastapi.middleware.cors import CORSMiddleware
|
7 |
+
from cura import github_ingestion, vector_store, chatbot
|
8 |
|
9 |
app = FastAPI(
|
10 |
title="Mindify Chat API", description="API for Mindify Chat", version="0.1"
|
|
|
28 |
collection_name = repo_name.replace("/", "_")
|
29 |
if repo_name:
|
30 |
files = github_ingestion.ingest_github_repo(repo_name=repo_name, access_token=token)
|
31 |
+
collection = vector_store.index_vector_store_chroma(collection_name=collection_name, files=files)
|
|
|
32 |
if collection != None:
|
33 |
query = vector_store.query_vector_store_chroma(collection=collection, query=query)
|
34 |
else:
|
|
|
37 |
|
38 |
return {"status": "success", "response": query}
|
39 |
|
40 |
+
|
41 |
if __name__ == "__main__":
|
42 |
import uvicorn
|
43 |
|
44 |
uvicorn.run(app)
|
|