fixed combined.py disc
This commit is contained in:
@@ -1,30 +0,0 @@
|
|||||||
from fastapi import FastAPI
|
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
|
||||||
|
|
||||||
from lang_agent.fastapi_server.front_apis import app as front_app
|
|
||||||
from lang_agent.fastapi_server.server_dashscope import create_dashscope_router
|
|
||||||
|
|
||||||
|
|
||||||
app = FastAPI(
|
|
||||||
title="Combined Front + DashScope APIs",
|
|
||||||
description=(
|
|
||||||
"Single-process app exposing front_apis control endpoints and "
|
|
||||||
"DashScope-compatible chat endpoints."
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
app.add_middleware(
|
|
||||||
CORSMiddleware,
|
|
||||||
allow_origins=["*"],
|
|
||||||
allow_credentials=True,
|
|
||||||
allow_methods=["*"],
|
|
||||||
allow_headers=["*"],
|
|
||||||
)
|
|
||||||
|
|
||||||
# Keep existing /v1/... admin APIs unchanged.
|
|
||||||
app.include_router(front_app.router)
|
|
||||||
|
|
||||||
# Add DashScope endpoints at their existing URLs. We intentionally skip
|
|
||||||
# DashScope's root/health routes to avoid clashing with front_apis.
|
|
||||||
app.include_router(create_dashscope_router(include_meta_routes=False))
|
|
||||||
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
|
import uvicorn
|
||||||
|
|
||||||
from fastapi_server.front_apis import app as front_app
|
from lang_agent.fastapi_server.front_apis import app as front_app
|
||||||
from fastapi_server.server_dashscope import create_dashscope_router
|
from lang_agent.fastapi_server.server_dashscope import create_dashscope_router
|
||||||
|
|
||||||
|
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
@@ -28,3 +29,5 @@ app.include_router(front_app.router)
|
|||||||
# DashScope's root/health routes to avoid clashing with front_apis.
|
# DashScope's root/health routes to avoid clashing with front_apis.
|
||||||
app.include_router(create_dashscope_router(include_meta_routes=False))
|
app.include_router(create_dashscope_router(include_meta_routes=False))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
uvicorn.run(app, host="0.0.0.0", port=8500)
|
||||||
Reference in New Issue
Block a user