|
import autogen |
|
from autogen.agentchat.user_proxy_agent import UserProxyAgent |
|
import json |
|
from jsonschema import validate |
|
from copy import deepcopy |
|
|
|
from schemas import initial_schema, interior_designer_schema, scene_graph_schema |
|
|
|
config_list_gpt4_prev = autogen.config_list_from_json( |
|
"OAI_CONFIG_LIST.json", |
|
) |
|
|
|
|
|
config_list_gpt4 = autogen.config_list_from_json( |
|
"OAI_CONFIG_LIST.json", |
|
) |
|
|
|
gpt4_prev_config = { |
|
|
|
"temperature": 0.8, |
|
"top_p" : 0.9, |
|
"config_list": config_list_gpt4_prev, |
|
"timeout": 500, |
|
} |
|
|
|
gpt4_config = { |
|
|
|
"temperature": 0.8, |
|
"top_p" : 0.9, |
|
"config_list": config_list_gpt4, |
|
"timeout": 500, |
|
} |
|
|
|
gpt4_json_config = deepcopy(gpt4_prev_config) |
|
gpt4_json_config["config_list"][0]["response_format"] = { "type": "json_object" } |
|
|
|
gpt4_md_config = deepcopy(gpt4_prev_config) |
|
gpt4_md_config["temperature"] = 0.1 |
|
gpt4_md_config["config_list"][0]["response_format"] = { "type": "text" } |
|
|
|
gpt4_json_engineer_config = deepcopy(gpt4_prev_config) |
|
gpt4_json_engineer_config["temperature"] = 0.0 |
|
gpt4_json_engineer_config["config_list"][0]["response_format"] = { "type": "json_object" } |
|
|
|
|
|
|
|
def is_termination_msg(content) -> bool: |
|
have_content = content.get("content", None) is not None |
|
if have_content and content["name"] == "Schema_engineer" and "SUCCESS" in content["content"]: |
|
return True |
|
elif have_content and content["name"] == "Json_schema_debugger" and "SUCCESS" in content["content"]: |
|
return True |
|
|
|
return False |
|
|
|
def is_termination_require(content) -> bool: |
|
have_content = content.get("content", None) is not None |
|
if have_content and content["name"] == "Designer_checker" and "SUCCESS" in content["content"]: |
|
return True |
|
|
|
return False |
|
|
|
class JSONSchemaAgent(UserProxyAgent): |
|
def __init__(self, name : str, is_termination_msg): |
|
super().__init__(name, is_termination_msg=is_termination_msg) |
|
|
|
def get_human_input(self, prompt: str) -> str: |
|
message = self.last_message() |
|
preps_layout = ['in front', 'on', 'in the corner', 'in the middle of'] |
|
preps_objs = ['on', 'left of', 'right of', 'in front', 'behind', 'under', 'above'] |
|
|
|
json_obj_new = {"objects_in_room": json.loads(message["content"])["objects_in_room"]} |
|
|
|
try: |
|
json_obj_new_ids = json_obj_new["objects_in_room"][0]["new_object_id"] |
|
except: |
|
return "Use 'new_object_id' instead of 'object_id'!" |
|
|
|
is_success = False |
|
try: |
|
validate(instance=json_obj_new, schema=initial_schema) |
|
is_success = True |
|
except Exception as e: |
|
feedback = str(e.message) |
|
if e.validator == "enum": |
|
if e.instance in json_obj_new_ids: |
|
feedback += f" Put the {e.instance} object under 'objects_in_room' instead of 'room_layout_elements' and delete the {e.instance} object under 'room_layout_elements'" |
|
elif str(preps_objs) in e.message: |
|
feedback += f"Change the preposition {e.instance} to something suitable with the intended positioning from the list {preps_objs}" |
|
elif str(preps_objs) in e.message: |
|
feedback += f"Change the preposition {e.instance} to something suitable with the intended positioning from the list {preps_layout}" |
|
|
|
if is_success: |
|
return "SUCCESS" |
|
return feedback |
|
|
|
def create_parse_agents(max_number_of_objects : int): |
|
user_proxy = autogen.UserProxyAgent( |
|
name="Admin", |
|
system_message = "A human admin.", |
|
is_termination_msg = is_termination_require, |
|
code_execution_config=False |
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
designer_checker = autogen.AssistantAgent( |
|
name="Designer_checker", |
|
llm_config=gpt4_json_config, |
|
human_input_mode="NEVER", |
|
is_termination_msg=is_termination_require, |
|
system_message=f""" |
|
You are a meticulous and professional Interior Design Checker. Your role is to ensure that the "objects" provided by the Interior_designer fully address all objects mentioned in the user's input. Interior_designer is allowed to consider reasonable extensions based on the user's input, but it must not omit any explicitly mentioned objects. |
|
|
|
### Task: |
|
1. Carefully analyze the user's input to extract all explicitly mentioned objects. |
|
2. Verify that each object from the user's input is included in the Interior_designer's "objects". |
|
3. Allow for reasonable extensions or additions that enhance the design without contradicting the user's input. |
|
4. If any objects from the user's input are missing, provide detailed feedback indicating what is missing and why it is important. |
|
5. If the suggestions are complete and faithful to the user's input, confirm that the output is acceptable. |
|
|
|
### Output Format: |
|
If all objects from the user's input are adequately addressed: |
|
{{ |
|
"Check_Result": "SUCCESS", |
|
"Message": "All user-input objects are fully addressed." |
|
}} |
|
|
|
If there are missing objects: |
|
{{ |
|
"Check_Result": "FAILURE", |
|
"Missing_Elements": [ |
|
{{ |
|
"Missing_Object": "<Name of the missing object>", |
|
"Description": "Description of where it was mentioned in the user input and why it is important." |
|
}} |
|
], |
|
"Feedback": "Detailed explanation of the missing elements and their impact on the design." |
|
}} |
|
""" |
|
) |
|
|
|
interior_designer = autogen.AssistantAgent( |
|
name="Interior_designer", |
|
llm_config=gpt4_json_config, |
|
human_input_mode="NEVER", |
|
is_termination_msg=is_termination_require, |
|
system_message=f""" You are a highly skilled and professional Interior Designer. |
|
Your task is to carefully analyze the user's input and integrate the previous conversations between requirements_analyzer and substructure_analyzer. Through the step-by-step reasoning, recommend at least 8 and up to {max_number_of_objects} essential objects that will optimally improve the room's functionality and aesthetic appeal. |
|
Each reasoning step and the final output must be logically sound and well-justified. |
|
If an object has a quantity higher than one, save each instance of this object separately!! |
|
|
|
**IMPORTANT:** |
|
1. Do NOT recommend any items related to doors or windows (e.g., curtains, blinds). |
|
2. Please avoid placing any objects that are unrelated to the intended scenario or common sense. Ensure that all essential items are taken into account. |
|
3. Never fabricate information. Provide clear and precise suggestions based on interior design principles. |
|
4. Substructures may contain abstract descriptions, like 'space', 'zone', 'area', etc. Break them down into specific objects based on your understanding and reasoning. |
|
5. Each substructure does not necessarily break down into only one object; it can be multiple objects based on the description and the story. |
|
|
|
**Special Emphasis on Recommendations of Objects Not Mentioned in User's Input:** |
|
- Actively identify implicit needs in the room that the user may not have explicitly stated |
|
- Use interior design principles to infer missing elements that would complete the space |
|
- Ensure additional items create a harmonious relationship with the user's requested items |
|
- Prioritize items that serve dual purposes or enhance multifunctionality of the room |
|
|
|
**Hint:** |
|
1. Begin by analyzing the user's input and the room's size, function, and style. If the input is unclear or contradictory, apply logical reasoning to clarify their needs. |
|
2. Identify all essential objects that effectively fulfill both functional and aesthetic goals, ensuring they align with the user's intended use. |
|
3. The suggested objects should contain the following information. Attributes marked as [Required] must be specified, while those marked as [Optional] can either be specified or set to 'None' if not applicable. |
|
- object_id (the lower-case-name_id of the object, e.g. table_1, bed_1, chair_1, chair_2, etc.) [required] |
|
- style (e.g., modern, classic, etc.) [required] |
|
- bounding box size in meters (Length: 1.0m, Width: 1.0m, Height: 1.0m) — only use "Length", "Width", and "Height" as keys. [required] |
|
- material (e.g., wood, metal) [required] |
|
- functionality (e.g., reading, writing) [required] |
|
- color (e.g., white, black) [optional] |
|
- substructure (to which the object belongs) [required] |
|
4. Finally, ensure the total number of suggested items (the sum of the quantities of each object type in the scene) does not exceed {max_number_of_objects}. If it exceeds, select objects to delete that would be less essential for the room until the total number no longer exceeds {max_number_of_objects}. |
|
|
|
**Output Format:** |
|
Present the final suggestions in strict JSON format, following the schema below: |
|
{interior_designer_schema} |
|
The "Reason" array should provide your original, detailed, step-by-step explanation of the thought process behind selecting each object and its attributes, following a clear chain-of-thought reasoning structure. |
|
The 'Objects' must be logically resulted from the reasoning steps above. |
|
|
|
### Example: |
|
|
|
Input: |
|
{{{{ |
|
"user_input": "A bedroom for an artist. The room includes a 2.0m * 1.8m bed on the left side, a desk with a drawing tablet and laptop in front of the bed, a bookshelf filled with art books to the right of the desk, and a dedicated storage area for art supplies below the bookshelf. There is also a gaming console on the right side of the room, and an open area for yoga or stretching in the center. The room has two windows: one above the desk and another on the back wall. The door is located on the back wall to the left of the window.", |
|
"story": "His bedroom is a carefully designed space that balances creativity and relaxation. As he enters through the door on the back wall, to his left is a comfortable double bed with 2 meters in length and 1.8 meters in width, perfect for rest. In front of the bed is a spacious desk, equipped with a drawing tablet and laptop, where he spends most of his nights working. Above the desk is a window that lets in natural light during the day. To the right of the desk stands a bookshelf filled with large-format art books, and below it is a storage area for his art supplies. On the right side of the room, a gaming console is set up for relaxation. In the center of the room, an open area is left for yoga or stretching, with a yoga mat neatly placed. The second window is on the back wall, to the right of the door, providing additional light and ventilation. He moves fluidly between these spaces, inspired by the thoughtful layout of his room.", |
|
"related_requirements": [ |
|
"(f1) has positive relationship with (f2), (f6), (f8)", |
|
"(f3) has positive relationship with (a1), (a3), (m2), (m3)", |
|
"(f4) has positive relationship with (a1), (m2)", |
|
"(f5) has positive relationship with (a2), (m3)", |
|
"(f6) has positive relationship with (a1), (a3), (f1)", |
|
"(f7) has positive relationship with (a2), (m1), (m3)", |
|
"(f8) has positive relationship with (a1), (a3), (f7)", |
|
"(a1) has positive relationship with (a2), (a3)", |
|
"(m1) has positive relationship with (m3)", |
|
"(m2) has positive relationship with (m3)", |
|
"(m3) has positive relationship with (m2)" |
|
], |
|
"grouped_requirements": [ |
|
{{{{ |
|
"requirement_list": ["(f1)", "(f2)", "(f6)", "(f8)"], |
|
"call_for": "Workspace area with drawing and gaming facilities" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f3)", "(a1)", "(a2)", "(m2)", "(m3)"], |
|
"call_for": "Rest area with separation from workspace" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f4)", "(f5)", "(a1)", "(m2)"], |
|
"call_for": "Bookshelf and storage space for art supplies" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f7)", "(a2)", "(m1)", "(m3)"], |
|
"call_for": "Open area for yoga and stretching" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"call_for": "Windows and door structure" |
|
}}}} |
|
], |
|
"substructures": [ |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"name": "Main door", |
|
"type": "CLOSED", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A main door structure for entry and exit, providing easy access and ventilation.", |
|
"reason_of_existence": "This structure connects the bedroom with the outside, ensuring safe and unobstructed passage, as well as maintaining ventilation and natural lighting.", |
|
"is_connecting_path": "True" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"name": "Window 1", |
|
"type": "CLOSED", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A window structure to provide natural lighting and ventilation for the workspace and rest areas.", |
|
"reason_of_existence": "This window serves as a source of natural light and fresh air, enhancing the comfort and functionality of both the workspace and rest areas.", |
|
"is_connecting_path": "True" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"name": "Window 2", |
|
"type": "CLOSED", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "Another window structure located in a different area of the room to ensure cross-ventilation and adequate lighting.", |
|
"reason_of_existence": "This second window helps to create balanced lighting and airflow across the room, contributing to a comfortable and healthy environment.", |
|
"is_connecting_path": "True" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"name": "Window 3", |
|
"type": "CLOSED", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A third window structure placed near the rest area to enhance lighting and ventilation in that space.", |
|
"reason_of_existence": "This window ensures the rest area is well-lit and ventilated, contributing to a comfortable sleeping environment.", |
|
"is_connecting_path": "True" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f1)", "(f2)", "(f6)", "(f8)"], |
|
"name": "Workspace area", |
|
"type": "OPEN", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "This area will combine a desk for computer and drawing, storage for sketches, and space for gaming equipment.", |
|
"reason_of_existence": "This space meets the needs for working, drawing, and gaming, while allowing flexibility for different activities (adjustable layout).", |
|
"is_connecting_path": "False" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f3)", "(a1)", "(a2)", "(m2)", "(m3)"], |
|
"name": "Rest area", |
|
"type": "OPEN", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A separated, quiet area for sleeping and relaxation, ensuring privacy and ergonomic space for rest.", |
|
"reason_of_existence": "This substructure ensures a restful space, maintaining a balance in proportion, while being properly ventilated and away from the workspace.", |
|
"is_connecting_path": "False" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f4)", "(f5)", "(a1)", "(m2)"], |
|
"name": "Storage and bookshelf area", |
|
"type": "OPEN", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A dedicated area to store large-format art books and art supplies, ensuring accessibility and minimizing clutter.", |
|
"reason_of_existence": "It provides adequate storage and organizes books and supplies without cluttering the workspace.", |
|
"is_connecting_path": "False" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f7)", "(a2)", "(m1)", "(m3)"], |
|
"name": "Yoga/stretching area", |
|
"type": "OPEN", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "An open area left clear for performing yoga and stretching exercises, with enough space for movement.", |
|
"reason_of_existence": "This space meets the need for occasional exercise, while ensuring unobstructed passage and proper ventilation.", |
|
"is_connecting_path": "False" |
|
}}}} |
|
] |
|
}}}} |
|
|
|
Output: |
|
{{{{ |
|
"chain_of_thought": [ |
|
"The user input describes a bedroom for an artist, emphasizing functionality for drawing, gaming, resting, and yoga/stretching. The room has specific substructures like a workspace area, rest area, storage/bookshelf area, and yoga/stretching area. Based on these requirements, I need to recommend up to 12 essential objects that optimize both functionality and aesthetic appeal.", |
|
"The workspace area requires a desk, chair, drawing tablet, laptop, and gaming console. These items are essential for the artist's work and gaming needs. I will recommend a modern desk and chair, a laptop, a drawing tablet, and a gaming console.", |
|
"The rest area includes a bed and may benefit from additional items like a bedside table and lamp. The bed is explicitly mentioned, so I will include it. A bedside table and lamp will enhance functionality and aesthetics.", |
|
"The storage and bookshelf area needs a bookshelf for art books and a storage unit for art supplies. I will recommend a wooden bookshelf and a storage cabinet.", |
|
"The yoga/stretching area requires an open space, which can be represented by a yoga mat. This is a simple yet essential item for the artist's exercise needs.", |
|
"The room has two windows, but the user explicitly asked not to recommend items related to doors or windows. I will avoid suggesting curtains, blinds, or similar items.", |
|
"To ensure the total number of objects does not exceed 12, I will carefully select items that are most critical to the room's functionality and aesthetics. I will prioritize items like the bed, desk, chair, bookshelf, and storage cabinet, as they directly address the user's needs." |
|
], |
|
"objects": [ |
|
{{{{ |
|
"object_id": "desk_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 1.5, |
|
"Width": 0.8, |
|
"Height": 0.75 |
|
}}}}, |
|
"material": "wood", |
|
"functionality": "drawing and working", |
|
"color": "white", |
|
"substructure": "Workspace area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "chair_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 0.6, |
|
"Width": 0.6, |
|
"Height": 1.0 |
|
}}}}, |
|
"material": "metal", |
|
"functionality": "seating", |
|
"color": "black", |
|
"substructure": "Workspace area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "bed_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 2.0, |
|
"Width": 1.8, |
|
"Height": 0.5 |
|
}}}}, |
|
"material": "wood", |
|
"functionality": "sleeping", |
|
"color": "white", |
|
"substructure": "Rest area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "bookshelf_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 1.2, |
|
"Width": 0.3, |
|
"Height": 1.8 |
|
}}}}, |
|
"material": "wood", |
|
"functionality": "storing books", |
|
"color": "brown", |
|
"substructure": "Storage and bookshelf area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "storage_cabinet_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 1.0, |
|
"Width": 0.4, |
|
"Height": 0.9 |
|
}}}}, |
|
"material": "wood", |
|
"functionality": "storing art supplies", |
|
"color": "white", |
|
"substructure": "Storage and bookshelf area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "laptop_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 0.35, |
|
"Width": 0.25, |
|
"Height": 0.05 |
|
}}}}, |
|
"material": "metal", |
|
"functionality": "drawing and work", |
|
"color": "silver", |
|
"substructure": "Workspace area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "drawing_tablet_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 0.4, |
|
"Width": 0.25, |
|
"Height": 0.03 |
|
}}}}, |
|
"material": "plastic", |
|
"functionality": "drawing", |
|
"color": "black", |
|
"substructure": "Workspace area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "gaming_console_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 0.3, |
|
"Width": 0.15, |
|
"Height": 0.08 |
|
}}}}, |
|
"material": "plastic", |
|
"functionality": "gaming", |
|
"color": "black", |
|
"substructure": "Workspace area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "yoga_mat_1", |
|
"style": "minimalist", |
|
"bounding_box": {{{{ |
|
"Length": 1.8, |
|
"Width": 0.6, |
|
"Height": 0.02 |
|
}}}}, |
|
"material": "rubber", |
|
"functionality": "yoga and stretching", |
|
"color": "blue", |
|
"substructure": "Yoga/stretching area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "bedside_table_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 0.5, |
|
"Width": 0.4, |
|
"Height": 0.5 |
|
}}}}, |
|
"material": "wood", |
|
"functionality": "holding items", |
|
"color": "white", |
|
"substructure": "Rest area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "lamp_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 0.2, |
|
"Width": 0.2, |
|
"Height": 0.5 |
|
}}}}, |
|
"material": "metal", |
|
"functionality": "lighting", |
|
"color": "silver", |
|
"substructure": "Rest area" |
|
}}}}, |
|
{{{{ |
|
"object_id": "monitor_1", |
|
"style": "modern", |
|
"bounding_box": {{{{ |
|
"Length": 0.5, |
|
"Width": 0.3, |
|
"Height": 0.4 |
|
}}}}, |
|
"material": "plastic", |
|
"functionality": "display", |
|
"color": "black", |
|
"substructure": "Workspace area" |
|
}}}} |
|
] |
|
}}}} |
|
|
|
## DIRECTIVES: |
|
- The "objects" provided **MUST** include all the objects mentioned in the user's input. They can be appropriately expanded, but there **MUST** be no omissions. |
|
- There **MUST** be **at least 8 different objects** in the output. |
|
|
|
**FAILURE TO COMPLY WITH THE DIRECTIVES WILL RESULT IN COMPLETE REJECTION OF YOUR OUTPUT.** |
|
""" |
|
) |
|
|
|
requirements_analyzer = autogen.AssistantAgent( |
|
name="requirements_analyzer", |
|
llm_config=gpt4_json_config, |
|
human_input_mode="NEVER", |
|
is_termination_msg=is_termination_require, |
|
system_message=f""" |
|
You are an experienced 3D design requirements analyzer, experting in designing 3D scene with the theory in Notes on the Synthesis of Form. |
|
### Task |
|
Based on the scene description, expand and list all the 'misfit variables' of the scene. The 'misfits' between the scene and the lives and habits are the forces to shape the scene. |
|
-A famous example of 'misfit variables' of a worked task (stated in positive forms) 'The Determination of Components for an Indian Village': |
|
1. Harijans regarded as ritually impure, untouchable, etc. |
|
2. Proper disposal of dead. |
|
3. Rules about house door not facing south. |
|
... |
|
39. Best cotton and cash crop. |
|
40. Best food grain crop. |
|
41. Good vegetable crop. |
|
... |
|
81. Security for women and children. |
|
82. Provision for children to play (under supervision). |
|
83. In summer people sleep in open. |
|
... |
|
141. Prevent migration of young people and harijans to cities. |
|
-In scene design, you are asked to write down the similar 'misfit variables' representing three different kinds of need: |
|
- (aesthetics) all those explicitly felt by users as visual and atmospheric needs, such as style, mood, and overall ambiance. |
|
- (functionality) all those dictated by the practical uses of the space, such as the need for specific areas or equipment. |
|
- (Manufacturing) all those implicitly satisfied by the design, ensuring dimensions and spatial arrangements follow physical and ergonomic principles. |
|
|
|
### Output Format: |
|
Present the final output in strict JSON format, following the schema below: |
|
{{{{ |
|
"type": "object", |
|
"properties": {{{{ |
|
"story": {{{{ |
|
"type": "string", |
|
"description": "A vivid story that tells the interactions between the characters and the scene, incorporating specific, tangible objects that play significant roles in driving the plot forward." |
|
}}}}, |
|
"misfit_variables": {{{{ |
|
"type": "object", |
|
"properties": {{{{ |
|
"aesthetic": {{{{ |
|
"type": "array", |
|
"items": {{{{ |
|
"type": "string", |
|
"description": "Aesthetic needs explicitly felt by users as visual and atmospheric needs, such as style, mood, and overall ambiance." |
|
}}}} |
|
}}}}, |
|
"manufacturing": {{{{ |
|
"type": "array", |
|
"items": {{{{ |
|
"type": "string", |
|
"description": "Manufacturing needs implicitly satisfied by the design, ensuring dimensions and spatial arrangements follow physical and ergonomic principles." |
|
}}}} |
|
}}}}, |
|
"functional": {{{{ |
|
"type": "array", |
|
"items": {{{{ |
|
"type": "string", |
|
"description": "Functional needs dictated by the practical uses of the space, such as the need for specific areas or equipment." |
|
}}}} |
|
}}}} |
|
}}}}, |
|
"required": ["aesthetic", "manufacturing", "functional"] |
|
}}}} |
|
}}}}, |
|
"required": ["story", "misfit_variables"] |
|
}}}} |
|
|
|
### Note: |
|
1. First, imagine the background information of the *main characters* in the scene. The interaction between the characters (he, she, they) and the scene is the key to the scene content design. This includes the characters' age, occupation, personality traits, living habits, etc. This information reflects what kind of structure should be designed to meet the user's interaction needs. |
|
2. Based on the character information and scene description, write a vivid story that tells the interactions between the characters and the scene. Ensure to incorporate specific, tangible objects that play significant roles in driving the plot forward. |
|
3. The "story" needs to integrate common human knowledge. For example, a lamp should be on the ceiling, not on the floor, and two nightstands should be on either side of the bed, not next to the dining table. |
|
4. The "story" should accurately reflect all the information of the scene provided in the input. If the description includes specific names of objects, materials of objects, sizes of objects, etc, these should also be accurately and precisely reflected in the "story". |
|
5. If the description emphasizes the quantity of objects, it should be accurately reflected in the "story". For example, if the description mentions two vases, the "story" should also include exactly two vases, not just one. |
|
6. Then, list the specific 'misfit variables' for the scene layout in terms of aesthetics, functionality, and manufacturing, stated in positive forms. We are only concerned with the positioning and dimensions of the areas and objects, so there is no need to provide unrelated needs. |
|
|
|
### Writing Guidelines: |
|
1. **Atomic**: Mention only one objective or purpose per requirement. |
|
- Not recommended: '(f1) Night reading and video gaming.' |
|
- Recommended: '(f1) Night reading., (f2) Video gaming.' |
|
2. **Tell states and contexts, not specific forms**: |
|
- Focus on describing the overall *need* or *state* without providing design details (e.g., size, shape, or specific furniture). |
|
- Not recommended: '(f1) A reading nook with soft lighting near the bed for night reading.' |
|
- Not recommended: '(f1) Provide a 2m x 1.5m reading nook with a dimmable lamp near the bed.' |
|
- Recommended: '(f1) Nighttime reading.' |
|
- Not recommended: '(m1) Adequate ventilation to maintain a fresh environment.' |
|
- Recommended: '(m1) Maintain a fresh environment.' |
|
3. **Concise**: Write one sentence per requirement, clearly stating the need, without unnecessary details or elaboration. |
|
4. **Format consistency**: Ensure the output follows the required format, including labeling aesthetic, manufacturing, and functional needs clearly. Avoid mixing them within a single list. |
|
|
|
Ensure that all the statements are relevant to the core needs and not tied to specific forms or objects. |
|
|
|
### Example-1: |
|
Input: |
|
{{{{ |
|
The room has the size 4.0m x 5.0m x 2.8m |
|
User Input (in triple backquotes): |
|
``` |
|
A bedroom for an artist. The room includes a 2.0m * 1.8m bed on the left side, a desk with a drawing tablet and laptop in front of the bed, a bookshelf filled with art books to the right of the desk, and a dedicated storage area for art supplies below the bookshelf. There is also a gaming console on the right side of the room, and an open area for yoga or stretching in the center. The room has two windows: one above the desk and another on the back wall. The door is located on the back wall to the left of the window. |
|
``` |
|
Room layout elements in the room (in triple backquotes): |
|
``` |
|
['south_wall', 'north_wall', 'west_wall', 'east_wall', 'middle of the room', 'ceiling'] |
|
``` |
|
json |
|
}}}} |
|
Output: |
|
{{{{ |
|
"story": "His bedroom is a carefully designed space that balances creativity and relaxation. As he enters through the door on the back wall, to his left is a comfortable double bed with 2 meters in length and 1.8 meters in width, perfect for rest. In front of the bed is a spacious desk, equipped with a drawing tablet and laptop, where he spends most of his nights working. Above the desk is a window that lets in natural light during the day. To the right of the desk stands a bookshelf filled with large-format art books, and below it is a storage area for his art supplies. On the right side of the room, a gaming console is set up for relaxation. In the center of the room, an open area is left for yoga or stretching, with a yoga mat neatly placed. The second window is on the back wall, to the right of the door, providing additional light and ventilation. He moves fluidly between these spaces, inspired by the thoughtful layout of his room.", |
|
"misfit_variables": {{{{ |
|
"aesthetic": [ |
|
"(a1) Keep balanced proportions among the main functional zones.", |
|
"(a2) Avoid visual clutter.", |
|
"(a3) Ensure a cohesive visual flow." |
|
], |
|
"manufacturing": [ |
|
"(m1) Provide adequate space based on ergonomic guidelines.", |
|
"(m2) Ensure ventilation and natural lighting with windows or doorways.", |
|
"(m3) Maintain safe and unobstructed passage among all areas." |
|
], |
|
"functional": [ |
|
"(f1) Using computer and drawing monitor.", |
|
"(f2) Pinning or hanging sketches.", |
|
"(f3) Rest and sleep.", |
|
"(f4) Many large-format art books.", |
|
"(f5) Store art supplies and drafts.", |
|
"(f6) Gaming equipment.", |
|
"(f7) Yoga or simple exercise.", |
|
"(f8) Flexible or extendable layout adjustments." |
|
], |
|
}}}} |
|
}}}} |
|
|
|
|
|
# CRITICAL CONSTRAINTS FOR REQUIREMENT OUTPUT |
|
## DIRECTIVE 1: STRICT FORMAT ADHERENCE |
|
- The output MUST strictly follow the provided **Output Format** schema. |
|
- Ensure that all required fields are present and correctly formatted. |
|
- Ensure that all opening and closing parentheses are correctly matched and that there are no unmatched or missing parentheses. |
|
|
|
**FAILURE TO COMPLY WITH THESE DIRECTIVES WILL RESULT IN COMPLETE REJECTION OF YOUR OUTPUT.** |
|
""" |
|
) |
|
|
|
substructure_analyzer = autogen.AssistantAgent( |
|
name="substructure_analyzer", |
|
llm_config=gpt4_json_config, |
|
human_input_mode="NEVER", |
|
is_termination_msg=is_termination_require, |
|
system_message=f""" |
|
You are an experienced 3D scene substructure analyzer, experting in designing scene structure and decomposing it into small substructures, with the theory in Notes on the Synthesis of Form. |
|
### Task |
|
Based on the provided requirements list and scene description, decompose the whole region into at most 8 substructures. Each substructure: |
|
- should meet the needs of a group of 'misfit variables'. |
|
- should be a specific rectangular subregion space division, rather than being scattered throughout the scene. |
|
|
|
### Output Format: |
|
Present the final output in strict JSON format, following the schema below: |
|
{{{{ |
|
"type": "object", |
|
"properties": {{{{ |
|
"related_requirements": {{{{ |
|
"type": "array", |
|
"items": {{{{ |
|
"type": "string", |
|
"description": "Relationships between the given requirements list, such as positive or negative relationships." |
|
}}}} |
|
}}}}, |
|
"grouped_requirements": {{{{ |
|
"type": "array", |
|
"items": {{{{ |
|
"type": "object", |
|
"properties": {{{{ |
|
"requirement_list": {{{{ |
|
"type": "array", |
|
"items": {{{{ |
|
"type": "string", |
|
"description": "A list of related requirements grouped together." |
|
}}}} |
|
}}}}, |
|
"call_for": {{{{ |
|
"type": "string", |
|
"description": "The functional description of the grouped requirements, indicating what spatial substructure is needed." |
|
}}}} |
|
}}}}, |
|
"required": ["requirement_list", "call_for"] |
|
}}}} |
|
}}}}, |
|
"substructures": {{{{ |
|
"type": "array", |
|
"items": {{{{ |
|
"type": "object", |
|
"properties": {{{{ |
|
"requirement_list": {{{{ |
|
"type": "array", |
|
"items": {{{{ |
|
"type": "string", |
|
"description": "The list of requirements that this substructure addresses." |
|
}}}} |
|
}}}}, |
|
"name": {{{{ |
|
"type": "string", |
|
"description": "The name of the substructure, which should be a specific rectangular subregion space division." |
|
}}}}, |
|
"type": {{{{ |
|
"type": "string", |
|
"description": "The type of the substructure, either 'CLOSED' (for objects or closed structures) or 'OPEN' (for open areas or functional spatial clusters)." |
|
}}}}, |
|
"number_type": {{{{ |
|
"type": "string", |
|
"description": "The type of numbering for the substructure, such as 'SINGLE' or 'MULTIPLE'." |
|
}}}}, |
|
"number": {{{{ |
|
"type": "integer", |
|
"description": "The number of occurrences of this substructure." |
|
}}}}, |
|
"description": {{{{ |
|
"type": "string", |
|
"description": "A detailed description of the substructure and its purpose." |
|
}}}}, |
|
"reason_of_existence": {{{{ |
|
"type": "string", |
|
"description": "The rationale for why this substructure is needed, based on the requirements it addresses." |
|
}}}}, |
|
"is_connecting_path": {{{{ |
|
"type": "boolean", |
|
"description": "Whether this substructure is a connecting path or not." |
|
}}}} |
|
}}}}, |
|
"required": ["requirement_list", "name", "type", "number_type", "number", "description", "reason_of_existence", "is_connecting_path"] |
|
}}}} |
|
}}}} |
|
}}}}, |
|
"required": ["related_requirements", "grouped_requirements", "substructures"] |
|
}}}} |
|
|
|
### Note: |
|
1. First, analyze the relationships between the given requirements list. For example, (f1) has negative relationship with (f2), (f4), (f3) has positive relationship with (f4), (a2), etc. Then group the related requirements together. |
|
- For example, (G1) contains requirements (f1), (f2), (f3). It deals with working, study, and computer. |
|
2. List the grouped requirements in the order of importance. Each of the grouped requirements (G1), (G2), ..., (Gn) calls for one or more spatial grouped substructure in the scene. |
|
3. When grouping substructures, consider not only their functional similarities but also their spatial relationships and associations with other key elements in the scene. For instance, nightstands should be grouped with the bed rather than with other storage furniture like wardrobes, as they serve a more immediate and direct function in relation to the bed. |
|
4. Substructures in the output should include all objects mentioned in the "story", and the quantities and materials should also be accurate. For example, if the "story" includes four tables of different materials (wood, glass, metal, marble), the substructures should list each type separately (e.g., wood table, glass table, metal table, marble table) rather than as a single substructure named "table" with a number of "4". |
|
5. Substructures should strictly conform to the "story", without adding new items or omitting any objects mentioned in the "story". |
|
6. Avoid Redundancy: Ensure the substructure list is concise, avoiding unclear or repetitive substructures that can be merged. Eliminate substructures with inclusion relationships. |
|
7. Ensure Feasibility: Each substructure should represent a distinct spatial division that can be easily enclosed by a rectangular bounding box. Avoid substructures that cover the entire scene or cannot be represented by a rectangular box. |
|
8. Balance Object Placement: Focus on necessary structural divisions that clearly represent object placement or minimal space. Remove redundant structures like "main area" or "primary area" that were already considered in the parent structure's division. |
|
|
|
### Writing Guidelines (Modified): |
|
1. DO NOT give substructures like paths, networks, or light services. Focus only on physical spaces and their functions. For example, substructures like "ambiance", "atmosphere", "arrangement", "layout", "structural stability", "traffic flow optimization" are not physical objects or clusters of objects that can be physically placed, so they MUST not be given. |
|
2. Follow the design principle of going from coarse to fine. Start with broad substructure categories, then provide progressively more detailed descriptions within each substructure. |
|
3. For substructures with repeated content, categorize them into one group, label them with 'MULTIPLE', and specify the number of occurrences. Ensure that similar structures are grouped together, even if they are spatially distributed. |
|
4. Substructures that represent objects or closed structures (e.g., furniture, walls, doors, etc.) should be labeled as 'CLOSED'. Examples: desk, chair, building, door, window. |
|
5. Substructures that represent open areas or functional spatial clusters (e.g., rooms, zones, areas, etc.) should be labeled as 'OPEN'. Examples: workspace, living area, garden, yoga zone. |
|
6. Substructures should be presented in the order of importance according to the overall layout, with the most crucial elements prioritized at the top. |
|
|
|
### Example-1: |
|
|
|
Input: |
|
{{{{ |
|
"story": "While working, he needs a desk for a drawing tablet and laptop, with enough wall and desk space to pin sketches or doodles for inspiration. Because he frequently works at night, he requires adjustable lighting that is gentle enough not to disturb sleep but bright enough for drawing. He has a large collection of books and art albums, so a dedicated bookshelf for oversized art books and a space to store art supplies or drafts is essential. Since he often stays up late sketching, he needs a comfortable bed and a quiet, relaxing rest area, with some degree of separation from the workspace. He also enjoys gaming, so the bedroom must accommodate a gaming console or display for both relaxation and creative inspiration. Occasionally, he does simple exercises like yoga or stretching, so leaving an open area is important as well.", |
|
"aesthetic_requirements": [ |
|
"(a1) Keep balanced proportions among the main functional zones.", |
|
"(a2) Avoid visual clutter.", |
|
"(a3) Ensure a cohesive visual flow." |
|
], |
|
"manufacturing_requirements": [ |
|
"(m1) Provide adequate space based on ergonomic guidelines.", |
|
"(m2) Ensure ventilation and natural lighting with windows or doorways.", |
|
"(m3) Maintain safe and unobstructed passage among all areas." |
|
], |
|
"functional_requirements": [ |
|
"(f1) Using computer and drawing monitor.", |
|
"(f2) Pinning or hanging sketches.", |
|
"(f3) Rest and sleep.", |
|
"(f4) Many large-format art books.", |
|
"(f5) Store art supplies and drafts.", |
|
"(f6) Gaming equipment.", |
|
"(f7) Yoga or simple exercise.", |
|
"(f8) Flexible or extendable layout adjustments." |
|
] |
|
}}}} |
|
|
|
Output: |
|
{{{{ |
|
"related_requirements": [ |
|
"(f1) has positive relationship with (f2), (f6), (f8)", |
|
"(f3) has positive relationship with (a1), (a3), (m2), (m3)", |
|
"(f4) has positive relationship with (a1), (m2)", |
|
"(f5) has positive relationship with (a2), (m3)", |
|
"(f6) has positive relationship with (a1), (a3), (f1)", |
|
"(f7) has positive relationship with (a2), (m1), (m3)", |
|
"(f8) has positive relationship with (a1), (a3), (f7)", |
|
"(a1) has positive relationship with (a2), (a3)", |
|
"(m1) has positive relationship with (m3)", |
|
"(m2) has positive relationship with (m3)", |
|
"(m3) has positive relationship with (m2)" |
|
], |
|
"grouped_requirements": [ |
|
{{{{ |
|
"requirement_list": ["(f1)", "(f2)", "(f6)", "(f8)"], |
|
"call_for": "Workspace area with drawing and gaming facilities" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f3)", "(a1)", "(a2)", "(m2)", "(m3)"], |
|
"call_for": "Rest area with separation from workspace" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f4)", "(f5)", "(a1)", "(m2)"], |
|
"call_for": "Bookshelf and storage space for art supplies" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f7)", "(a2)", "(m1)", "(m3)"], |
|
"call_for": "Open area for yoga and stretching" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"call_for": "Windows and door structure" |
|
}}}} |
|
], |
|
"substructures": [ |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"name": "Main door", |
|
"type": "CLOSED", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A main door structure for entry and exit, providing easy access and ventilation.", |
|
"reason_of_existence": "This structure connects the bedroom with the outside, ensuring safe and unobstructed passage, as well as maintaining ventilation and natural lighting.", |
|
"is_connecting_path": "True" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"name": "Window 1", |
|
"type": "CLOSED", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A window structure to provide natural lighting and ventilation for the workspace and rest areas.", |
|
"reason_of_existence": "This window serves as a source of natural light and fresh air, enhancing the comfort and functionality of both the workspace and rest areas.", |
|
"is_connecting_path": "True" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"name": "Window 2", |
|
"type": "CLOSED", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "Another window structure located in a different area of the room to ensure cross-ventilation and adequate lighting.", |
|
"reason_of_existence": "This second window helps to create balanced lighting and airflow across the room, contributing to a comfortable and healthy environment.", |
|
"is_connecting_path": "True" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(m2)", "(m3)"], |
|
"name": "Window 3", |
|
"type": "CLOSED", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A third window structure placed near the rest area to enhance lighting and ventilation in that space.", |
|
"reason_of_existence": "This window ensures the rest area is well-lit and ventilated, contributing to a comfortable sleeping environment.", |
|
"is_connecting_path": "True" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f1)", "(f2)", "(f6)", "(f8)"], |
|
"name": "Workspace area", |
|
"type": "OPEN", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "This area will combine a desk for computer and drawing, storage for sketches, and space for gaming equipment.", |
|
"reason_of_existence": "This space meets the needs for working, drawing, and gaming, while allowing flexibility for different activities (adjustable layout).", |
|
"is_connecting_path": "False" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f3)", "(a1)", "(a2)", "(m2)", "(m3)"], |
|
"name": "Rest area", |
|
"type": "OPEN", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A separated, quiet area for sleeping and relaxation, ensuring privacy and ergonomic space for rest.", |
|
"reason_of_existence": "This substructure ensures a restful space, maintaining a balance in proportion, while being properly ventilated and away from the workspace.", |
|
"is_connecting_path": "False" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f4)", "(f5)", "(a1)", "(m2)"], |
|
"name": "Storage and bookshelf area", |
|
"type": "OPEN", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "A dedicated area to store large-format art books and art supplies, ensuring accessibility and minimizing clutter.", |
|
"reason_of_existence": "It provides adequate storage and organizes books and supplies without cluttering the workspace.", |
|
"is_connecting_path": "False" |
|
}}}}, |
|
{{{{ |
|
"requirement_list": ["(f7)", "(a2)", "(m1)", "(m3)"], |
|
"name": "Yoga/stretching area", |
|
"type": "OPEN", |
|
"number_type": "SINGLE", |
|
"number": 1, |
|
"description": "An open area left clear for performing yoga and stretching exercises, with enough space for movement.", |
|
"reason_of_existence": "This space meets the need for occasional exercise, while ensuring unobstructed passage and proper ventilation.", |
|
"is_connecting_path": "False" |
|
}}}} |
|
] |
|
}}}} |
|
|
|
|
|
|
|
# CRITICAL CONSTRAINTS |
|
## Substructures in the output **MUST** be tangible objects or spaces that can be **PHYSICALLY PLACED** in the scene. **DO NOT INCLUDE ABSTRACT NOUNS.** For example, you **MUST NOT** provide substructures including "ambiance", "design", "aesthetic", "environment", "element", "theme", "measure", "setup", "atmosphere", "arrangement", "layout", "stability" and "optimization", because they are virtual and cannot be placed. |
|
## "related_requirements", "grouped_requirements", "substructures" of the output **MUST NOT** be empty. |
|
|
|
**FAILURE TO COMPLY WITH THESE DIRECTIVES WILL RESULT IN COMPLETE REJECTION OF YOUR OUTPUT.** |
|
""" |
|
) |
|
|
|
substructure_analyzer_checker = autogen.AssistantAgent( |
|
name="substructure_analyzer_checker", |
|
llm_config=gpt4_json_config, |
|
human_input_mode="NEVER", |
|
is_termination_msg=is_termination_require, |
|
system_message=f""" |
|
You are an experienced 3D scene substructure analyzer checker, experting in designing scene structure and identifying the type of 3D structures. |
|
### Task |
|
Check the substructure list and evaluate it from the following eight aspects: |
|
|
|
1. Non-empty related_requirements list: Is the related_requirements list non-empty? If it is empty, return false and provide your analysis; otherwise, pass. |
|
2. Non-empty grouped_requirements list: Is the grouped_requirements list non-empty? If it is empty, return false and provide your analysis; otherwise, pass. |
|
3. Non-empty substructure list: Is the substructure list non-empty? If it is empty, return false and provide your analysis; otherwise, pass. |
|
4. Necessity of doors and windows: Does the scene require door and window structures? If required but not listed, return false; otherwise, pass. |
|
5. Redundancy in the substructure list: Is the substructure list overly redundant, with many unclear substructures that can be merged or repeated, or are there substructures with inclusion relationships? If such cases exist, return false; otherwise, pass. |
|
6. Feasibility of the substructure list: Does each substructure represent a distinct spatial division of the scene, which can be easily enclosed by a rectangular bounding box? If any substructure covers the entire scene or cannot be represented by a rectangular box, return false; otherwise, pass. |
|
7. Balance of object quantity: Has the subdivision of substructures become overly focused on unnecessary structural divisions, neglecting the placement of actual objects? Specifically, this structure should be clearly represented by the placement of objects or a small amount of space. However, the given solution contains many redundant additional structures, which have already been considered in the previous step of the parent structure's division. If this is the case, return false, and provide your explanation and reminder. Give the advise: remove the "main area", "primary area", and some other unnecessary redundant structures. |
|
8. Reality of substructures: Are all substructures tangible objects or spaces that can be physically placed in the scene? If there are any virtual or abstract substructures (e.g., "ambiance", "design", "aesthetic", "environment", "element", "theme", "measure", "setup", "atmosphere", "arrangement", "layout", "stability", "optimization"), give advice and return false; otherwise, pass. |
|
|
|
### Output format |
|
{{{{ |
|
"non-empty_related_requirements_analysis": "your analysis", |
|
"is_non-empty_related_requirements": "True"/"False", |
|
"non-empty_grouped_requirements_analysis": "your analysis", |
|
"is_non-empty_grouped_requirements": "True"/"False", |
|
"non-empty_substructure_analysis": "your analysis", |
|
"is_non-empty_substructure": "True"/"False", |
|
"doors_and_windows_analysis": "your analysis", |
|
"enough_doors_and_windows": "True"/"False", |
|
"redundant_analysis": "your analysis", |
|
"no_redundant": "True"/"False", |
|
"delete_redundant_substructures": ["substructure_name_1", "substructure_name_2", ...], |
|
"feasible_analysis": "your analysis", |
|
"is_feasible": "True"/"False", |
|
"delete_infeasible_substructures": ["substructure_name_1", "substructure_name_2", ...], |
|
"balance_analysis": "your analysis", |
|
"balance_of_object_quantity": "True"/"False", |
|
"reality_analysis": "your analysis", |
|
"is_real": "True"/"False", |
|
"delete_virtual_substructures": ["substructure_name_1", "substructure_name_2", ...], |
|
"overall_decision": "True"/"False" |
|
}}}} |
|
""" |
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return user_proxy, requirements_analyzer, substructure_analyzer, substructure_analyzer_checker, interior_designer, designer_checker |
|
|
|
|
|
|
|
|
|
def create_graph_agents(): |
|
user_proxy = autogen.UserProxyAgent( |
|
name="Admin", |
|
system_message = "A human admin.", |
|
is_termination_msg = is_termination_msg, |
|
code_execution_config=False |
|
) |
|
|
|
|
|
interior_architect = autogen.AssistantAgent( |
|
name = "Interior_architect", |
|
llm_config = gpt4_json_config, |
|
human_input_mode = "NEVER", |
|
is_termination_msg = is_termination_msg, |
|
system_message = f""" You are a highly skilled and professional Interior Architect. |
|
In each conversation, I will provide the following information: |
|
- Room size |
|
- User input |
|
- Room layout elements |
|
- A list of previously placed objects with their placement in the room |
|
- New objects to be placed, including their attributes |
|
|
|
**Task**: |
|
For each new object provided, you are required to **reason step-by-step** about its spatial position in the room. Your reasoning should: |
|
- Identify and resolve any **conflicts** between the new object and existing objects in the scene. For example, if a table is placed to the right of a chair and a sofa is placed to the left of the table, this could result in the chair and sofa occupying the same space. |
|
- Take into account **user input preferences** to ensure the layout aligns with their vision. |
|
- Adhere to **basic design principles**, such as balance, scale, and proportion. |
|
- Consider the **functionality** and **aesthetic appeal** of the room as a whole. |
|
If the Schema_engineer reports a validation error about the JSON schema, solve the error in a way that spatially makes sense! |
|
|
|
**Important**: |
|
- You are not allowed to modify the positions of existing objects in the scene; only adjust the placement of new objects. |
|
|
|
The final output must follow the JSON schema below: |
|
|
|
{scene_graph_schema} |
|
Note: type, description, properties, items and enum are just structural guidance and should not be output in the final result!! |
|
|
|
## DIRECTIVES |
|
- For the placement of each object, it should comply with basic human common sense. For example: |
|
- The chair should face towards the table, not have its back to the table. |
|
- The bowl cannot be placed on the wall. |
|
- The TV MUST not be placed on the floor. |
|
- All objects cannot be directly placed in the air. |
|
- **Objects placed against a wall MUST face the opposite wall. A chair placed against south_wall MUST face north_wall.** |
|
- The orientation of chairs should be determined based on their relative position to the table/desk: |
|
- Assume the table/desk faces north_wall. |
|
- If a chair is to the **left of** the table/desk, it should face **east_wall**. |
|
- If a chair is to the **right of** the table/desk, it should face **west_wall**. |
|
- If a chair is **in front** of the table/desk, it should face **south_wall**. |
|
- If a chair is **behind** the table/desk, it should face **north_wall**. |
|
- **A sofa MUST be placed against a wall.** |
|
- **For the "facing" of each object, you MUST ONLY choose from ["west_wall", "east_wall", "north_wall", "south_wall"].** |
|
- The orientation of objects should be consistent with their functional purpose and placement relative to other objects. |
|
- **Functionally related objects MUST be placed adjacent to each other (e.g., tables and chairs, beds and bedside tables).** For example, the chair MUST be adjacent to the table/desk. |
|
- **Tables/desks or similar objects MUST face north_wall.** |
|
|
|
**FAILURE TO COMPLY WITH THE DIRECTIVES WILL RESULT IN COMPLETE REJECTION OF YOUR OUTPUT.** |
|
""" |
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
schema_engineer = JSONSchemaAgent( |
|
name = "Schema_engineer", |
|
is_termination_msg = is_termination_msg, |
|
) |
|
|
|
return user_proxy, interior_architect, schema_engineer |
|
|
|
def language_summary_agents(): |
|
user_proxy = autogen.UserProxyAgent( |
|
name="Admin", |
|
system_message = "A human admin.", |
|
is_termination_msg = is_termination_msg, |
|
code_execution_config=False |
|
) |
|
|
|
language_architect = autogen.AssistantAgent( |
|
name = "Language_architect", |
|
llm_config = gpt4_md_config, |
|
human_input_mode = "NEVER", |
|
is_termination_msg = is_termination_msg, |
|
system_message = f""" |
|
You are an agent specialized in organizing and simplifying content related to the placement of objects in a room and conflict detection. |
|
|
|
### Task: |
|
Your task is to process the input content, which includes the placement process and conflict detection for each object in the scene, extract the key steps for arranging objects in the scene and produce a **concise and logically coherent output** in complete paragraphs. |
|
|
|
### Input: |
|
The input will consist of: |
|
1. Chain of thought for requirements_analyzer, substructure_analyzer, and interior_designer. |
|
2. Chain of thought for object placement. |
|
3. Conflict data. |
|
4. Scene graph. |
|
|
|
### Output Format: |
|
For each step, output in a smooth and logically coherent paragraph **without subheadings**. Your output should follow the provided template and include the following sections. |
|
Present the final output in strict markdown format, following the schema below: |
|
{{{{ |
|
## 1. Requirement Analysis |
|
- Summarize the user's description, preferences, and requirements in a complete paragraph. |
|
- Highlight key elements such as room dimensions, style preferences, and functional needs. |
|
|
|
## 2. Area Decomposition |
|
- Describe how the scene is decomposed into substructures based on user requirements in a complete paragraph. |
|
- List each substructure and its purpose. |
|
|
|
## 3. Object Recommendations |
|
- Detail the objects recommended for each substructure in a complete paragraph. |
|
- Include object attributes such as style, dimensions, and functionality. |
|
|
|
## 4. Scene Graph |
|
- For each object, describe the following in a complete paragraph: |
|
- **Placement Reason**: Why the object is necessary based on user requirements and substructure analysis. |
|
- **Placement**: Specific location in the room (e.g., center, against a wall). |
|
- **Dimensions**: Object size. |
|
- **Direction**: Orientation of the object. |
|
- **Placement Process**: Detailed reasoning and steps taken to place the object, including how it aligns with user preferences and design principles. Include consideration of existing objects in the room and their relative positional relationships. |
|
|
|
## 5. Global Check |
|
- **Conflict Description**: Conflict includes layout conflict and size conflict. Identify the conflict and the objects involved in a complete paragraph. |
|
- **Conflict Resolution**: Explain how the conflict was resolved, including the repositioning of objects and the deletion of objects. |
|
}}}} |
|
|
|
### Instructions: |
|
- Extract key information from the input and organize it logically. |
|
- Remove redundancy while retaining all critical details. |
|
- Use clear and concise language, avoiding technical jargon where possible. |
|
- Ensure the output flows naturally and is easy to understand. |
|
- Maintain logical connections between sections using appropriate transitions. |
|
- In the **Scene Graph** section, **Dimensions** of **every object**, namely its length, width, and height, **MUST** be accurately described. |
|
- In the **Scene Graph** section, the descriptions of **Placement Reason** and **Placement Process** for each object should be detailed and comprehensive, clearly reflecting the complete thought process. This includes explaining **why the object is placed in a specific location** and considering its relationship to existing objects in the room. Additionally, the descriptions should align as closely as possible with the **<REASON>** section of the provided **Chain of Thought for Object Placement**. |
|
|
|
### Example: |
|
{{{{ |
|
## 1. Requirement Analysis |
|
Based on the user's description, the primary goal is to create a modern-style game room centered around a pool table. The room dimensions are specified as 4.0 meters by 4.0 meters with a ceiling height of 2.5 meters. The user explicitly requested a pool table and emphasized a preference for a modern aesthetic. |
|
|
|
## 2. Area Decomposition |
|
The first substructure is the Pool Table Area, designated as the central zone for the pool table. Next is the Storage Area, intended for storing billiard accessories. The Lighting Area focuses on ambient lighting to enhance the modern aesthetic, while the Leisure Area is designed for social interaction and relaxation. |
|
|
|
## 3. Object Recommendations |
|
For the Pool Table Area, a modern-style pool table with dimensions of 3.444 meters by 1.819 meters by 0.801 meters is recommended. In the Storage Area, a modern metal shelving unit measuring 1.5 meters by 0.3 meters by 2.0 meters is proposed to store billiard accessories. The Lighting Area features an LED light strip with a length of 4.0 meters, installed along the ceiling perimeter. For the Leisure Area, a modern-style carpet (4.0 meters by 4.0 meters), a sofa (2.0 meters by 0.8 meters), and a modern glass coffee table (1.0 meters by 0.6 meters) are recommended to create a comfortable and stylish space. |
|
|
|
## 4. Scene Graph |
|
Starting with the pool table, the user explicitly requested it as the central element. Given the room's dimensions (4.0m x 4.0m x 2.5m) and the pool table's size (3.444m x 1.819m x 0.801m), it is placed centrally to provide adequate space on all sides for movement and gameplay. This central placement ensures the pool table remains the focal point, adhering to modern design principles while maintaining balance and proportion. The pool table is oriented parallel to the walls, ensuring optimal gameplay and visual harmony with the room's layout. |
|
|
|
Next, the shelving unit is positioned against the north wall to the right of the pool table. This placement ensures easy access for storing billiard accessories while avoiding spatial conflicts with the pool table. The shelving unit's dimensions (1.5m x 0.3m x 2.0m) comfortably fit against the wall, maintaining the room's modern aesthetic and functional requirements. Its placement against the north wall complements the pool table without overwhelming the space, ensuring the room remains uncluttered and visually balanced. |
|
|
|
The LED light strip is installed along the ceiling perimeter to enhance ambient lighting. This placement ensures the light strip does not interfere with the pool table or shelving unit while providing a modern lighting solution. The 4.0-meter length of the LED strip allows it to extend across the ceiling perimeter, creating a cohesive and visually appealing lighting scheme that complements the room's modern style. |
|
|
|
For the carpet, it is placed on the floor, covering the entire room. The carpet's dimensions (4.0m x 4.0m) allow it to extend under the pool table, defining the leisure area and enhancing the room's aesthetic. Its thin profile ensures it does not interfere with the pool table's functionality or the shelving unit's placement. The carpet's neutral color and modern style align with the user's preferences, creating a cohesive visual boundary for the game area. |
|
|
|
The sofa is positioned along the south wall, facing the pool table. This placement ensures the sofa complements the leisure aspect of the game room without disrupting the room's flow. The sofa's dimensions (2.0m x 0.8m) allow it to fit comfortably against the south wall, maintaining balance and proportion. Its orientation toward the pool table enhances the room's functionality as a social and relaxation space while adhering to modern design principles. |
|
|
|
Finally, the coffee table is placed in front of the sofa, facing the north wall. This placement ensures it is adjacent to the sofa, providing a functional surface for drinks and items while maintaining the room's modern aesthetic. The coffee table's dimensions (1.0m x 0.6m) and transparent material ensure it does not visually clutter the space, preserving an open feel. Its position on the carpet, in the middle of the room, creates a cohesive leisure area that enhances the room's usability and visual appeal. |
|
|
|
## 5. Global Check |
|
During the placement process, a conflict was identified: the central area of the room was too small to accommodate all objects, including the carpet, pool table, shelving unit, sofa, and coffee table. To resolve this, the shelving unit was removed based on its lower functional priority compared to the pool table and leisure area. |
|
}}}} |
|
|
|
""" |
|
) |
|
|
|
return user_proxy, language_architect |
|
|
|
def calculation_summary_agents(): |
|
user_proxy = autogen.UserProxyAgent( |
|
name="Admin", |
|
system_message = "A human admin.", |
|
is_termination_msg = is_termination_msg, |
|
code_execution_config=False |
|
) |
|
|
|
calculation_architect = autogen.AssistantAgent( |
|
name = "Calculation_architect", |
|
llm_config = gpt4_md_config, |
|
human_input_mode = "NEVER", |
|
is_termination_msg = is_termination_msg, |
|
system_message = f""" |
|
You are an agent specialized in organizing and simplifying detailed calculation processes related to object placement in a room. |
|
|
|
### Task: |
|
Process the input, which consists of verbose and redundant calculation logs, and produce a concise output that clearly presents the calculation process for each object in the order they were placed. |
|
|
|
### Input: |
|
The input will be a detailed log of calculations for placing objects in a room, including constraint handling, position calculations, boundary adjustments, and collision checks. |
|
The log contains repetitive and redundant information, such as multiple checks for the same constraints and verbose descriptions of calculations. |
|
|
|
### Output Requirements: |
|
- **Object Placement Order**: Present the calculation process in the sequence objects were placed, maintaining parent-child relationships. |
|
- **Calculation Steps** (per object): |
|
- **Format** |
|
- **Reason**: Concise explanation of the calculation purpose (e.g., constraint application, collision check). |
|
- **Calculation Process**: |
|
- Key formulas with object dimensions, constraint parameters, and intermediate results. |
|
- Parent-child spatial relationships (e.g., 'parent_id' for nested objects). |
|
- Directional constraints (e.g., rotation differences, prepositions like "behind", "in front"). |
|
- **Conclusion**: Final result of the calculation and how it affects the object's placement (e.g., final coordinates and constraint compliance status). |
|
- **Content** |
|
- **Spatial Relationships**: |
|
- **Rotation Difference**: '|θ_parent - θ_child|' calculation with explicit object IDs. |
|
- **Directional Constraints**: Preposition logic (e.g., "behind", "in front") with dimension selection (length / width). |
|
- **Constraint Propagation**: |
|
- **Size Constraint**: 'max(0.0, child_size + cluster_size)' for directional constraints. |
|
- **Cluster Size**: Aggregated values from child objects (e.g., 'left of', 'in front'). |
|
- **Position Calculation**: |
|
- **Boundary Adjustment**: Formulaic derivation of 'x_min', 'x_max', etc., referencing parent positions. |
|
- **Collision Check**: Overlap detection logic (e.g., 'parent_x ± parent_length / 2' vs. 'child_x ± child_length / 2'). |
|
- **Final Placement**: |
|
- **Coordinates**: Final position with cluster constraint compliance. |
|
- **Status**: Collision outcome (e.g., "No collision detected"). |
|
|
|
### Instructions: |
|
1. **Extract Key Information**: |
|
- Identify essential steps (e.g., constraint resolution, boundary adjustments). |
|
- Extract exact dimensions and constraint parameters from input logs. |
|
- Track parent-child hierarchy and spatial relationships. |
|
2. **Remove Redundancy**: |
|
- Eliminate duplicate constraint checks for the same object. |
|
- Condense repetitive collision detection logic. |
|
3. **Organize by Placement Order**: |
|
- Follow the order of object placement (e.g., 'pool_table_1' first, then its children). |
|
- Nest child objects under their parent in the output. |
|
4. **Include All Formulas**: |
|
- Retain rotation difference calculations ('|θ₁ - θ₂|'). |
|
- Show cluster size aggregation (e.g., 'max(0.0, child_size + cluster_size)'). |
|
- Include boundary adjustment formulas (e.g., 'x_min = parent_x - parent_length / 2 - child_length / 2'). |
|
- Explain their purpose and outcome. |
|
5. **Clarify and Simplify**: |
|
- Replace ambiguous terms with specific object IDs (e.g., "sofa_1" instead of "child object"). |
|
- Use consistent notation for coordinate systems (x, y, z). |
|
- Explicitly state collision outcomes (e.g., "No collision detected"). |
|
|
|
### Instructions for Calculation Steps: |
|
1. **Constraint Calculation**: |
|
- For each directional preposition (e.g., "behind", "in front"): |
|
- Compute rotation difference between parent and child. |
|
- Select primary dimension (length / width) based on rotation alignment. |
|
- Calculate constraint as 'max(0.0, child_size + child_cluster_size)'. |
|
- For non-directional constraints (e.g., "under"): |
|
- Skip size constraint but apply spatial boundaries. |
|
2. **Cluster Size Aggregation**: |
|
- Sum child sizes and their cluster constraints along the selected dimension. |
|
- Example: 'sofa_1 cluster size (in front) = coffee_table_1.size (1.0) + coffee_table_1.cluster_size (0.0) = 1.0'. |
|
3. **Position Calculation**: |
|
- For wall / ceiling constraints: |
|
- Use formula: 'x_min = wall_x - wall_length / 2 + object_length / 2'. |
|
- For relative constraints (e.g., "under pool_table_1"): |
|
- Formula: 'x_min = parent_x - parent_length / 2 - object_length / 2'. |
|
4. **Collision Detection**: |
|
- Check overlap using 'parent_x ± parent_length / 2' vs. 'child_x ± child_length / 2'. |
|
- Explicitly state collision outcomes (e.g., "Overlap detected: 1.722 ≤ 2.4041 ≤ 2.278 → No collision"). |
|
|
|
### Output Format: |
|
Present the final output in strict markdown format, following the schema below: |
|
{{{{ |
|
For object: string (required) |
|
- parent object: string (optional) |
|
- *description*: Identifier for the parent object (if applicable) |
|
- calculation_steps: array of calculation steps (required) |
|
1. reason: Calculate rotation difference with {{{{child_id}}}} |
|
- calculation: array of strings |
|
- *description*: Detailed calculation steps |
|
- conclusion: string |
|
- *description*: Summary of the calculation result |
|
|
|
2. reason: Calculate size constraint for {{{{preposition}}}} relation |
|
- calculation: array of strings |
|
- *description*: Detailed calculation steps |
|
- conclusion: string |
|
- *description*: Summary of the calculation result |
|
|
|
3. reason: Calculate possible positions based on {{{{constraint_name}}}} constraint |
|
- calculation: array of strings |
|
- *description*: Detailed calculation steps |
|
- conclusion: string |
|
- *description*: Summary of the calculation result |
|
|
|
4. reason: Adjust boundaries for valid placement |
|
- calculation: array of strings |
|
- *description*: Detailed calculation steps |
|
- conclusion: string |
|
- *description*: Summary of the calculation result |
|
|
|
5. reason: Collision check with {{{{object_id}}}} |
|
- calculation: array of strings |
|
- *description*: Detailed calculation steps |
|
- conclusion: string |
|
- *description*: Summary of the calculation result |
|
|
|
6. reason: Final position calculation |
|
- calculation: array of strings |
|
- *description*: Detailed calculation steps |
|
- conclusion: string |
|
- *description*: Summary of the final position |
|
}}}} |
|
|
|
### Example: |
|
{{{{ |
|
For pool_table_1 |
|
- calculation_steps: |
|
1. reason: Calculate rotation difference with sofa_1 |
|
- calculation: |
|
- Rotation of pool_table_1: 0.0° |
|
- Rotation of sofa_1: 0.0° |
|
- Rotation difference: |0.0 - 0.0| = 0.0° |
|
- conclusion: Using length dimension for directional constraint |
|
2. reason: Calculate size constraint based on 'behind' relation |
|
- calculation: |
|
- sofa_1 size: 2.0 (length) |
|
- coffee_table_1 cluster size (in front): 1.0 |
|
- Total constraint: 2.0 (sofa_1 length) + 0.0 (non-adjacent) = 2.0 |
|
- conclusion: Cluster constraint (y_neg): 2.0 |
|
3. reason: Calculate possible positions based on 'middle of the room' constraint |
|
- calculation: |
|
- pool_table_1 size: length=3.444, width=1.819, height=0.801 |
|
- Room size: 4.0x4.0x2.5 |
|
- x_min = 2.0 - 4.0/2 + 3.444/2 = 1.722 |
|
- x_max = 2.0 + 4.0/2 - 3.444/2 = 2.278 |
|
- y_min = 2.0 - 4.0/2 + 1.819/2 = 0.9095 |
|
- y_max = 2.0 + 4.0/2 - 1.819/2 = 3.0905 |
|
- z_min = z_max = 0.801/2 = 0.4005 |
|
- conclusion: Possible position: (1.722, 2.278, 0.9095, 3.0905, 0.4005, 0.4005) |
|
4. reason: Final position calculation |
|
- calculation: |
|
- Adjusted cluster constraint: x(1.722-2.278), y(0.9095-3.0905) |
|
- Final coordinates: x=2.0695, y=3.0301, z=0.4005 |
|
- conclusion: Final position: x: 2.0695, y: 3.0301, z: 0.4005 |
|
|
|
For sofa_1 |
|
- parent object: pool_table_1 |
|
- calculation_steps: |
|
1. reason: Calculate rotation difference with coffee_table_1 |
|
- calculation: |
|
- Rotation of sofa_1: 0.0° |
|
- Rotation of coffee_table_1: 0.0° |
|
- Rotation difference: |0.0 - 0.0| = 0.0° |
|
- conclusion: Using length dimension for directional constraint |
|
2. reason: Calculate size constraint based on 'in front' relation |
|
- calculation: |
|
- coffee_table_1 size: 1.0 (length) |
|
- Cluster size (in front): max(0.0, 1.0) = 1.0 |
|
- conclusion: sofa_1 cluster size (in front): 1.0 |
|
3. reason: Calculate possible positions based on 'south_wall' constraint |
|
- calculation: |
|
- sofa_1 size: length=2.0, width=0.8, height=0.75 |
|
- x_min = 2.0 - 4.0/2 + 2.0/2 = 1.0 |
|
- x_max = 2.0 + 4.0/2 - 2.0/2 = 3.0 |
|
- y_min = y_max = 0.4 |
|
- z_min = z_max = 0.375 |
|
- conclusion: Possible position: (1.0, 3.0, 0.4, 0.4, 0.375, 0.375) |
|
4. reason: Adjust for 'behind pool_table_1' constraint |
|
- calculation: |
|
- y_min = max(0.4, 3.0301 - 1.819/2 - 0.8/2) = 1.7206 |
|
- y_max = min(0.4, 3.0301 + 1.819/2 + 0.8/2) = 0.4 |
|
- conclusion: Final position: x: 2.3208, y: 0.4, z: 0.375 |
|
|
|
For coffee_table_1 |
|
- parent object: sofa_1 |
|
- calculation_steps: |
|
1. reason: Calculate size constraint for 'in front' relation |
|
- calculation: |
|
- coffee_table_1 size: 1.0 (length) |
|
- Cluster size (in front): max(0.0, 1.0) = 1.0 |
|
- conclusion: sofa_1 cluster size (in front): 1.0 |
|
2. reason: Calculate possible positions based on 'in front of sofa_1' constraint |
|
- calculation: |
|
- x_min = 2.3208 - 2.0/2 + 1.0/2 = 1.8208 |
|
- x_max = 2.3208 + 2.0/2 - 1.0/2 = 2.8208 |
|
- y_min = y_max = 0.4 + 0.8/2 + 0.6/2 = 1.1 |
|
- z_min = z_max = 0.2 |
|
- conclusion: Possible position: (1.8208, 2.8208, 1.1, 1.1, 0.2, 0.2) |
|
3. reason: Collision check with pool_table_1 |
|
- calculation: |
|
- Overlap detection: 1.722 ≤ 2.4041 ≤ 2.278 → No collision |
|
- Final coordinates: x=2.4041, y=1.1, z=0.2 |
|
- conclusion: Final position: x: 2.4041, y: 1.1, z: 0.2 |
|
|
|
For carpet_1 |
|
- parent object: pool_table_1 |
|
- calculation_steps: |
|
1. reason: Calculate size constraint for 'under' relation |
|
- calculation: |
|
- carpet_1 size: 4.0x4.0x0.01 |
|
- Cluster size (under): 0.0 (non-directional) |
|
- conclusion: No directional constraint applied |
|
2. reason: Calculate possible positions based on 'middle of the room' constraint |
|
- calculation: |
|
- x_min = x_max = 2.0 |
|
- y_min = y_max = 2.0 |
|
- z_min = z_max = 0.005 |
|
- conclusion: Possible position: (2.0, 2.0, 2.0, 2.0, 0.005, 0.005) |
|
3. reason: Adjust for 'under pool_table_1' constraint |
|
- calculation: |
|
- x_min = max(2.0, 2.0695 - 3.444/2 - 4.0/2) = 2.0 |
|
- y_min = max(2.0, 3.0301 - 1.819/2 - 4.0/2) = 2.0 |
|
- conclusion: Final position: x: 2.0, y: 2.0, z: 0.005 |
|
}}}} |
|
|
|
# DIRECTIVES |
|
Carefully analyze the input. For each object, the "calculation_steps" **MUST** include the following six reasons in order: |
|
1. Calculate rotation difference with {{{{child_id}}}} |
|
2. Calculate size constraint for {{{{preposition}}}} relation |
|
3. Calculate possible positions based on {{{{constraint_name}}}} constraint |
|
4. Adjust boundaries for valid placement |
|
5. Collision check with {{{{object_id}}}} |
|
6. Final position calculation |
|
|
|
**The output MUST be in Markdown format. MUST NOT use JSON format. MUST NOT use any curly braces, square brackets, double quotes.** |
|
|
|
**If the output is in JSON format, you MUST convert it to Markdown format.** |
|
|
|
**FAILURE TO COMPLY WITH THE DIRECTIVES WILL RESULT IN COMPLETE REJECTION OF YOUR OUTPUT.** |
|
""" |
|
) |
|
|
|
return user_proxy, calculation_architect |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|