feat(initial commit): first commit, testing out deployment
This commit is contained in:
parent
9b83b69068
commit
1736e9eb09
27 changed files with 7097 additions and 1 deletions
4
api/requirements.txt
Normal file
4
api/requirements.txt
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
fastapi[standard]
|
||||
google-genai
|
||||
python-dotenv
|
||||
pydantic
|
||||
19
api/run.bash
Executable file
19
api/run.bash
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
#if [ ! -f .env ]; then
|
||||
# env | grep DESEC_TOKEN >>.env
|
||||
# env | grep CURRENT_DOMAIN >>.env
|
||||
#fi
|
||||
|
||||
# If virtual environment does exist..
|
||||
if [ ! -d venv ]; then
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -U -r requirements.txt
|
||||
pip install -U pip
|
||||
fi
|
||||
|
||||
# Assuming that your environemnt is already setup
|
||||
if [ -d venv ]; then
|
||||
pip install -U -r requirements.txt
|
||||
fi
|
||||
28
api/src/main.py
Normal file
28
api/src/main.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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
|
||||
6
api/src/models.py
Normal file
6
api/src/models.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class UserLogin(BaseModel):
|
||||
username: str
|
||||
password:
|
||||
Loading…
Add table
Add a link
Reference in a new issue