lucianotonet commited on
Commit
17427d1
·
1 Parent(s): 3650674
Files changed (2) hide show
  1. .env-example +6 -0
  2. app/server.py +4 -3
.env-example ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ PROXY_URL=https://app.agenciamav.local/api/ai
2
+
3
+ OPENAI_API_KEY=
4
+ OPENAI_ORGANIZATION=
5
+
6
+ GOOGLE_API_KEY=
app/server.py CHANGED
@@ -8,11 +8,15 @@ from dotenv import load_dotenv
8
  from langchain_google_genai import ChatGoogleGenerativeAI
9
 
10
  load_dotenv()
 
 
11
 
12
  app = FastAPI(
13
  title="Mav AI API",
14
  version="1.0",
15
  description="A simple api server using Langchain's Runnable interfaces",
 
 
16
  )
17
 
18
  @app.get("/")
@@ -34,7 +38,4 @@ add_routes(
34
 
35
  if __name__ == "__main__":
36
  import uvicorn
37
-
38
- import os
39
- app_url = os.getenv('PROXY_URL')
40
  uvicorn.run(app, host="localhost", port=7860, root_path=app_url)
 
8
  from langchain_google_genai import ChatGoogleGenerativeAI
9
 
10
  load_dotenv()
11
+ import os
12
+ app_url = os.getenv('PROXY_URL')
13
 
14
  app = FastAPI(
15
  title="Mav AI API",
16
  version="1.0",
17
  description="A simple api server using Langchain's Runnable interfaces",
18
+ # openapi_prefix=app_url,
19
+ openapi_url="/api/ai"
20
  )
21
 
22
  @app.get("/")
 
38
 
39
  if __name__ == "__main__":
40
  import uvicorn
 
 
 
41
  uvicorn.run(app, host="localhost", port=7860, root_path=app_url)