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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
open Core
open Async
let json_arg = Command.Arg_type.create Yojson.Safe.from_string
let call ?endpoint_url ?profile ?region f m result_to_json error_to_json =
let region =
match region with
| Some region -> Some (Awso.Region.of_string region)
| None -> None in
(Awso_async.Cfg.get_exn ?profile ?region ()) >>=
(fun cfg ->
(f ?endpoint_url ?cfg:(Some cfg) m) >>=
(fun result ->
match result with
| Error err ->
(match error_to_json with
| None ->
failwithf
"endpoint error, but no error values defined in boto"
()
| Some to_json ->
let s = (err |> to_json) |> Yojson.Safe.to_string in
failwithf "AWS error: %s" s ())
| Ok result ->
((match result_to_json with
| None -> print_endline "ok response from endpoint"
| Some to_json ->
((result |> to_json) |> Yojson.Safe.to_string) |>
print_endline);
return ())))
let create_invocation =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and description =
flag "description" (optional string)
~doc:"STRING InvocationDescription"
and invocationId =
flag "invocation-id" (optional string) ~doc:"STRING Uuid"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.create_invocation
(Values.CreateInvocationRequest.make ?description ?invocationId
~sessionIdentifier ())
(Some Values.CreateInvocationResponse.to_json)
(Some Values.CreateInvocationResponse.error_to_json)])
let create_session =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and encryptionKeyArn =
flag "encryption-key-arn" (optional string) ~doc:"STRING KmsKeyArn"
and sessionMetadata =
flag "session-metadata" (optional json_arg)
~doc:"JSON SessionMetadataMap"
and tags = flag "tags" (optional json_arg) ~doc:"JSON TagsMap" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.create_session
(Values.CreateSessionRequest.make ?encryptionKeyArn
?sessionMetadata:(Option.map
~f:Values.SessionMetadataMap.of_json
sessionMetadata)
?tags:(Option.map ~f:Values.TagsMap.of_json tags) ())
(Some Values.CreateSessionResponse.to_json)
(Some Values.CreateSessionResponse.error_to_json)])
let delete_agent_memory =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and memoryId =
flag "memory-id" (optional string) ~doc:"STRING MemoryId"
and sessionId =
flag "session-id" (optional string) ~doc:"STRING SessionId"
and agentAliasId =
flag "agent-alias-id" (required string) ~doc:"STRING AgentAliasId"
and agentId = flag "agent-id" (required string) ~doc:"STRING AgentId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.delete_agent_memory
(Values.DeleteAgentMemoryRequest.make ?memoryId ?sessionId
~agentAliasId ~agentId ())
(Some Values.DeleteAgentMemoryResponse.to_json)
(Some Values.DeleteAgentMemoryResponse.error_to_json)])
let delete_session =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.delete_session
(Values.DeleteSessionRequest.make ~sessionIdentifier ())
(Some Values.DeleteSessionResponse.to_json)
(Some Values.DeleteSessionResponse.error_to_json)])
let end_session =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.end_session
(Values.EndSessionRequest.make ~sessionIdentifier ())
(Some Values.EndSessionResponse.to_json)
(Some Values.EndSessionResponse.error_to_json)])
let generate_query =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and queryGenerationInput =
flag "query-generation-input" (required json_arg)
~doc:"JSON QueryGenerationInput"
and transformationConfiguration =
flag "transformation-configuration" (required json_arg)
~doc:"JSON TransformationConfiguration" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.generate_query
(Values.GenerateQueryRequest.make
~queryGenerationInput:(Values.QueryGenerationInput.of_json
queryGenerationInput)
~transformationConfiguration:(Values.TransformationConfiguration.of_json
transformationConfiguration) ())
(Some Values.GenerateQueryResponse.to_json)
(Some Values.GenerateQueryResponse.error_to_json)])
let get_agent_memory =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and maxItems = flag "max-items" (optional int) ~doc:"INT MaxResults"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING NextToken"
and agentAliasId =
flag "agent-alias-id" (required string) ~doc:"STRING AgentAliasId"
and agentId = flag "agent-id" (required string) ~doc:"STRING AgentId"
and memoryId =
flag "memory-id" (required string) ~doc:"STRING MemoryId"
and memoryType =
flag "memory-type" (required json_arg) ~doc:"JSON MemoryType" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_agent_memory
(Values.GetAgentMemoryRequest.make ?maxItems ?nextToken
~agentAliasId ~agentId ~memoryId
~memoryType:(Values.MemoryType.of_json memoryType) ())
(Some Values.GetAgentMemoryResponse.to_json)
(Some Values.GetAgentMemoryResponse.error_to_json)])
let get_execution_flow_snapshot =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and executionIdentifier =
flag "execution-identifier" (required string)
~doc:"STRING FlowExecutionIdentifier"
and flowAliasIdentifier =
flag "flow-alias-identifier" (required string)
~doc:"STRING FlowAliasIdentifier"
and flowIdentifier =
flag "flow-identifier" (required string)
~doc:"STRING FlowIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_execution_flow_snapshot
(Values.GetExecutionFlowSnapshotRequest.make ~executionIdentifier
~flowAliasIdentifier ~flowIdentifier ())
(Some Values.GetExecutionFlowSnapshotResponse.to_json)
(Some Values.GetExecutionFlowSnapshotResponse.error_to_json)])
let get_flow_execution =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and executionIdentifier =
flag "execution-identifier" (required string)
~doc:"STRING FlowExecutionIdentifier"
and flowAliasIdentifier =
flag "flow-alias-identifier" (required string)
~doc:"STRING FlowAliasIdentifier"
and flowIdentifier =
flag "flow-identifier" (required string)
~doc:"STRING FlowIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_flow_execution
(Values.GetFlowExecutionRequest.make ~executionIdentifier
~flowAliasIdentifier ~flowIdentifier ())
(Some Values.GetFlowExecutionResponse.to_json)
(Some Values.GetFlowExecutionResponse.error_to_json)])
let get_invocation_step =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and invocationIdentifier =
flag "invocation-identifier" (required string)
~doc:"STRING InvocationIdentifier"
and invocationStepId =
flag "invocation-step-id" (required string) ~doc:"STRING Uuid"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_invocation_step
(Values.GetInvocationStepRequest.make ~invocationIdentifier
~invocationStepId ~sessionIdentifier ())
(Some Values.GetInvocationStepResponse.to_json)
(Some Values.GetInvocationStepResponse.error_to_json)])
let get_session =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.get_session
(Values.GetSessionRequest.make ~sessionIdentifier ())
(Some Values.GetSessionResponse.to_json)
(Some Values.GetSessionResponse.error_to_json)])
let invoke_agent =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and bedrockModelConfigurations =
flag "bedrock-model-configurations" (optional json_arg)
~doc:"JSON BedrockModelConfigurations"
and enableTrace =
flag "enable-trace" (optional bool) ~doc:"BOOL Boolean"
and endSession =
flag "end-session" (optional bool) ~doc:"BOOL Boolean"
and inputText =
flag "input-text" (optional string) ~doc:"STRING InputText"
and memoryId =
flag "memory-id" (optional string) ~doc:"STRING MemoryId"
and promptCreationConfigurations =
flag "prompt-creation-configurations" (optional json_arg)
~doc:"JSON PromptCreationConfigurations"
and sessionState =
flag "session-state" (optional json_arg) ~doc:"JSON SessionState"
and sourceArn =
flag "source-arn" (optional string) ~doc:"STRING AWSResourceARN"
and streamingConfigurations =
flag "streaming-configurations" (optional json_arg)
~doc:"JSON StreamingConfigurations"
and agentAliasId =
flag "agent-alias-id" (required string) ~doc:"STRING AgentAliasId"
and agentId = flag "agent-id" (required string) ~doc:"STRING AgentId"
and sessionId =
flag "session-id" (required string) ~doc:"STRING SessionId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.invoke_agent
(Values.InvokeAgentRequest.make
?bedrockModelConfigurations:(Option.map
~f:Values.BedrockModelConfigurations.of_json
bedrockModelConfigurations)
?enableTrace ?endSession ?inputText ?memoryId
?promptCreationConfigurations:(Option.map
~f:Values.PromptCreationConfigurations.of_json
promptCreationConfigurations)
?sessionState:(Option.map ~f:Values.SessionState.of_json
sessionState) ?sourceArn
?streamingConfigurations:(Option.map
~f:Values.StreamingConfigurations.of_json
streamingConfigurations)
~agentAliasId ~agentId ~sessionId ())
(Some Values.InvokeAgentResponse.to_json)
(Some Values.InvokeAgentResponse.error_to_json)])
let invoke_flow =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and enableTrace =
flag "enable-trace" (optional bool) ~doc:"BOOL Boolean"
and executionId =
flag "execution-id" (optional string) ~doc:"STRING FlowExecutionId"
and modelPerformanceConfiguration =
flag "model-performance-configuration" (optional json_arg)
~doc:"JSON ModelPerformanceConfiguration"
and flowAliasIdentifier =
flag "flow-alias-identifier" (required string)
~doc:"STRING FlowAliasIdentifier"
and flowIdentifier =
flag "flow-identifier" (required string)
~doc:"STRING FlowIdentifier"
and inputs = flag "inputs" (required json_arg) ~doc:"JSON FlowInputs" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.invoke_flow
(Values.InvokeFlowRequest.make ?enableTrace ?executionId
?modelPerformanceConfiguration:(Option.map
~f:Values.ModelPerformanceConfiguration.of_json
modelPerformanceConfiguration)
~flowAliasIdentifier ~flowIdentifier
~inputs:(Values.FlowInputs.of_json inputs) ())
(Some Values.InvokeFlowResponse.to_json)
(Some Values.InvokeFlowResponse.error_to_json)])
let invoke_inline_agent =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and actionGroups =
flag "action-groups" (optional json_arg)
~doc:"JSON AgentActionGroups"
and agentCollaboration =
flag "agent-collaboration" (optional json_arg)
~doc:"JSON AgentCollaboration"
and agentName = flag "agent-name" (optional string) ~doc:"STRING Name"
and bedrockModelConfigurations =
flag "bedrock-model-configurations" (optional json_arg)
~doc:"JSON InlineBedrockModelConfigurations"
and collaboratorConfigurations =
flag "collaborator-configurations" (optional json_arg)
~doc:"JSON CollaboratorConfigurations"
and collaborators =
flag "collaborators" (optional json_arg) ~doc:"JSON Collaborators"
and customOrchestration =
flag "custom-orchestration" (optional json_arg)
~doc:"JSON CustomOrchestration"
and customerEncryptionKeyArn =
flag "customer-encryption-key-arn" (optional string)
~doc:"STRING KmsKeyArn"
and enableTrace =
flag "enable-trace" (optional bool) ~doc:"BOOL Boolean"
and endSession =
flag "end-session" (optional bool) ~doc:"BOOL Boolean"
and guardrailConfiguration =
flag "guardrail-configuration" (optional json_arg)
~doc:"JSON GuardrailConfigurationWithArn"
and idleSessionTTLInSeconds =
flag "idle-session-t-t-l-in-seconds" (optional int)
~doc:"INT SessionTTL"
and inlineSessionState =
flag "inline-session-state" (optional json_arg)
~doc:"JSON InlineSessionState"
and inputText =
flag "input-text" (optional string) ~doc:"STRING InputText"
and knowledgeBases =
flag "knowledge-bases" (optional json_arg)
~doc:"JSON KnowledgeBases"
and orchestrationType =
flag "orchestration-type" (optional json_arg)
~doc:"JSON OrchestrationType"
and promptCreationConfigurations =
flag "prompt-creation-configurations" (optional json_arg)
~doc:"JSON PromptCreationConfigurations"
and promptOverrideConfiguration =
flag "prompt-override-configuration" (optional json_arg)
~doc:"JSON PromptOverrideConfiguration"
and streamingConfigurations =
flag "streaming-configurations" (optional json_arg)
~doc:"JSON StreamingConfigurations"
and foundationModel =
flag "foundation-model" (required string)
~doc:"STRING ModelIdentifier"
and instruction =
flag "instruction" (required string) ~doc:"STRING Instruction"
and sessionId =
flag "session-id" (required string) ~doc:"STRING SessionId" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.invoke_inline_agent
(Values.InvokeInlineAgentRequest.make
?actionGroups:(Option.map ~f:Values.AgentActionGroups.of_json
actionGroups)
?agentCollaboration:(Option.map
~f:Values.AgentCollaboration.of_json
agentCollaboration) ?agentName
?bedrockModelConfigurations:(Option.map
~f:Values.InlineBedrockModelConfigurations.of_json
bedrockModelConfigurations)
?collaboratorConfigurations:(Option.map
~f:Values.CollaboratorConfigurations.of_json
collaboratorConfigurations)
?collaborators:(Option.map ~f:Values.Collaborators.of_json
collaborators)
?customOrchestration:(Option.map
~f:Values.CustomOrchestration.of_json
customOrchestration)
?customerEncryptionKeyArn ?enableTrace ?endSession
?guardrailConfiguration:(Option.map
~f:Values.GuardrailConfigurationWithArn.of_json
guardrailConfiguration)
?idleSessionTTLInSeconds
?inlineSessionState:(Option.map
~f:Values.InlineSessionState.of_json
inlineSessionState) ?inputText
?knowledgeBases:(Option.map ~f:Values.KnowledgeBases.of_json
knowledgeBases)
?orchestrationType:(Option.map
~f:Values.OrchestrationType.of_json
orchestrationType)
?promptCreationConfigurations:(Option.map
~f:Values.PromptCreationConfigurations.of_json
promptCreationConfigurations)
?promptOverrideConfiguration:(Option.map
~f:Values.PromptOverrideConfiguration.of_json
promptOverrideConfiguration)
?streamingConfigurations:(Option.map
~f:Values.StreamingConfigurations.of_json
streamingConfigurations)
~foundationModel ~instruction ~sessionId ())
(Some Values.InvokeInlineAgentResponse.to_json)
(Some Values.InvokeInlineAgentResponse.error_to_json)])
let list_flow_execution_events =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING NextToken"
and eventType =
flag "event-type" (required json_arg)
~doc:"JSON FlowExecutionEventType"
and executionIdentifier =
flag "execution-identifier" (required string)
~doc:"STRING FlowExecutionIdentifier"
and flowAliasIdentifier =
flag "flow-alias-identifier" (required string)
~doc:"STRING FlowAliasIdentifier"
and flowIdentifier =
flag "flow-identifier" (required string)
~doc:"STRING FlowIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_flow_execution_events
(Values.ListFlowExecutionEventsRequest.make ?maxResults ?nextToken
~eventType:(Values.FlowExecutionEventType.of_json eventType)
~executionIdentifier ~flowAliasIdentifier ~flowIdentifier ())
(Some Values.ListFlowExecutionEventsResponse.to_json)
(Some Values.ListFlowExecutionEventsResponse.error_to_json)])
let list_flow_executions =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and flowAliasIdentifier =
flag "flow-alias-identifier" (optional string)
~doc:"STRING FlowAliasIdentifier"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING NextToken"
and flowIdentifier =
flag "flow-identifier" (required string)
~doc:"STRING FlowIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_flow_executions
(Values.ListFlowExecutionsRequest.make ?flowAliasIdentifier
?maxResults ?nextToken ~flowIdentifier ())
(Some Values.ListFlowExecutionsResponse.to_json)
(Some Values.ListFlowExecutionsResponse.error_to_json)])
let list_invocation_steps =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and invocationIdentifier =
flag "invocation-identifier" (optional string)
~doc:"STRING InvocationIdentifier"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING NextToken"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_invocation_steps
(Values.ListInvocationStepsRequest.make ?invocationIdentifier
?maxResults ?nextToken ~sessionIdentifier ())
(Some Values.ListInvocationStepsResponse.to_json)
(Some Values.ListInvocationStepsResponse.error_to_json)])
let list_invocations =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING NextToken"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_invocations
(Values.ListInvocationsRequest.make ?maxResults ?nextToken
~sessionIdentifier ())
(Some Values.ListInvocationsResponse.to_json)
(Some Values.ListInvocationsResponse.error_to_json)])
let list_sessions =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and maxResults =
flag "max-results" (optional int) ~doc:"INT MaxResults"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING NextToken" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_sessions
(Values.ListSessionsRequest.make ?maxResults ?nextToken ())
(Some Values.ListSessionsResponse.to_json)
(Some Values.ListSessionsResponse.error_to_json)])
let list_tags_for_resource =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and resourceArn =
flag "resource-arn" (required string)
~doc:"STRING TaggableResourcesArn" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.list_tags_for_resource
(Values.ListTagsForResourceRequest.make ~resourceArn ())
(Some Values.ListTagsForResourceResponse.to_json)
(Some Values.ListTagsForResourceResponse.error_to_json)])
let optimize_prompt =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and input = flag "input" (required json_arg) ~doc:"JSON InputPrompt"
and targetModelId =
flag "target-model-id" (required string)
~doc:"STRING OptimizePromptRequestTargetModelIdString" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.optimize_prompt
(Values.OptimizePromptRequest.make
~input:(Values.InputPrompt.of_json input) ~targetModelId ())
(Some Values.OptimizePromptResponse.to_json)
(Some Values.OptimizePromptResponse.error_to_json)])
let put_invocation_step =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and invocationStepId =
flag "invocation-step-id" (optional string) ~doc:"STRING Uuid"
and invocationIdentifier =
flag "invocation-identifier" (required string)
~doc:"STRING InvocationIdentifier"
and invocationStepTime =
flag "invocation-step-time" (required json_arg)
~doc:"JSON DateTimestamp"
and payload =
flag "payload" (required json_arg) ~doc:"JSON InvocationStepPayload"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.put_invocation_step
(Values.PutInvocationStepRequest.make ?invocationStepId
~invocationIdentifier
~invocationStepTime:(Values.DateTimestamp.of_json
invocationStepTime)
~payload:(Values.InvocationStepPayload.of_json payload)
~sessionIdentifier ())
(Some Values.PutInvocationStepResponse.to_json)
(Some Values.PutInvocationStepResponse.error_to_json)])
let rerank =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING NextToken"
and queries =
flag "queries" (required json_arg) ~doc:"JSON RerankQueriesList"
and rerankingConfiguration =
flag "reranking-configuration" (required json_arg)
~doc:"JSON RerankingConfiguration"
and sources =
flag "sources" (required json_arg) ~doc:"JSON RerankSourcesList" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region Io.rerank
(Values.RerankRequest.make ?nextToken
~queries:(Values.RerankQueriesList.of_json queries)
~rerankingConfiguration:(Values.RerankingConfiguration.of_json
rerankingConfiguration)
~sources:(Values.RerankSourcesList.of_json sources) ())
(Some Values.RerankResponse.to_json)
(Some Values.RerankResponse.error_to_json)])
let retrieve =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and guardrailConfiguration =
flag "guardrail-configuration" (optional json_arg)
~doc:"JSON GuardrailConfiguration"
and nextToken =
flag "next-token" (optional string) ~doc:"STRING NextToken"
and retrievalConfiguration =
flag "retrieval-configuration" (optional json_arg)
~doc:"JSON KnowledgeBaseRetrievalConfiguration"
and knowledgeBaseId =
flag "knowledge-base-id" (required string)
~doc:"STRING KnowledgeBaseId"
and retrievalQuery =
flag "retrieval-query" (required json_arg)
~doc:"JSON KnowledgeBaseQuery" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.retrieve
(Values.RetrieveRequest.make
?guardrailConfiguration:(Option.map
~f:Values.GuardrailConfiguration.of_json
guardrailConfiguration) ?nextToken
?retrievalConfiguration:(Option.map
~f:Values.KnowledgeBaseRetrievalConfiguration.of_json
retrievalConfiguration)
~knowledgeBaseId
~retrievalQuery:(Values.KnowledgeBaseQuery.of_json
retrievalQuery) ())
(Some Values.RetrieveResponse.to_json)
(Some Values.RetrieveResponse.error_to_json)])
let retrieve_and_generate =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and retrieveAndGenerateConfiguration =
flag "retrieve-and-generate-configuration" (optional json_arg)
~doc:"JSON RetrieveAndGenerateConfiguration"
and sessionConfiguration =
flag "session-configuration" (optional json_arg)
~doc:"JSON RetrieveAndGenerateSessionConfiguration"
and sessionId =
flag "session-id" (optional string) ~doc:"STRING SessionId"
and input =
flag "input" (required json_arg)
~doc:"JSON RetrieveAndGenerateInput" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.retrieve_and_generate
(Values.RetrieveAndGenerateRequest.make
?retrieveAndGenerateConfiguration:(Option.map
~f:Values.RetrieveAndGenerateConfiguration.of_json
retrieveAndGenerateConfiguration)
?sessionConfiguration:(Option.map
~f:Values.RetrieveAndGenerateSessionConfiguration.of_json
sessionConfiguration) ?sessionId
~input:(Values.RetrieveAndGenerateInput.of_json input) ())
(Some Values.RetrieveAndGenerateResponse.to_json)
(Some Values.RetrieveAndGenerateResponse.error_to_json)])
let retrieve_and_generate_stream =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and retrieveAndGenerateConfiguration =
flag "retrieve-and-generate-configuration" (optional json_arg)
~doc:"JSON RetrieveAndGenerateConfiguration"
and sessionConfiguration =
flag "session-configuration" (optional json_arg)
~doc:"JSON RetrieveAndGenerateSessionConfiguration"
and sessionId =
flag "session-id" (optional string) ~doc:"STRING SessionId"
and input =
flag "input" (required json_arg)
~doc:"JSON RetrieveAndGenerateInput" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.retrieve_and_generate_stream
(Values.RetrieveAndGenerateStreamRequest.make
?retrieveAndGenerateConfiguration:(Option.map
~f:Values.RetrieveAndGenerateConfiguration.of_json
retrieveAndGenerateConfiguration)
?sessionConfiguration:(Option.map
~f:Values.RetrieveAndGenerateSessionConfiguration.of_json
sessionConfiguration) ?sessionId
~input:(Values.RetrieveAndGenerateInput.of_json input) ())
(Some Values.RetrieveAndGenerateStreamResponse.to_json)
(Some Values.RetrieveAndGenerateStreamResponse.error_to_json)])
let start_flow_execution =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and flowExecutionName =
flag "flow-execution-name" (optional string)
~doc:"STRING FlowExecutionName"
and modelPerformanceConfiguration =
flag "model-performance-configuration" (optional json_arg)
~doc:"JSON ModelPerformanceConfiguration"
and flowAliasIdentifier =
flag "flow-alias-identifier" (required string)
~doc:"STRING FlowAliasIdentifier"
and flowIdentifier =
flag "flow-identifier" (required string)
~doc:"STRING FlowIdentifier"
and inputs = flag "inputs" (required json_arg) ~doc:"JSON FlowInputs" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.start_flow_execution
(Values.StartFlowExecutionRequest.make ?flowExecutionName
?modelPerformanceConfiguration:(Option.map
~f:Values.ModelPerformanceConfiguration.of_json
modelPerformanceConfiguration)
~flowAliasIdentifier ~flowIdentifier
~inputs:(Values.FlowInputs.of_json inputs) ())
(Some Values.StartFlowExecutionResponse.to_json)
(Some Values.StartFlowExecutionResponse.error_to_json)])
let stop_flow_execution =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and executionIdentifier =
flag "execution-identifier" (required string)
~doc:"STRING FlowExecutionIdentifier"
and flowAliasIdentifier =
flag "flow-alias-identifier" (required string)
~doc:"STRING FlowAliasIdentifier"
and flowIdentifier =
flag "flow-identifier" (required string)
~doc:"STRING FlowIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.stop_flow_execution
(Values.StopFlowExecutionRequest.make ~executionIdentifier
~flowAliasIdentifier ~flowIdentifier ())
(Some Values.StopFlowExecutionResponse.to_json)
(Some Values.StopFlowExecutionResponse.error_to_json)])
let tag_resource =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and resourceArn =
flag "resource-arn" (required string)
~doc:"STRING TaggableResourcesArn"
and tags = flag "tags" (required json_arg) ~doc:"JSON TagsMap" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.tag_resource
(Values.TagResourceRequest.make ~resourceArn
~tags:(Values.TagsMap.of_json tags) ())
(Some Values.TagResourceResponse.to_json)
(Some Values.TagResourceResponse.error_to_json)])
let untag_resource =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and resourceArn =
flag "resource-arn" (required string)
~doc:"STRING TaggableResourcesArn"
and tagKeys =
flag "tag-keys" (required json_arg) ~doc:"JSON TagKeyList" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.untag_resource
(Values.UntagResourceRequest.make ~resourceArn
~tagKeys:(Values.TagKeyList.of_json tagKeys) ())
(Some Values.UntagResourceResponse.to_json)
(Some Values.UntagResourceResponse.error_to_json)])
let update_session =
Command.async ~summary:""
([%map_open.Command
let cli_profile =
flag "-cli-profile" (optional string) ~doc:"NAME aws profile to use"
and cli_region =
flag "-cli-region" (optional string) ~doc:"REGION override region"
and endpoint_url =
flag "-endpoint-url" (optional string)
~doc:"URL override endpoint url"
and sessionMetadata =
flag "session-metadata" (optional json_arg)
~doc:"JSON SessionMetadataMap"
and sessionIdentifier =
flag "session-identifier" (required string)
~doc:"STRING SessionIdentifier" in
fun () ->
call ?endpoint_url ?profile:cli_profile ?region:cli_region
Io.update_session
(Values.UpdateSessionRequest.make
?sessionMetadata:(Option.map
~f:Values.SessionMetadataMap.of_json
sessionMetadata) ~sessionIdentifier ())
(Some Values.UpdateSessionResponse.to_json)
(Some Values.UpdateSessionResponse.error_to_json)])
let main =
Command.group
~summary:((Awso.Service.to_string Values.service) ^ " commands")
[("create-invocation", create_invocation);
("create-session", create_session);
("delete-agent-memory", delete_agent_memory);
("delete-session", delete_session);
("end-session", end_session);
("generate-query", generate_query);
("get-agent-memory", get_agent_memory);
("get-execution-flow-snapshot", get_execution_flow_snapshot);
("get-flow-execution", get_flow_execution);
("get-invocation-step", get_invocation_step);
("get-session", get_session);
("invoke-agent", invoke_agent);
("invoke-flow", invoke_flow);
("invoke-inline-agent", invoke_inline_agent);
("list-flow-execution-events", list_flow_execution_events);
("list-flow-executions", list_flow_executions);
("list-invocation-steps", list_invocation_steps);
("list-invocations", list_invocations);
("list-sessions", list_sessions);
("list-tags-for-resource", list_tags_for_resource);
("optimize-prompt", optimize_prompt);
("put-invocation-step", put_invocation_step);
("rerank", rerank);
("retrieve", retrieve);
("retrieve-and-generate", retrieve_and_generate);
("retrieve-and-generate-stream", retrieve_and_generate_stream);
("start-flow-execution", start_flow_execution);
("stop-flow-execution", stop_flow_execution);
("tag-resource", tag_resource);
("untag-resource", untag_resource);
("update-session", update_session)]