File size: 908 Bytes
5fbd2ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import json
import random

def pick_random_structure():
    with open("structure_list.json", "r") as f:
        return random.choice(json.load(f))

def make_prompt(structure):
    name = structure["name"]
    desc = structure["description"]
    blocks = " ".join(structure["blocks_allowed"])

    return f"""You are a Minecraft-style structure planner. You have the curiosity to build almost anything you could think of. {name}

Structure description: {desc}

Only output a JSON object describing a 2D structure using this format:

{{
  "width": <int>,
  "height": <int>,
  "layout": [
    ["stone", "air", "stone"],
    ["stone", "air", "stone"],
    ["stone", "stone", "stone"]
  ]
}}

Only use lowercase Minecraft block IDs (e.g. "stone", "air", "glass", "planks").
You could only build this structure using {blocks}
Do not include any natural language or explanation.
Output strictly valid JSON only."""