Update app.py
Browse files
app.py
CHANGED
@@ -56,7 +56,7 @@ concise_text = dataset["concise"]["text"]
|
|
56 |
concise_text_string = "".join(concise_text)
|
57 |
|
58 |
# Chunk and index the documents
|
59 |
-
chunks = chunk_text(concise_text_string, chunk_size=
|
60 |
# Build the vectorsore
|
61 |
vectorstore = build_faiss_vectorstore(chunks)
|
62 |
|
@@ -67,7 +67,7 @@ async def chat(request: ChatRequest):
|
|
67 |
client = genai.Client(api_key=google_api_key)
|
68 |
|
69 |
# Retrieve relevant text
|
70 |
-
results = retrieve(request.message, vectorstore)
|
71 |
formatted_results = "\n\n".join(results)
|
72 |
|
73 |
rag_prompt = f"""You have access to the following relevant information retrieved based on the user's query:
|
|
|
56 |
concise_text_string = "".join(concise_text)
|
57 |
|
58 |
# Chunk and index the documents
|
59 |
+
chunks = chunk_text(concise_text_string, chunk_size=450)
|
60 |
# Build the vectorsore
|
61 |
vectorstore = build_faiss_vectorstore(chunks)
|
62 |
|
|
|
67 |
client = genai.Client(api_key=google_api_key)
|
68 |
|
69 |
# Retrieve relevant text
|
70 |
+
results = retrieve(request.message, vectorstore, top_k=10)
|
71 |
formatted_results = "\n\n".join(results)
|
72 |
|
73 |
rag_prompt = f"""You have access to the following relevant information retrieved based on the user's query:
|