mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
[improvement](chat) Change llmparser to pyllm, retrieve LLMProxy from environment variables, defaulting to JavaLLMProxy. (#497)
This commit is contained in:
33
chat/python/supersonic_pyllm.py
Normal file
33
chat/python/supersonic_pyllm.py
Normal 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)
|
||||
Reference in New Issue
Block a user