Spaces:
Sleeping
Sleeping
File size: 447 Bytes
f2d0c11 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
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 |