mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-09 22:04:47 +00:00
feat: Introduce the RAPTOR Search.
This commit is contained in:
parent
fc937edf03
commit
a9db0a8ceb
11 changed files with 318 additions and 127 deletions
|
@ -11,6 +11,8 @@ from sqlalchemy.exc import IntegrityError, OperationalError
|
|||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.future import select
|
||||
from langchain.schema import HumanMessage, AIMessage
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.post("/chat")
|
||||
|
@ -28,6 +30,8 @@ async def handle_chat_data(
|
|||
search_space_id = request.data.get('search_space_id')
|
||||
research_mode: str = request.data.get('research_mode')
|
||||
selected_connectors: List[str] = request.data.get('selected_connectors')
|
||||
|
||||
search_mode_str = request.data.get('search_mode', "CHUNKS")
|
||||
|
||||
# Convert search_space_id to integer if it's a string
|
||||
if search_space_id and isinstance(search_space_id, str):
|
||||
|
@ -66,7 +70,8 @@ async def handle_chat_data(
|
|||
session,
|
||||
research_mode,
|
||||
selected_connectors,
|
||||
langchain_chat_history
|
||||
langchain_chat_history,
|
||||
search_mode_str
|
||||
))
|
||||
response.headers['x-vercel-ai-data-stream'] = 'v1'
|
||||
return response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue