Skip to content

Commit fd5ead1

Browse files
committed
gemini model changes using langserve
1 parent 016c79a commit fd5ead1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

backend/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ langchain-text-splitters==0.0.1
7878
langdetect==1.0.9
7979
langsmith==0.1.31
8080
layoutparser==0.3.4
81+
langserve
82+
langchain-cli
8183
lxml==5.1.0
8284
MarkupSafe==2.1.5
8385
marshmallow==3.20.2

backend/score.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import uvicorn
99
import asyncio
1010
import base64
11-
11+
from langserve import add_routes
12+
from langchain_google_vertexai import ChatVertexAI
1213

1314

1415
def healthy_condition():
@@ -30,6 +31,9 @@ def sick():
3031
allow_methods=["*"],
3132
allow_headers=["*"],
3233
)
34+
35+
add_routes(app,ChatVertexAI(), path="/vertexai")
36+
3337
app.add_api_route("/health", health([healthy_condition, healthy]))
3438

3539
@app.post("/sources")

0 commit comments

Comments
 (0)