[improvement](chat) Change llmparser to pyllm, retrieve LLMProxy from environment variables, defaulting to JavaLLMProxy. (#497)

This commit is contained in:
lexluo09
2023-12-12 14:29:35 +08:00
committed by GitHub
parent 49bb2c6d8b
commit 73899e3174
17 changed files with 84 additions and 72 deletions

View File

@@ -0,0 +1,33 @@
# -*- coding:utf-8 -*-
import os
import sys
import uvicorn
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from typing import Any, List, Mapping
from fastapi import FastAPI, HTTPException
from config.config_parse import LLMPARSER_HOST, LLMPARSER_PORT
from services_router import (query2sql_service, preset_query_service,
solved_query_service, plugin_call_service, retriever_service)
app = FastAPI()
@app.get("/health")
def read_health():
return {"status": "Healthy"}
app.include_router(preset_query_service.router)
app.include_router(solved_query_service.router)
app.include_router(query2sql_service.router)
app.include_router(plugin_call_service.router)
app.include_router(retriever_service.router)
if __name__ == "__main__":
uvicorn.run(app, host=LLMPARSER_HOST, port=LLMPARSER_PORT)