|
5 | 5 | sys.path.append("/Users/allyne/Documents/GitHub/Unity-Agent/") |
6 | 6 | import agent as A |
7 | 7 |
|
| 8 | +def get_three_plans(task): |
| 9 | + planner= A.Planner() |
| 10 | + memory_manager = A.MemoryManager() |
| 11 | + examples = memory_manager._get_plan(task) |
| 12 | + st.write("Previous plans:\n", examples) |
| 13 | + output_1 = planner._generate_plan(task, examples) |
| 14 | + output_2 = planner._generate_plan(task, examples) |
| 15 | + output_3 = planner._generate_plan(task, []) |
| 16 | + st.write("Output 1 is:\n\n ", output_1) |
| 17 | + st.write("Output 2 is: \n\n", output_2) |
| 18 | + st.write("Output 3 is: \n\n", output_3) |
| 19 | + |
8 | 20 | def orchestrate(task): |
9 | 21 | planner = A.Planner() |
10 | 22 | output = planner._orchestrate(task) |
@@ -43,51 +55,61 @@ def identify_modify_object_operations(task): |
43 | 55 |
|
44 | 56 | st.title("Testing planning agent") |
45 | 57 |
|
46 | | -st.write("1. Identify task type") |
47 | | -task3 = st.text_area(f"Identify task type from task here", key="task3") |
48 | | -if st.button("Run", key="run1"): |
| 58 | +st.write("Generate 3 plans") |
| 59 | +task = st.text_area(f"Enter task here", key="task") |
| 60 | +if st.button("Run", key="run"): |
49 | 61 | with st.spinner("Processing"): |
50 | | - identify_task_type(task3) |
| 62 | + get_three_plans(task) |
51 | 63 | st.success("Process done!") |
52 | 64 |
|
53 | | -st.write("2. Identify prefab to be created, modified, or deleted.") |
54 | | -st.write('All prefabs avail are: ["Chair", "TableLamp", "Table", "Screen", "Push Button"]') |
55 | | -task = st.text_area(f"Identify prefab from task here", key="task") |
56 | | -if st.button("Run", key="run2"): |
57 | | - with st.spinner("Processing"): |
58 | | - identify_prefab(task) |
59 | | - st.success("Process done!") |
60 | 65 |
|
61 | | -st.write("3. Identify creation operations") |
62 | | -task5= st.text_area(f"Identify creation operations from task here", key="task5") |
63 | | -if st.button("Run", key="run5"): |
64 | | - with st.spinner("Processing"): |
65 | | - st.write("Location, orientation, size, color") |
66 | | - identify_create_object_operations(task5) |
67 | | - st.success("Process done!") |
| 66 | +# st.write("=====Old=====") |
68 | 67 |
|
69 | | -st.write("4. Identify modification operations") |
70 | | -task4 = st.text_area(f"Identify modification operations from task here", key="task4") |
71 | | -if st.button("Run", key="run4"): |
72 | | - with st.spinner("Processing"): |
73 | | - st.write("Location, orientation, size, color") |
74 | | - identify_modify_object_operations(task4) |
75 | | - st.success("Process done!") |
| 68 | +# st.write("1. Identify task type") |
| 69 | +# task3 = st.text_area(f"Identify task type from task here", key="task3") |
| 70 | +# if st.button("Run", key="run1"): |
| 71 | +# with st.spinner("Processing"): |
| 72 | +# identify_task_type(task3) |
| 73 | +# st.success("Process done!") |
76 | 74 |
|
77 | | -st.write("5. Identify location specification") |
78 | | -st.write('Possible locations are: ["BackWall", "FrontWall", "LeftWall", "RightWall", "Floor", "Ceiling"]') |
79 | | -task2 = st.text_area(f"Identify location specification from task here", key="task2") |
80 | | -if st.button("Run", key="run3"): |
81 | | - with st.spinner("Processing"): |
82 | | - identify_location(task2) |
83 | | - st.success("Process done!") |
| 75 | +# st.write("2. Identify prefab to be created, modified, or deleted.") |
| 76 | +# st.write('All prefabs avail are: ["Chair", "TableLamp", "Table", "Screen", "Push Button"]') |
| 77 | +# task = st.text_area(f"Identify prefab from task here", key="task") |
| 78 | +# if st.button("Run", key="run2"): |
| 79 | +# with st.spinner("Processing"): |
| 80 | +# identify_prefab(task) |
| 81 | +# st.success("Process done!") |
84 | 82 |
|
85 | | -st.write("6. Orchestrate") |
86 | | -task1 = st.text_area(f"Create entire plan here", key="task1") |
87 | | -if st.button("Run", key="run6"): |
88 | | - with st.spinner("Processing"): |
89 | | - orchestrate(task1) |
90 | | - st.success("Process done!") |
| 83 | +# st.write("3. Identify creation operations") |
| 84 | +# task5= st.text_area(f"Identify creation operations from task here", key="task5") |
| 85 | +# if st.button("Run", key="run5"): |
| 86 | +# with st.spinner("Processing"): |
| 87 | +# st.write("Location, orientation, size, color") |
| 88 | +# identify_create_object_operations(task5) |
| 89 | +# st.success("Process done!") |
| 90 | + |
| 91 | +# st.write("4. Identify modification operations") |
| 92 | +# task4 = st.text_area(f"Identify modification operations from task here", key="task4") |
| 93 | +# if st.button("Run", key="run4"): |
| 94 | +# with st.spinner("Processing"): |
| 95 | +# st.write("Location, orientation, size, color") |
| 96 | +# identify_modify_object_operations(task4) |
| 97 | +# st.success("Process done!") |
| 98 | + |
| 99 | +# st.write("5. Identify location specification") |
| 100 | +# st.write('Possible locations are: ["BackWall", "FrontWall", "LeftWall", "RightWall", "Floor", "Ceiling"]') |
| 101 | +# task2 = st.text_area(f"Identify location specification from task here", key="task2") |
| 102 | +# if st.button("Run", key="run3"): |
| 103 | +# with st.spinner("Processing"): |
| 104 | +# identify_location(task2) |
| 105 | +# st.success("Process done!") |
| 106 | + |
| 107 | +# st.write("6. Orchestrate") |
| 108 | +# task1 = st.text_area(f"Create entire plan here", key="task1") |
| 109 | +# if st.button("Run", key="run6"): |
| 110 | +# with st.spinner("Processing"): |
| 111 | +# orchestrate(task1) |
| 112 | +# st.success("Process done!") |
91 | 113 |
|
92 | 114 | # st.write("3. Identify number of elements") |
93 | 115 | # task3 = st.text_area(f"Identify number of elements from task here", key="task3") |
|
0 commit comments