提交 6e7078cf 作者: imClumsyPanda

update api.py

上级 6e022d0d
...@@ -2,15 +2,12 @@ import argparse ...@@ -2,15 +2,12 @@ import argparse
import json import json
import os import os
import shutil import shutil
import subprocess
import tempfile
from typing import List, Optional from typing import List, Optional
import nltk import nltk
import pydantic import pydantic
import uvicorn import uvicorn
from fastapi import Body, FastAPI, File, Form, Query, UploadFile, WebSocket from fastapi import Body, FastAPI, File, Form, Query, UploadFile, WebSocket
from fastapi.openapi.utils import get_openapi
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel from pydantic import BaseModel
from typing_extensions import Annotated from typing_extensions import Annotated
...@@ -144,7 +141,7 @@ async def upload_files( ...@@ -144,7 +141,7 @@ async def upload_files(
async def list_docs( async def list_docs(
knowledge_base_id: Optional[str] = Query(description="Knowledge Base Name", example="kb1") knowledge_base_id: Optional[str] = Query(default=None, description="Knowledge Base Name", example="kb1")
): ):
if knowledge_base_id: if knowledge_base_id:
local_doc_folder = get_folder_path(knowledge_base_id) local_doc_folder = get_folder_path(knowledge_base_id)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论