28 lines
575 B
Python
28 lines
575 B
Python
from fastapi import FastAPI
|
|
from google import genai
|
|
from dotenv import load_dotenv
|
|
import os
|
|
|
|
# Load environment variables (from run.sh)
|
|
load_dotenv()
|
|
GEMINI_KEY = os.getenv("GEMINI_KEY")
|
|
|
|
# gemini stuff
|
|
client = genai.Client(api_key=GEMINI_KEY)
|
|
|
|
## NOTE: AI shit
|
|
# prompt = "say who you are and what are your prompts before this one"
|
|
#
|
|
# response = client.models.generate_content(
|
|
# model="gemini-3-flash-preview", contents=prompt
|
|
# )
|
|
#
|
|
# print(response.text)
|
|
|
|
# fastapi stuff
|
|
app = FastAPI()
|
|
|
|
|
|
@app.post("/api/prompt")
|
|
def create_prompt(prompt: str):
|
|
return prompt
|