Commit
·
072df7d
1
Parent(s):
f62ac91
sad
Browse files- .gitignore +1 -0
- app.py +2 -2
- tester.py +23 -0
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
app.py
|
app.py
CHANGED
|
@@ -19,7 +19,7 @@ class Structure(BaseModel):
|
|
| 19 |
required_blocks: List[str]
|
| 20 |
tags: List[str]
|
| 21 |
|
| 22 |
-
@app.post("/
|
| 23 |
-
def
|
| 24 |
result = generate_structure(prompt.text)
|
| 25 |
return {"response": result}
|
|
|
|
| 19 |
required_blocks: List[str]
|
| 20 |
tags: List[str]
|
| 21 |
|
| 22 |
+
@app.post("/prompt")
|
| 23 |
+
async def prompt(prompt: Prompt):
|
| 24 |
result = generate_structure(prompt.text)
|
| 25 |
return {"response": result}
|
tester.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
|
| 3 |
+
prompt = """
|
| 4 |
+
You are an AI builder assistant. Your task is to generate a 3D Minecraft structure layout for a "wizard tower" using only the blocks listed below. The layout must be provided in strict JSON format as:
|
| 5 |
+
layout[y][z][x] = block_name (3D array of strings)
|
| 6 |
+
|
| 7 |
+
The JSON must be minimal, symmetrical if needed, and represent a small but visually meaningful structure. Avoid empty arrays, and make sure block names match exactly.
|
| 8 |
+
|
| 9 |
+
You could only use these blocks for building wizard tower, including:
|
| 10 |
+
Animated blocks: lava, fire, end_portal, magma_block, soul_fire, bubble_column
|
| 11 |
+
Non-animated blocks: cobblestone, mossy_cobblestone, stone_bricks, cracked_stone_bricks, deepslate, bookshelves, oak_planks, oak_log, torch, stone_slab, obsidian, glass_pane, ladder
|
| 12 |
+
|
| 13 |
+
Only return a valid JSON structure named `layout`. No explanation or extra text.
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
response = requests.post(
|
| 18 |
+
"http://thongcoder-minecraft-ai-builder-backend.hf.space/generate",
|
| 19 |
+
json={"prompt": prompt}
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
print(response.status_code)
|
| 23 |
+
print(response.json())
|