vhr1007 commited on
Commit
7d54a46
·
1 Parent(s): 9db95db
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -77,7 +77,7 @@ class SearchDocumentsRequest(BaseModel):
77
  limit: int = 3
78
 
79
  class GenerateRAGRequest(BaseModel):
80
- search_query: str
81
 
82
 
83
  @app.get("/")
@@ -135,7 +135,7 @@ async def generate_rag_response_api(
135
  logging.info("Starting document search")
136
 
137
  # Encode the query using the custom embedding function
138
- query_embedding = embed_text(body.search_query)
139
  print(body.query)
140
  collection_name = "embed" # Use the collection name where the embeddings are stored
141
  # Perform search using the precomputed embeddings
@@ -148,7 +148,7 @@ async def generate_rag_response_api(
148
  logging.info("Generating RAG response")
149
 
150
  # Generate the RAG response using the retrieved documents
151
- response, error = generate_rag_response(hits, body.search_query)
152
 
153
  if error:
154
  logging.error(f"Generate RAG response error: {error}")
 
77
  limit: int = 3
78
 
79
  class GenerateRAGRequest(BaseModel):
80
+ query: str
81
 
82
 
83
  @app.get("/")
 
135
  logging.info("Starting document search")
136
 
137
  # Encode the query using the custom embedding function
138
+ query_embedding = embed_text(body.query)
139
  print(body.query)
140
  collection_name = "embed" # Use the collection name where the embeddings are stored
141
  # Perform search using the precomputed embeddings
 
148
  logging.info("Generating RAG response")
149
 
150
  # Generate the RAG response using the retrieved documents
151
+ response, error = generate_rag_response(hits, body.query)
152
 
153
  if error:
154
  logging.error(f"Generate RAG response error: {error}")