forked from markets-agent/agentic-search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
42 lines (39 loc) · 946 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python
from dotenv import load_dotenv
load_dotenv()
from fastapi import FastAPI
from langserve import add_routes
import uvicorn
from chains import (
generate_arxiv_search_report,
generate_sql_nlp_response,
generate_pdf_report,
generate_web_search_report
)
app = FastAPI(
title="research assistant api",
version="1.0",
description="a web API that serves an AI research assistant that can generate reports by crawling various sources for relevant information and summarizing it",
)
add_routes(
app,
generate_web_search_report,
path="/generate-web-search-report",
)
add_routes(
app,
generate_arxiv_search_report,
path="/generate-arxiv-search-report",
)
add_routes(
app,
generate_pdf_report,
path="/generate-pdf-report",
)
add_routes(
app,
generate_sql_nlp_response,
path="/sql-qa",
)
if __name__ == "__main__":
uvicorn.run(app, host="localhost", port=8000)