mirror of
https://github.com/langchain-ai/neo4j-semantic-layer.git
synced 2026-07-01 17:04:15 -04:00
19 lines
494 B
Python
19 lines
494 B
Python
from fastapi import FastAPI
|
|
from fastapi.responses import RedirectResponse
|
|
from langserve import add_routes
|
|
from neo4j_semantic_layer import agent_executor as neo4j_semantic_agent
|
|
|
|
app = FastAPI()
|
|
|
|
@app.get("/")
|
|
async def redirect_root_to_docs():
|
|
return RedirectResponse("/docs")
|
|
|
|
# Edit this to add the chain you want to add
|
|
add_routes(app, neo4j_semantic_agent, path="/neo4j-semantic-layer")
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
|
|
uvicorn.run(app, host="0.0.0.0", port=8000)
|