-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (29 loc) · 957 Bytes
/
main.py
File metadata and controls
33 lines (29 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from fastapi import FastAPI
from pydantic import BaseModel
from datetime import datetime
app = FastAPI(title="Slime Mold Oracle API")
# Request schema
class QueryRequest(BaseModel):
query: str
# Response schema
class OracleResponse(BaseModel):
symbols: list[str]
interpretation: str
mood: dict
path: list[str]
@app.post("/oracle/query", response_model=OracleResponse)
def ask_oracle(request: QueryRequest):
# Placeholder logic (you’ll plug in your Oracle here later)
now = datetime.now()
mood = {
"time_of_day": now.strftime("%H:%M"),
"lunar_phase": "waxing gibbous", # just hardcoded for now
"tone": "cryptic"
}
response = {
"symbols": ["The Serpent", "The Mirror", "The Final Quiet"],
"interpretation": "Subversion, reflection, and endings shaping beginnings.",
"mood": mood,
"path": ["Knowledge", "Cycles", "Transformation"]
}
return response