-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMacOS Agent.yml
More file actions
452 lines (452 loc) · 11.7 KB
/
MacOS Agent.yml
File metadata and controls
452 lines (452 loc) · 11.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
app:
description: MacOS Agent, achieve user's goal using applescript.
icon: "\U0001F916"
icon_background: '#FFEAD5'
mode: advanced-chat
name: MacOS Agent
workflow:
features:
file_upload:
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
opening_statement: ''
retriever_resource:
enabled: false
sensitive_word_avoidance:
enabled: false
speech_to_text:
enabled: false
suggested_questions: []
suggested_questions_after_answer:
enabled: false
text_to_speech:
enabled: false
language: ''
voice: ''
graph:
edges:
- data:
isInIteration: false
sourceType: llm
targetType: code
id: llm-source-1720603933600-target
source: llm
sourceHandle: source
target: '1720603933600'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: code
targetType: http-request
id: 1720603933600-source-1720603954849-target
source: '1720603933600'
sourceHandle: source
target: '1720603954849'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: http-request
targetType: llm
id: 1720603968110-source-llm-target
source: '1720603968110'
sourceHandle: source
target: llm
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: llm
targetType: answer
id: 1720604011717-source-answer-target
source: '1720604011717'
sourceHandle: source
target: answer
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: start
targetType: code
id: 1720603854640-source-1720604039714-target
source: '1720603854640'
sourceHandle: source
target: '1720604039714'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: code
targetType: http-request
id: 1720604039714-source-1720603968110-target
source: '1720604039714'
sourceHandle: source
target: '1720603968110'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: http-request
targetType: if-else
id: 1720603954849-source-1720701168680-target
source: '1720603954849'
sourceHandle: source
target: '1720701168680'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: if-else
targetType: llm
id: 1720701168680-true-1720604011717-target
source: '1720701168680'
sourceHandle: 'true'
target: '1720604011717'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: if-else
targetType: answer
id: 1720701168680-false-1720701198958-target
source: '1720701168680'
sourceHandle: 'false'
target: '1720701198958'
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
desc: ''
selected: false
title: Start
type: start
variables: []
height: 54
id: '1720603854640'
position:
x: 30
y: 282
positionAbsolute:
x: 30
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
context:
enabled: false
variable_selector: []
desc: Retrieve the script from the LLM.
memory:
role_prefix:
assistant: ''
user: ''
window:
enabled: false
size: 10
model:
completion_params:
temperature: 0.7
mode: chat
name: deepseek-chat
provider: deepseek
prompt_template:
- id: 0c599526-2f75-4238-a182-c5824184e45f
role: system
text: '{{#1720603968110.body#}}'
selected: false
title: LLM:get_script
type: llm
variables: []
vision:
enabled: false
height: 128
id: llm
position:
x: 942
y: 282
positionAbsolute:
x: 942
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
answer: '{{#1720604011717.text#}}'
desc: ''
selected: false
title: Answer:with_execution
type: answer
variables: []
height: 107
id: answer
position:
x: 2462
y: 282
positionAbsolute:
x: 2462
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
code: "import json\n\ndef main(llm_output: str, user_input: str) -> dict:\n\
\ # Ensure the llm_output is properly formatted for JSON\n llm_output_formatted\
\ = json.dumps(llm_output)\n user_input_formatted = json.dumps(user_input)\n\
\ return {\n \"llm_output_formatted\": llm_output_formatted,\n\
\ \"user_input_formatted\": user_input_formatted, \n }"
code_language: python3
desc: Format variables as JSON values.
outputs:
llm_output_formatted:
children: null
type: string
user_input_formatted:
children: null
type: string
selected: false
title: Code:format_params
type: code
variables:
- value_selector:
- llm
- text
variable: llm_output
- value_selector:
- sys
- query
variable: user_input
height: 84
id: '1720603933600'
position:
x: 1246
y: 282
positionAbsolute:
x: 1246
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
authorization:
config: null
type: no-auth
body:
data: "{\n \"point\": \"execute_script\",\n \"params\": {\n \
\ \"user_id\": \"{{#sys.user_id#}}\",\n \"inputs\": {\n \
\ \"user_input\": {{#1720603933600.user_input_formatted#}},\n\n \
\ \"llm_output\": {{#1720603933600.llm_output_formatted#}},\n\
\ \"script_timeout\": {{#1720604039714.script_timeout#}}\n\
\ }\n }\n}"
type: json
desc: Send the LLM output to the Agent for execution.
headers: Authorization:Bearer {{#1720604039714.agent_api_key#}}
method: post
params: ''
selected: false
timeout:
max_connect_timeout: 0
max_read_timeout: 0
max_write_timeout: 0
title: Agent:execute_script
type: http-request
url: '{{#1720604039714.agent_api_endpoint#}}'
variables: []
height: 141
id: '1720603954849'
position:
x: 1550
y: 282
positionAbsolute:
x: 1550
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
authorization:
config: null
type: no-auth
body:
data: "{\n \"point\": \"get_llm_system_prompt\",\n \"params\": {\n\
\ \"user_id\": \"{{#sys.user_id#}}\"\n }\n}"
type: json
desc: Retrieve the LLM system prompt from the macOS Agent server.
headers: Authorization:Bearer {{#1720604039714.agent_api_key#}}
method: post
params: ''
selected: false
timeout:
max_connect_timeout: 0
max_read_timeout: 0
max_write_timeout: 0
title: Agent:get_llm_system_prompt
type: http-request
url: '{{#1720604039714.agent_api_endpoint#}}'
variables: []
height: 141
id: '1720603968110'
position:
x: 638
y: 282
positionAbsolute:
x: 638
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
context:
enabled: false
variable_selector: []
desc: Use reply_prompt that includes "execution" as the system prompt for
the LLM to respond to user input.
memory:
query_prompt_template: '{{#sys.query#}}'
role_prefix:
assistant: ''
user: ''
window:
enabled: true
size: 50
model:
completion_params:
temperature: 0.7
mode: chat
name: deepseek-chat
provider: deepseek
prompt_template:
- id: 60cbca91-199d-4764-90d9-2851ab63c9ae
role: system
text: '{{#1720603954849.body#}}'
selected: false
title: LLM:reply
type: llm
variables: []
vision:
enabled: false
height: 164
id: '1720604011717'
position:
x: 2158
y: 282
positionAbsolute:
x: 2158
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
code: "\ndef main() -> dict:\n config = {\n \"agent_api_endpoint\"\
: \"http://host.docker.internal:8088\",\n \"agent_api_key\": \"a-secret-key\"\
,\n \"script_timeout\": 60\n }\n return {\n \"agent_api_endpoint\"\
: config[\"agent_api_endpoint\"],\n \"agent_api_key\": config[\"\
agent_api_key\"],\n \"script_timeout\": config[\"script_timeout\"\
],\n }\n"
code_language: python3
desc: Configuration for macOS Agent Server.
outputs:
agent_api_endpoint:
children: null
type: string
agent_api_key:
children: null
type: string
script_timeout:
children: null
type: number
selected: true
title: Code:config
type: code
variables: []
height: 102
id: '1720604039714'
position:
x: 334
y: 282
positionAbsolute:
x: 334
y: 282
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
conditions:
- comparison_operator: not empty
id: '1720701184521'
value: ''
variable_selector:
- '1720603954849'
- body
desc: if any script execution result
logical_operator: and
selected: false
title: IF:script_execution
type: if-else
height: 156
id: '1720701168680'
position:
x: 1854
y: 282
positionAbsolute:
x: 1854
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
answer: '{{#llm.text#}}'
desc: no script execution
selected: false
title: Answer:without_execution
type: answer
variables: []
height: 137
id: '1720701198958'
position:
x: 2158
y: 486
positionAbsolute:
x: 2158
y: 486
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
viewport:
x: 58.32490827558104
y: 176.2416089142547
zoom: 0.5618969968745753