test / app.py
faizanmumtaz's picture
first commit
f2d0c11
raw
history blame
447 Bytes
from langchain_google_genai import ChatGoogleGenerativeAI
from fastapi import FastAPI
from typing import Union
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
llm = ChatGoogleGenerativeAI(model="gemini-pro",google_api_key="AIzaSyAur2W5VT7Q612b_umm26BwQprv8Rky090")
@app.get("/objects")
def read_item():
return llm
@app.get("/test/{text}")
def read_item(text):
res = llm.invoke(text).content
return res