computer-use-ootb-internal 0.0.122__py3-none-any.whl → 0.0.123__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- computer_use_ootb_internal/app_teachmode.py +533 -535
- computer_use_ootb_internal/computer_use_demo/animation/test_animation.py +39 -39
- computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py +3 -3
- computer_use_ootb_internal/computer_use_demo/tools/base.py +3 -3
- computer_use_ootb_internal/computer_use_demo/tools/computer.py +42 -40
- computer_use_ootb_internal/guard_service.py +810 -810
- computer_use_ootb_internal/preparation/star_rail_prepare.py +64 -64
- computer_use_ootb_internal/run_teachmode_ootb_args.py +20 -15
- computer_use_ootb_internal/service_manager.py +194 -194
- {computer_use_ootb_internal-0.0.122.dist-info → computer_use_ootb_internal-0.0.123.dist-info}/METADATA +8 -9
- {computer_use_ootb_internal-0.0.122.dist-info → computer_use_ootb_internal-0.0.123.dist-info}/RECORD +13 -14
- computer_use_ootb_internal-0.0.123.dist-info/entry_points.txt +2 -0
- computer_use_ootb_internal/app_teachmode_gradio.py +0 -200
- computer_use_ootb_internal-0.0.122.dist-info/entry_points.txt +0 -4
- {computer_use_ootb_internal-0.0.122.dist-info → computer_use_ootb_internal-0.0.123.dist-info}/WHEEL +0 -0
{computer_use_ootb_internal-0.0.122.dist-info → computer_use_ootb_internal-0.0.123.dist-info}/RECORD
RENAMED
@@ -1,16 +1,15 @@
|
|
1
1
|
computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6Grub7li4,31
|
2
2
|
computer_use_ootb_internal/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
3
|
-
computer_use_ootb_internal/app_teachmode.py,sha256=
|
4
|
-
computer_use_ootb_internal/app_teachmode_gradio.py,sha256=cmFpBrkdlZxOQADWveVdIaaNqaBD8IVs-xNLJogU7F8,7909
|
3
|
+
computer_use_ootb_internal/app_teachmode.py,sha256=3dz2h1FsVv_2nl4SGKIItvFxUH_BhvPbDAdADbMbKDI,22806
|
5
4
|
computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
|
6
|
-
computer_use_ootb_internal/guard_service.py,sha256=
|
5
|
+
computer_use_ootb_internal/guard_service.py,sha256=lpYts48r91F1Kb1syZzlAshe2ZUuijsrKfBFJ9kmQI8,43599
|
7
6
|
computer_use_ootb_internal/requirements-lite.txt,sha256=5DAHomz4A_P2BmTIXNkNqkHbnIF0AyZ4_1XAlb1LaYs,290
|
8
|
-
computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=
|
9
|
-
computer_use_ootb_internal/service_manager.py,sha256=
|
7
|
+
computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=HB7L9vuIPUXVqeTicyNJKArzTNAfgdpsyO3JEzmByIo,7315
|
8
|
+
computer_use_ootb_internal/service_manager.py,sha256=_aFUtvSbovX73PY1QE01RkaqGV6swJaStrOwcg_Df94,9928
|
10
9
|
computer_use_ootb_internal/computer_use_demo/animation/click_animation.py,sha256=tP1gsayFy-CKk10UlrE9RlexwlHWiHQUe5Ogg4vQvSg,3234
|
11
10
|
computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif,sha256=4LfwsfFQnREXrNRs32aJU2jO65JXianJoL_8q7-8elg,30966
|
12
|
-
computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=
|
13
|
-
computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=
|
11
|
+
computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=SOJz2yffXTkjuAHqk0IZLcMriR0KQYTo7W1b8wGyRGY,1222
|
12
|
+
computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=5fbEin5SDpchuCe6lEtRPK9JbO4YRqqIsD6LijJTrD8,16692
|
14
13
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py,sha256=h2CNeuACklxVpJC65QR8_6AvSybEZLmeO45hY_-lLBs,61
|
15
14
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py,sha256=CxFJbsSb68ERKH7-C4RaaZy7FIhhzrzGx5qQJ4C37cA,13907
|
16
15
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/utils.py,sha256=OOVxy4Qlbk5q-X9kXFXqt6AmuOMl6FWWqtH269DvJJA,10005
|
@@ -23,18 +22,18 @@ computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_litellm.py,
|
|
23
22
|
computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_llm.py,sha256=fxC-7lg8TLAi9f69zs5y5Pwga8Y5mY7Yfc5NNZNRJgM,1558
|
24
23
|
computer_use_ootb_internal/computer_use_demo/tools/__init__.py,sha256=Pj8_5L4_PPQK298X4NV3KMbP-84t-bM0pbjEeb5_SJQ,343
|
25
24
|
computer_use_ootb_internal/computer_use_demo/tools/aws_request.py,sha256=12UVzeA2PmpZhpy2Pt5Vh48-_q1e8ZjVQux6r3pbAcw,2629
|
26
|
-
computer_use_ootb_internal/computer_use_demo/tools/base.py,sha256=
|
25
|
+
computer_use_ootb_internal/computer_use_demo/tools/base.py,sha256=PiHzXUrdiK7QRi912fJw0c88mvmfTjM2zYijHtOoU_o,2127
|
27
26
|
computer_use_ootb_internal/computer_use_demo/tools/bash.py,sha256=rHetQ80_v-TTi-1oxIA7ncFEwJxFTh8FJCErIoZbGeY,4236
|
28
27
|
computer_use_ootb_internal/computer_use_demo/tools/collection.py,sha256=8RzHLobL44_Jjt8ltXS6I8XJlEAQOfc75dmnDUaHE-8,922
|
29
28
|
computer_use_ootb_internal/computer_use_demo/tools/colorful_text.py,sha256=cvlmnhAImDTwoRRwhT5au7mNFhfAD7ZfeoDEVdVzDKw,892
|
30
|
-
computer_use_ootb_internal/computer_use_demo/tools/computer.py,sha256=
|
29
|
+
computer_use_ootb_internal/computer_use_demo/tools/computer.py,sha256=sZKrvrBQBgaGQmQNQxWXOBiaxTk3szU1nhPkc8D3TdE,27096
|
31
30
|
computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py,sha256=zZuWz9ArfP3Zss-afnscrPkgCtB5UWbCy7HwAOvO2bo,5970
|
32
31
|
computer_use_ootb_internal/computer_use_demo/tools/edit.py,sha256=b0PwUitxckHCQqFP3ZwlthWdqNkn7WETeTHeB6-o98c,11486
|
33
32
|
computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
|
34
33
|
computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
|
35
34
|
computer_use_ootb_internal/preparation/__init__.py,sha256=AgtGHcBpiTkxJjF0xwcs3yyQ6SyUvhL3G0vD2XO-zJw,63
|
36
|
-
computer_use_ootb_internal/preparation/star_rail_prepare.py,sha256=
|
37
|
-
computer_use_ootb_internal-0.0.
|
38
|
-
computer_use_ootb_internal-0.0.
|
39
|
-
computer_use_ootb_internal-0.0.
|
40
|
-
computer_use_ootb_internal-0.0.
|
35
|
+
computer_use_ootb_internal/preparation/star_rail_prepare.py,sha256=G0A5JQpQUyt9ir5-t0l3p-Y7ZwRDo8TH-Oa5yTDqPWA,2713
|
36
|
+
computer_use_ootb_internal-0.0.123.dist-info/METADATA,sha256=wGUXtzY2axOIwSEkkDTb7_zwuRFPye3DVzbXoZN3pWE,910
|
37
|
+
computer_use_ootb_internal-0.0.123.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
38
|
+
computer_use_ootb_internal-0.0.123.dist-info/entry_points.txt,sha256=-AbmawU7IRQuDZihgVMVDrFoY4E6rnXYOUB-5vSeBKs,93
|
39
|
+
computer_use_ootb_internal-0.0.123.dist-info/RECORD,,
|
@@ -1,200 +0,0 @@
|
|
1
|
-
import argparse
|
2
|
-
import time
|
3
|
-
import gradio as gr
|
4
|
-
import json
|
5
|
-
from fastapi import FastAPI, Request
|
6
|
-
import threading
|
7
|
-
from screeninfo import get_monitors
|
8
|
-
from computer_use_ootb_internal.computer_use_demo.tools.computer import get_screen_details
|
9
|
-
from computer_use_ootb_internal.run_teachmode_ootb_args import simple_teachmode_sampling_loop
|
10
|
-
from fastapi.responses import JSONResponse
|
11
|
-
|
12
|
-
app = FastAPI()
|
13
|
-
|
14
|
-
class SharedState:
|
15
|
-
def __init__(self, args):
|
16
|
-
self.args = args
|
17
|
-
self.chatbot = None
|
18
|
-
self.chat_input = None
|
19
|
-
self.task_updated = False
|
20
|
-
self.chatbot_messages = []
|
21
|
-
# Store all state-related data here
|
22
|
-
self.model = args.model
|
23
|
-
self.task = getattr(args, 'task', "")
|
24
|
-
self.selected_screen = args.selected_screen
|
25
|
-
self.user_id = args.user_id
|
26
|
-
self.trace_id = args.trace_id
|
27
|
-
self.api_keys = args.api_keys
|
28
|
-
self.server_url = args.server_url
|
29
|
-
|
30
|
-
shared_state = None
|
31
|
-
|
32
|
-
async def update_parameters(request: Request):
|
33
|
-
data = await request.json()
|
34
|
-
|
35
|
-
if 'task' not in data:
|
36
|
-
return JSONResponse(
|
37
|
-
content={"status": "error", "message": "Missing required field: task"},
|
38
|
-
status_code=400
|
39
|
-
)
|
40
|
-
|
41
|
-
shared_state.args = argparse.Namespace(**data)
|
42
|
-
shared_state.task_updated = True
|
43
|
-
|
44
|
-
# Update shared state when parameters change
|
45
|
-
# shared_state.model = getattr(shared_state.args, 'model', "teach-mode-gpt-4o")
|
46
|
-
shared_state.task = getattr(shared_state.args, 'task', "Create a claim on the SAP system, using Receipt.pdf as attachment.")
|
47
|
-
shared_state.selected_screen = getattr(shared_state.args, 'selected_screen', 0)
|
48
|
-
shared_state.user_id = getattr(shared_state.args, 'user_id', "a_test")
|
49
|
-
shared_state.trace_id = getattr(shared_state.args, 'trace_id', "jess_4")
|
50
|
-
shared_state.api_keys = getattr(shared_state.args, 'api_keys', "sk-proj-1234567890")
|
51
|
-
shared_state.server_url = getattr(shared_state.args, 'server_url', "http://ec2-44-234-43-86.us-west-2.compute.amazonaws.com/generate_action")
|
52
|
-
|
53
|
-
return JSONResponse(
|
54
|
-
content={"status": "success", "message": "Parameters updated", "new_args": vars(shared_state.args)},
|
55
|
-
status_code=200
|
56
|
-
)
|
57
|
-
|
58
|
-
def process_input(user_input):
|
59
|
-
shared_state.chatbot_messages.append(gr.ChatMessage(role="user", content=user_input))
|
60
|
-
# shared_state.chatbot_messages.append(gr.ChatMessage(role="assistant", content="")) # seperate msgs
|
61
|
-
shared_state.task = user_input
|
62
|
-
shared_state.args.task = user_input # Add this line to update args.task as well
|
63
|
-
yield shared_state.chatbot_messages
|
64
|
-
|
65
|
-
print(f"start sampling loop: {shared_state.chatbot_messages}")
|
66
|
-
print(f"shared_state.args before sampling loop: {shared_state.args}")
|
67
|
-
|
68
|
-
# 0224 demo:
|
69
|
-
if "excel" in shared_state.task.lower():
|
70
|
-
shared_state.user_id = "a_test"
|
71
|
-
shared_state.trace_id = "excel_sum"
|
72
|
-
|
73
|
-
sampling_loop = simple_teachmode_sampling_loop(
|
74
|
-
model=shared_state.model,
|
75
|
-
task=shared_state.task,
|
76
|
-
selected_screen=shared_state.selected_screen,
|
77
|
-
user_id=shared_state.user_id,
|
78
|
-
trace_id=shared_state.trace_id,
|
79
|
-
api_keys=shared_state.api_keys,
|
80
|
-
server_url=shared_state.server_url,
|
81
|
-
)
|
82
|
-
|
83
|
-
for loop_msg in sampling_loop:
|
84
|
-
# print(f"loop_msg: {loop_msg}")
|
85
|
-
if loop_msg.startswith('<img'):
|
86
|
-
shared_state.chatbot_messages.append(gr.ChatMessage(role="user", content=loop_msg))
|
87
|
-
# shared_state.chatbot_messages.append(gr.ChatMessage(role="assistant", content="")) # seperate msgs
|
88
|
-
else:
|
89
|
-
shared_state.chatbot_messages.append(gr.ChatMessage(role="assistant", content=loop_msg))
|
90
|
-
# shared_state.chatbot_messages.append(gr.ChatMessage(role="user", content="")) # seperate msgs
|
91
|
-
|
92
|
-
time.sleep(2)
|
93
|
-
yield shared_state.chatbot_messages
|
94
|
-
|
95
|
-
complete_msg = f"Task '{shared_state.task}' completed. Thanks for using Teachmode-OOTB."
|
96
|
-
shared_state.chatbot_messages.append(gr.ChatMessage(role="assistant", content=complete_msg))
|
97
|
-
yield shared_state.chatbot_messages
|
98
|
-
|
99
|
-
def update_input():
|
100
|
-
while True:
|
101
|
-
time.sleep(1)
|
102
|
-
if shared_state and shared_state.task_updated:
|
103
|
-
if shared_state.chat_input is not None:
|
104
|
-
shared_state.chat_input.value = shared_state.args.task
|
105
|
-
shared_state.task_updated = False
|
106
|
-
|
107
|
-
def main():
|
108
|
-
global app, shared_state
|
109
|
-
|
110
|
-
parser = argparse.ArgumentParser(
|
111
|
-
description="Run a synchronous sampling loop for assistant/tool interactions in teach-mode."
|
112
|
-
)
|
113
|
-
parser.add_argument("--model", default="teach-mode-gpt-4o")
|
114
|
-
parser.add_argument("--task", default="Create a claim on the SAP system, using Receipt.pdf as attachment.")
|
115
|
-
parser.add_argument("--selected_screen", type=int, default=0)
|
116
|
-
parser.add_argument("--user_id", default="star_rail_dev")
|
117
|
-
parser.add_argument("--trace_id", default="scroll")
|
118
|
-
parser.add_argument("--api_key_file", default="api_key.json")
|
119
|
-
parser.add_argument("--api_keys", default="")
|
120
|
-
parser.add_argument(
|
121
|
-
"--server_url",
|
122
|
-
default="http://ec2-44-234-43-86.us-west-2.compute.amazonaws.com/generate_action",
|
123
|
-
help="Server URL for the session"
|
124
|
-
)
|
125
|
-
|
126
|
-
args = parser.parse_args()
|
127
|
-
shared_state = SharedState(args)
|
128
|
-
|
129
|
-
polling_thread = threading.Thread(target=update_input, daemon=True)
|
130
|
-
polling_thread.start()
|
131
|
-
|
132
|
-
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
133
|
-
gr.Markdown("# Teach Mode Beta")
|
134
|
-
|
135
|
-
with gr.Accordion("Settings", open=True):
|
136
|
-
with gr.Row():
|
137
|
-
with gr.Column():
|
138
|
-
model = gr.Dropdown(
|
139
|
-
label="Model",
|
140
|
-
choices=["teach-mode-beta"],
|
141
|
-
value="teach-mode-beta",
|
142
|
-
interactive=False,
|
143
|
-
)
|
144
|
-
with gr.Column():
|
145
|
-
provider = gr.Dropdown(
|
146
|
-
label="API Provider",
|
147
|
-
choices=["openai"],
|
148
|
-
value="openai",
|
149
|
-
interactive=False,
|
150
|
-
)
|
151
|
-
with gr.Column():
|
152
|
-
api_key = gr.Textbox(
|
153
|
-
label="API Key",
|
154
|
-
type="password",
|
155
|
-
value=shared_state.api_keys,
|
156
|
-
placeholder="No API key needed in beta",
|
157
|
-
interactive=False,
|
158
|
-
)
|
159
|
-
with gr.Column():
|
160
|
-
screen_options, primary_index = get_screen_details()
|
161
|
-
screen_selector = gr.Dropdown(
|
162
|
-
label="Select Screen",
|
163
|
-
choices=screen_options,
|
164
|
-
value=args.selected_screen,
|
165
|
-
interactive=False,
|
166
|
-
)
|
167
|
-
|
168
|
-
with gr.Row():
|
169
|
-
with gr.Column(scale=8):
|
170
|
-
chat_input = gr.Textbox(
|
171
|
-
value=args.task,
|
172
|
-
show_label=False,
|
173
|
-
container=False,
|
174
|
-
elem_id="chat_input"
|
175
|
-
)
|
176
|
-
shared_state.chat_input = chat_input
|
177
|
-
|
178
|
-
with gr.Column(scale=1, min_width=50):
|
179
|
-
submit_button = gr.Button(value="Send", variant="primary")
|
180
|
-
|
181
|
-
chatbot = gr.Chatbot(
|
182
|
-
label="Chatbot History",
|
183
|
-
group_consecutive_messages=False,
|
184
|
-
autoscroll=True,
|
185
|
-
height=580,
|
186
|
-
type="messages",
|
187
|
-
elem_id="chatbot",
|
188
|
-
)
|
189
|
-
shared_state.chatbot = chatbot
|
190
|
-
|
191
|
-
submit_button.click(fn=process_input, inputs=[chat_input], outputs=chatbot)
|
192
|
-
|
193
|
-
app.add_route("/update_params", update_parameters, methods=["POST"])
|
194
|
-
app = gr.mount_gradio_app(app, demo, path="/")
|
195
|
-
|
196
|
-
import uvicorn
|
197
|
-
uvicorn.run(app, host="0.0.0.0", port=7888)
|
198
|
-
|
199
|
-
if __name__ == "__main__":
|
200
|
-
main()
|
{computer_use_ootb_internal-0.0.122.dist-info → computer_use_ootb_internal-0.0.123.dist-info}/WHEEL
RENAMED
File without changes
|