Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,45 +1,18 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
from fastapi import FastAPI
|
| 4 |
-
from
|
| 5 |
-
from economic_service import harmonize
|
| 6 |
-
from proof_engine import generate_proof
|
| 7 |
-
from federation import package_for_federation
|
| 8 |
|
| 9 |
app = FastAPI(
|
| 10 |
-
title="
|
| 11 |
-
description="
|
| 12 |
-
version="1.0
|
| 13 |
)
|
| 14 |
|
| 15 |
-
class HarmonizationRequest(BaseModel):
|
| 16 |
-
commodity: str
|
| 17 |
-
physical_anchor: float
|
| 18 |
-
reporting_lag: int
|
| 19 |
-
|
| 20 |
@app.get("/")
|
| 21 |
-
def
|
| 22 |
-
return {
|
| 23 |
-
"service": "CodexFlow ΩΞ",
|
| 24 |
-
"status": "online",
|
| 25 |
-
"mode": "simulation",
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
@app.post("/harmonize")
|
| 29 |
-
def harmonize_endpoint(req: HarmonizationRequest):
|
| 30 |
-
input_data = req.dict()
|
| 31 |
-
|
| 32 |
-
result = harmonize(
|
| 33 |
-
commodity=req.commodity,
|
| 34 |
-
physical_anchor=req.physical_anchor,
|
| 35 |
-
reporting_lag=req.reporting_lag,
|
| 36 |
-
)
|
| 37 |
-
|
| 38 |
-
proof = generate_proof(input_data, result)
|
| 39 |
-
|
| 40 |
-
response = {
|
| 41 |
-
"result": result,
|
| 42 |
-
"proof": proof,
|
| 43 |
-
}
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
|
| 3 |
from fastapi import FastAPI
|
| 4 |
+
from world_step import world_update
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
app = FastAPI(
|
| 7 |
+
title="Codex Realistic World Engine",
|
| 8 |
+
description="Real-world digital bit analytics + economic simulation",
|
| 9 |
+
version="ΩΞ-World-1.0"
|
| 10 |
)
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
@app.get("/")
|
| 13 |
+
def status():
|
| 14 |
+
return {"status": "world engine online"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
@app.get("/world/snapshot")
|
| 17 |
+
def snapshot():
|
| 18 |
+
return world_update()
|