forked from open-webui/open-webui
		
	feat: collection rag integration
This commit is contained in:
		
							parent
							
								
									7d2f788a3b
								
							
						
					
					
						commit
						683650ec00
					
				
					 5 changed files with 112 additions and 24 deletions
				
			
		|  | @ -97,15 +97,15 @@ async def get_status(): | |||
|     return {"status": True} | ||||
| 
 | ||||
| 
 | ||||
| class QueryCollectionForm(BaseModel): | ||||
| class QueryDocForm(BaseModel): | ||||
|     collection_name: str | ||||
|     query: str | ||||
|     k: Optional[int] = 4 | ||||
| 
 | ||||
| 
 | ||||
| @app.post("/query/collection") | ||||
| def query_collection( | ||||
|     form_data: QueryCollectionForm, | ||||
| @app.post("/query/doc") | ||||
| def query_doc( | ||||
|     form_data: QueryDocForm, | ||||
|     user=Depends(get_current_user), | ||||
| ): | ||||
|     try: | ||||
|  | @ -173,8 +173,8 @@ def merge_and_sort_query_results(query_results, k): | |||
|     return merged_query_results | ||||
| 
 | ||||
| 
 | ||||
| @app.post("/query/collections") | ||||
| def query_collections( | ||||
| @app.post("/query/collection") | ||||
| def query_collection( | ||||
|     form_data: QueryCollectionsForm, | ||||
|     user=Depends(get_current_user), | ||||
| ): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek