Skip to content

Commit

Permalink
UI for AI thoughts (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves authored Sep 2, 2023
1 parent 06c1afc commit c68afbe
Show file tree
Hide file tree
Showing 15 changed files with 1,259 additions and 83 deletions.
12 changes: 6 additions & 6 deletions backend/danswer/server/search_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,27 @@
router = APIRouter()


@router.get("/search-intent")
@router.post("/search-intent")
def get_search_type(
question: QuestionRequest = Depends(), _: User = Depends(current_user)
question: QuestionRequest, _: User = Depends(current_user)
) -> HelperResponse:
query = question.query
use_keyword = question.use_keyword if question.use_keyword is not None else False
return recommend_search_flow(query, use_keyword)


@router.get("/query-validation")
@router.post("/query-validation")
def query_validation(
question: QuestionRequest = Depends(), _: User = Depends(current_user)
question: QuestionRequest, _: User = Depends(current_user)
) -> QueryValidationResponse:
query = question.query
reasoning, answerable = get_query_answerability(query)
return QueryValidationResponse(reasoning=reasoning, answerable=answerable)


@router.get("/stream-query-validation")
@router.post("/stream-query-validation")
def stream_query_validation(
question: QuestionRequest = Depends(), _: User = Depends(current_user)
question: QuestionRequest, _: User = Depends(current_user)
) -> StreamingResponse:
query = question.query
return StreamingResponse(
Expand Down
5 changes: 5 additions & 0 deletions web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const nextConfig = {
destination: "http://127.0.0.1:8080/stream-direct-qa:params*", // Proxy to Backend
permanent: true,
},
{
source: "/api/stream-query-validation:params*",
destination: "http://127.0.0.1:8080/stream-query-validation:params*", // Proxy to Backend
permanent: true,
},
];
},
};
Expand Down
Loading

1 comment on commit c68afbe

@vercel
Copy link

@vercel vercel bot commented on c68afbe Sep 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.