Skip to content

Commit

Permalink
api method update
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiesun committed Nov 28, 2023
1 parent 0eab459 commit 60d0f14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import re
import uuid
from typing import Dict, List
from typing import Dict, List, Optional

from dotenv import load_dotenv
import logging
Expand Down Expand Up @@ -227,9 +227,9 @@ async def create_index(item: IndexItem, td: TokenData = Depends(verify_api_key))
return RestResult(code=0, msg="success")


@app.post("/knowledge/search", summary="Search the knowledge base",
description="Search the knowledge base for relevant content")
async def search_index(item: IndexSearchItem, td: TokenData = Depends(verify_api_key)):
@app.api_route("/knowledge/search", methods=["GET", "POST"], summary="Search the knowledge base",
description="Search the knowledge base for relevant content")
async def search_index(item: Optional[IndexSearchItem] = None, td: TokenData = Depends(verify_api_key)):
"""Search the knowledge base to return relevant content"""
try:
log.info(f"search_index: {item}")
Expand Down

0 comments on commit 60d0f14

Please sign in to comment.