@ai-sdk/anthropic 2.0.0-canary.10 → 2.0.0-canary.12
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.
- package/CHANGELOG.md +22 -0
- package/dist/index.d.mts +9 -19
- package/dist/index.d.ts +9 -19
- package/dist/index.js +209 -168
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +211 -170
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +2 -20
- package/dist/internal/index.d.ts +2 -20
- package/dist/internal/index.js +206 -165
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +208 -167
- package/dist/internal/index.mjs.map +1 -1
- package/internal.d.ts +1 -0
- package/package.json +5 -4
package/dist/internal/index.mjs
CHANGED
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
combineHeaders,
|
|
7
7
|
createEventSourceResponseHandler,
|
|
8
8
|
createJsonResponseHandler,
|
|
9
|
-
parseProviderOptions,
|
|
9
|
+
parseProviderOptions as parseProviderOptions2,
|
|
10
10
|
postJsonToApi,
|
|
11
11
|
resolve
|
|
12
12
|
} from "@ai-sdk/provider-utils";
|
|
13
|
-
import { z as
|
|
13
|
+
import { z as z3 } from "zod";
|
|
14
14
|
|
|
15
15
|
// src/anthropic-error.ts
|
|
16
16
|
import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
|
|
@@ -27,6 +27,21 @@ var anthropicFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
27
27
|
errorToMessage: (data) => data.error.message
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
+
// src/anthropic-messages-options.ts
|
|
31
|
+
import { z as z2 } from "zod";
|
|
32
|
+
var anthropicProviderOptions = z2.object({
|
|
33
|
+
/**
|
|
34
|
+
Include reasoning content in requests sent to the model. Defaults to `true`.
|
|
35
|
+
|
|
36
|
+
If you are experiencing issues with the model handling requests involving
|
|
37
|
+
*/
|
|
38
|
+
sendReasoning: z2.boolean().optional(),
|
|
39
|
+
thinking: z2.object({
|
|
40
|
+
type: z2.union([z2.literal("enabled"), z2.literal("disabled")]),
|
|
41
|
+
budgetTokens: z2.number().optional()
|
|
42
|
+
}).optional()
|
|
43
|
+
});
|
|
44
|
+
|
|
30
45
|
// src/anthropic-prepare-tools.ts
|
|
31
46
|
import {
|
|
32
47
|
UnsupportedFunctionalityError
|
|
@@ -157,8 +172,8 @@ function prepareTools({
|
|
|
157
172
|
import {
|
|
158
173
|
UnsupportedFunctionalityError as UnsupportedFunctionalityError2
|
|
159
174
|
} from "@ai-sdk/provider";
|
|
160
|
-
import { convertToBase64 } from "@ai-sdk/provider-utils";
|
|
161
|
-
function convertToAnthropicMessagesPrompt({
|
|
175
|
+
import { convertToBase64, parseProviderOptions } from "@ai-sdk/provider-utils";
|
|
176
|
+
async function convertToAnthropicMessagesPrompt({
|
|
162
177
|
prompt,
|
|
163
178
|
sendReasoning,
|
|
164
179
|
warnings
|
|
@@ -321,12 +336,37 @@ function convertToAnthropicMessagesPrompt({
|
|
|
321
336
|
}
|
|
322
337
|
case "reasoning": {
|
|
323
338
|
if (sendReasoning) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
cache_control: cacheControl
|
|
339
|
+
const reasoningMetadata = await parseProviderOptions({
|
|
340
|
+
provider: "anthropic",
|
|
341
|
+
providerOptions: part.providerOptions,
|
|
342
|
+
schema: anthropicReasoningMetadataSchema
|
|
329
343
|
});
|
|
344
|
+
if (reasoningMetadata != null) {
|
|
345
|
+
if (reasoningMetadata.signature != null) {
|
|
346
|
+
anthropicContent.push({
|
|
347
|
+
type: "thinking",
|
|
348
|
+
thinking: part.text,
|
|
349
|
+
signature: reasoningMetadata.signature,
|
|
350
|
+
cache_control: cacheControl
|
|
351
|
+
});
|
|
352
|
+
} else if (reasoningMetadata.redactedData != null) {
|
|
353
|
+
anthropicContent.push({
|
|
354
|
+
type: "redacted_thinking",
|
|
355
|
+
data: reasoningMetadata.redactedData,
|
|
356
|
+
cache_control: cacheControl
|
|
357
|
+
});
|
|
358
|
+
} else {
|
|
359
|
+
warnings.push({
|
|
360
|
+
type: "other",
|
|
361
|
+
message: "unsupported reasoning metadata"
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
} else {
|
|
365
|
+
warnings.push({
|
|
366
|
+
type: "other",
|
|
367
|
+
message: "unsupported reasoning metadata"
|
|
368
|
+
});
|
|
369
|
+
}
|
|
330
370
|
} else {
|
|
331
371
|
warnings.push({
|
|
332
372
|
type: "other",
|
|
@@ -335,14 +375,6 @@ function convertToAnthropicMessagesPrompt({
|
|
|
335
375
|
}
|
|
336
376
|
break;
|
|
337
377
|
}
|
|
338
|
-
case "redacted-reasoning": {
|
|
339
|
-
anthropicContent.push({
|
|
340
|
-
type: "redacted_thinking",
|
|
341
|
-
data: part.data,
|
|
342
|
-
cache_control: cacheControl
|
|
343
|
-
});
|
|
344
|
-
break;
|
|
345
|
-
}
|
|
346
378
|
case "tool-call": {
|
|
347
379
|
anthropicContent.push({
|
|
348
380
|
type: "tool_use",
|
|
@@ -434,10 +466,9 @@ function mapAnthropicStopReason(finishReason) {
|
|
|
434
466
|
|
|
435
467
|
// src/anthropic-messages-language-model.ts
|
|
436
468
|
var AnthropicMessagesLanguageModel = class {
|
|
437
|
-
constructor(modelId,
|
|
469
|
+
constructor(modelId, config) {
|
|
438
470
|
this.specificationVersion = "v2";
|
|
439
471
|
this.modelId = modelId;
|
|
440
|
-
this.settings = settings;
|
|
441
472
|
this.config = config;
|
|
442
473
|
}
|
|
443
474
|
supportsUrl(url) {
|
|
@@ -493,15 +524,15 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
493
524
|
details: "JSON response format is not supported."
|
|
494
525
|
});
|
|
495
526
|
}
|
|
496
|
-
const
|
|
497
|
-
prompt,
|
|
498
|
-
sendReasoning: (_a = this.settings.sendReasoning) != null ? _a : true,
|
|
499
|
-
warnings
|
|
500
|
-
});
|
|
501
|
-
const anthropicOptions = parseProviderOptions({
|
|
527
|
+
const anthropicOptions = await parseProviderOptions2({
|
|
502
528
|
provider: "anthropic",
|
|
503
529
|
providerOptions,
|
|
504
|
-
schema:
|
|
530
|
+
schema: anthropicProviderOptions
|
|
531
|
+
});
|
|
532
|
+
const { prompt: messagesPrompt, betas: messagesBetas } = await convertToAnthropicMessagesPrompt({
|
|
533
|
+
prompt,
|
|
534
|
+
sendReasoning: (_a = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _a : true,
|
|
535
|
+
warnings
|
|
505
536
|
});
|
|
506
537
|
const isThinking = ((_b = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _b.type) === "enabled";
|
|
507
538
|
const thinkingBudget = (_c = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _c.budgetTokens;
|
|
@@ -616,21 +647,24 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
616
647
|
case "thinking": {
|
|
617
648
|
content.push({
|
|
618
649
|
type: "reasoning",
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
signature: part.signature
|
|
650
|
+
text: part.thinking,
|
|
651
|
+
providerMetadata: {
|
|
652
|
+
anthropic: {
|
|
653
|
+
signature: part.signature
|
|
654
|
+
}
|
|
655
|
+
}
|
|
626
656
|
});
|
|
627
657
|
break;
|
|
628
658
|
}
|
|
629
659
|
case "redacted_thinking": {
|
|
630
660
|
content.push({
|
|
631
661
|
type: "reasoning",
|
|
632
|
-
|
|
633
|
-
|
|
662
|
+
text: "",
|
|
663
|
+
providerMetadata: {
|
|
664
|
+
anthropic: {
|
|
665
|
+
redactedData: part.data
|
|
666
|
+
}
|
|
667
|
+
}
|
|
634
668
|
});
|
|
635
669
|
break;
|
|
636
670
|
}
|
|
@@ -719,9 +753,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
719
753
|
case "redacted_thinking": {
|
|
720
754
|
controller.enqueue({
|
|
721
755
|
type: "reasoning",
|
|
722
|
-
|
|
723
|
-
|
|
756
|
+
text: "",
|
|
757
|
+
providerMetadata: {
|
|
758
|
+
anthropic: {
|
|
759
|
+
redactedData: value.content_block.data
|
|
760
|
+
}
|
|
761
|
+
}
|
|
724
762
|
});
|
|
763
|
+
controller.enqueue({ type: "reasoning-part-finish" });
|
|
725
764
|
return;
|
|
726
765
|
}
|
|
727
766
|
case "tool_use": {
|
|
@@ -768,7 +807,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
768
807
|
case "thinking_delta": {
|
|
769
808
|
controller.enqueue({
|
|
770
809
|
type: "reasoning",
|
|
771
|
-
reasoningType: "text",
|
|
772
810
|
text: value.delta.thinking
|
|
773
811
|
});
|
|
774
812
|
return;
|
|
@@ -777,9 +815,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
777
815
|
if (blockType === "thinking") {
|
|
778
816
|
controller.enqueue({
|
|
779
817
|
type: "reasoning",
|
|
780
|
-
|
|
781
|
-
|
|
818
|
+
text: "",
|
|
819
|
+
providerMetadata: {
|
|
820
|
+
anthropic: {
|
|
821
|
+
signature: value.delta.signature
|
|
822
|
+
}
|
|
823
|
+
}
|
|
782
824
|
});
|
|
825
|
+
controller.enqueue({ type: "reasoning-part-finish" });
|
|
783
826
|
}
|
|
784
827
|
return;
|
|
785
828
|
}
|
|
@@ -850,135 +893,133 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
850
893
|
};
|
|
851
894
|
}
|
|
852
895
|
};
|
|
853
|
-
var anthropicMessagesResponseSchema =
|
|
854
|
-
type:
|
|
855
|
-
id:
|
|
856
|
-
model:
|
|
857
|
-
content:
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
type:
|
|
861
|
-
text:
|
|
896
|
+
var anthropicMessagesResponseSchema = z3.object({
|
|
897
|
+
type: z3.literal("message"),
|
|
898
|
+
id: z3.string().nullish(),
|
|
899
|
+
model: z3.string().nullish(),
|
|
900
|
+
content: z3.array(
|
|
901
|
+
z3.discriminatedUnion("type", [
|
|
902
|
+
z3.object({
|
|
903
|
+
type: z3.literal("text"),
|
|
904
|
+
text: z3.string()
|
|
862
905
|
}),
|
|
863
|
-
|
|
864
|
-
type:
|
|
865
|
-
thinking:
|
|
866
|
-
signature:
|
|
906
|
+
z3.object({
|
|
907
|
+
type: z3.literal("thinking"),
|
|
908
|
+
thinking: z3.string(),
|
|
909
|
+
signature: z3.string()
|
|
867
910
|
}),
|
|
868
|
-
|
|
869
|
-
type:
|
|
870
|
-
data:
|
|
911
|
+
z3.object({
|
|
912
|
+
type: z3.literal("redacted_thinking"),
|
|
913
|
+
data: z3.string()
|
|
871
914
|
}),
|
|
872
|
-
|
|
873
|
-
type:
|
|
874
|
-
id:
|
|
875
|
-
name:
|
|
876
|
-
input:
|
|
915
|
+
z3.object({
|
|
916
|
+
type: z3.literal("tool_use"),
|
|
917
|
+
id: z3.string(),
|
|
918
|
+
name: z3.string(),
|
|
919
|
+
input: z3.unknown()
|
|
877
920
|
})
|
|
878
921
|
])
|
|
879
922
|
),
|
|
880
|
-
stop_reason:
|
|
881
|
-
usage:
|
|
882
|
-
input_tokens:
|
|
883
|
-
output_tokens:
|
|
884
|
-
cache_creation_input_tokens:
|
|
885
|
-
cache_read_input_tokens:
|
|
923
|
+
stop_reason: z3.string().nullish(),
|
|
924
|
+
usage: z3.object({
|
|
925
|
+
input_tokens: z3.number(),
|
|
926
|
+
output_tokens: z3.number(),
|
|
927
|
+
cache_creation_input_tokens: z3.number().nullish(),
|
|
928
|
+
cache_read_input_tokens: z3.number().nullish()
|
|
886
929
|
})
|
|
887
930
|
});
|
|
888
|
-
var anthropicMessagesChunkSchema =
|
|
889
|
-
|
|
890
|
-
type:
|
|
891
|
-
message:
|
|
892
|
-
id:
|
|
893
|
-
model:
|
|
894
|
-
usage:
|
|
895
|
-
input_tokens:
|
|
896
|
-
output_tokens:
|
|
897
|
-
cache_creation_input_tokens:
|
|
898
|
-
cache_read_input_tokens:
|
|
931
|
+
var anthropicMessagesChunkSchema = z3.discriminatedUnion("type", [
|
|
932
|
+
z3.object({
|
|
933
|
+
type: z3.literal("message_start"),
|
|
934
|
+
message: z3.object({
|
|
935
|
+
id: z3.string().nullish(),
|
|
936
|
+
model: z3.string().nullish(),
|
|
937
|
+
usage: z3.object({
|
|
938
|
+
input_tokens: z3.number(),
|
|
939
|
+
output_tokens: z3.number(),
|
|
940
|
+
cache_creation_input_tokens: z3.number().nullish(),
|
|
941
|
+
cache_read_input_tokens: z3.number().nullish()
|
|
899
942
|
})
|
|
900
943
|
})
|
|
901
944
|
}),
|
|
902
|
-
|
|
903
|
-
type:
|
|
904
|
-
index:
|
|
905
|
-
content_block:
|
|
906
|
-
|
|
907
|
-
type:
|
|
908
|
-
text:
|
|
945
|
+
z3.object({
|
|
946
|
+
type: z3.literal("content_block_start"),
|
|
947
|
+
index: z3.number(),
|
|
948
|
+
content_block: z3.discriminatedUnion("type", [
|
|
949
|
+
z3.object({
|
|
950
|
+
type: z3.literal("text"),
|
|
951
|
+
text: z3.string()
|
|
909
952
|
}),
|
|
910
|
-
|
|
911
|
-
type:
|
|
912
|
-
thinking:
|
|
953
|
+
z3.object({
|
|
954
|
+
type: z3.literal("thinking"),
|
|
955
|
+
thinking: z3.string()
|
|
913
956
|
}),
|
|
914
|
-
|
|
915
|
-
type:
|
|
916
|
-
id:
|
|
917
|
-
name:
|
|
957
|
+
z3.object({
|
|
958
|
+
type: z3.literal("tool_use"),
|
|
959
|
+
id: z3.string(),
|
|
960
|
+
name: z3.string()
|
|
918
961
|
}),
|
|
919
|
-
|
|
920
|
-
type:
|
|
921
|
-
data:
|
|
962
|
+
z3.object({
|
|
963
|
+
type: z3.literal("redacted_thinking"),
|
|
964
|
+
data: z3.string()
|
|
922
965
|
})
|
|
923
966
|
])
|
|
924
967
|
}),
|
|
925
|
-
|
|
926
|
-
type:
|
|
927
|
-
index:
|
|
928
|
-
delta:
|
|
929
|
-
|
|
930
|
-
type:
|
|
931
|
-
partial_json:
|
|
968
|
+
z3.object({
|
|
969
|
+
type: z3.literal("content_block_delta"),
|
|
970
|
+
index: z3.number(),
|
|
971
|
+
delta: z3.discriminatedUnion("type", [
|
|
972
|
+
z3.object({
|
|
973
|
+
type: z3.literal("input_json_delta"),
|
|
974
|
+
partial_json: z3.string()
|
|
932
975
|
}),
|
|
933
|
-
|
|
934
|
-
type:
|
|
935
|
-
text:
|
|
976
|
+
z3.object({
|
|
977
|
+
type: z3.literal("text_delta"),
|
|
978
|
+
text: z3.string()
|
|
936
979
|
}),
|
|
937
|
-
|
|
938
|
-
type:
|
|
939
|
-
thinking:
|
|
980
|
+
z3.object({
|
|
981
|
+
type: z3.literal("thinking_delta"),
|
|
982
|
+
thinking: z3.string()
|
|
940
983
|
}),
|
|
941
|
-
|
|
942
|
-
type:
|
|
943
|
-
signature:
|
|
984
|
+
z3.object({
|
|
985
|
+
type: z3.literal("signature_delta"),
|
|
986
|
+
signature: z3.string()
|
|
944
987
|
})
|
|
945
988
|
])
|
|
946
989
|
}),
|
|
947
|
-
|
|
948
|
-
type:
|
|
949
|
-
index:
|
|
990
|
+
z3.object({
|
|
991
|
+
type: z3.literal("content_block_stop"),
|
|
992
|
+
index: z3.number()
|
|
950
993
|
}),
|
|
951
|
-
|
|
952
|
-
type:
|
|
953
|
-
error:
|
|
954
|
-
type:
|
|
955
|
-
message:
|
|
994
|
+
z3.object({
|
|
995
|
+
type: z3.literal("error"),
|
|
996
|
+
error: z3.object({
|
|
997
|
+
type: z3.string(),
|
|
998
|
+
message: z3.string()
|
|
956
999
|
})
|
|
957
1000
|
}),
|
|
958
|
-
|
|
959
|
-
type:
|
|
960
|
-
delta:
|
|
961
|
-
usage:
|
|
1001
|
+
z3.object({
|
|
1002
|
+
type: z3.literal("message_delta"),
|
|
1003
|
+
delta: z3.object({ stop_reason: z3.string().nullish() }),
|
|
1004
|
+
usage: z3.object({ output_tokens: z3.number() })
|
|
962
1005
|
}),
|
|
963
|
-
|
|
964
|
-
type:
|
|
1006
|
+
z3.object({
|
|
1007
|
+
type: z3.literal("message_stop")
|
|
965
1008
|
}),
|
|
966
|
-
|
|
967
|
-
type:
|
|
1009
|
+
z3.object({
|
|
1010
|
+
type: z3.literal("ping")
|
|
968
1011
|
})
|
|
969
1012
|
]);
|
|
970
|
-
var
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
budgetTokens: z2.number().optional()
|
|
974
|
-
}).optional()
|
|
1013
|
+
var anthropicReasoningMetadataSchema = z3.object({
|
|
1014
|
+
signature: z3.string().optional(),
|
|
1015
|
+
redactedData: z3.string().optional()
|
|
975
1016
|
});
|
|
976
1017
|
|
|
977
1018
|
// src/anthropic-tools.ts
|
|
978
|
-
import { z as
|
|
979
|
-
var Bash20241022Parameters =
|
|
980
|
-
command:
|
|
981
|
-
restart:
|
|
1019
|
+
import { z as z4 } from "zod";
|
|
1020
|
+
var Bash20241022Parameters = z4.object({
|
|
1021
|
+
command: z4.string(),
|
|
1022
|
+
restart: z4.boolean().optional()
|
|
982
1023
|
});
|
|
983
1024
|
function bashTool_20241022(options = {}) {
|
|
984
1025
|
return {
|
|
@@ -990,9 +1031,9 @@ function bashTool_20241022(options = {}) {
|
|
|
990
1031
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
991
1032
|
};
|
|
992
1033
|
}
|
|
993
|
-
var Bash20250124Parameters =
|
|
994
|
-
command:
|
|
995
|
-
restart:
|
|
1034
|
+
var Bash20250124Parameters = z4.object({
|
|
1035
|
+
command: z4.string(),
|
|
1036
|
+
restart: z4.boolean().optional()
|
|
996
1037
|
});
|
|
997
1038
|
function bashTool_20250124(options = {}) {
|
|
998
1039
|
return {
|
|
@@ -1004,14 +1045,14 @@ function bashTool_20250124(options = {}) {
|
|
|
1004
1045
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1005
1046
|
};
|
|
1006
1047
|
}
|
|
1007
|
-
var TextEditor20241022Parameters =
|
|
1008
|
-
command:
|
|
1009
|
-
path:
|
|
1010
|
-
file_text:
|
|
1011
|
-
insert_line:
|
|
1012
|
-
new_str:
|
|
1013
|
-
old_str:
|
|
1014
|
-
view_range:
|
|
1048
|
+
var TextEditor20241022Parameters = z4.object({
|
|
1049
|
+
command: z4.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
1050
|
+
path: z4.string(),
|
|
1051
|
+
file_text: z4.string().optional(),
|
|
1052
|
+
insert_line: z4.number().int().optional(),
|
|
1053
|
+
new_str: z4.string().optional(),
|
|
1054
|
+
old_str: z4.string().optional(),
|
|
1055
|
+
view_range: z4.array(z4.number().int()).optional()
|
|
1015
1056
|
});
|
|
1016
1057
|
function textEditorTool_20241022(options = {}) {
|
|
1017
1058
|
return {
|
|
@@ -1023,14 +1064,14 @@ function textEditorTool_20241022(options = {}) {
|
|
|
1023
1064
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1024
1065
|
};
|
|
1025
1066
|
}
|
|
1026
|
-
var TextEditor20250124Parameters =
|
|
1027
|
-
command:
|
|
1028
|
-
path:
|
|
1029
|
-
file_text:
|
|
1030
|
-
insert_line:
|
|
1031
|
-
new_str:
|
|
1032
|
-
old_str:
|
|
1033
|
-
view_range:
|
|
1067
|
+
var TextEditor20250124Parameters = z4.object({
|
|
1068
|
+
command: z4.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
1069
|
+
path: z4.string(),
|
|
1070
|
+
file_text: z4.string().optional(),
|
|
1071
|
+
insert_line: z4.number().int().optional(),
|
|
1072
|
+
new_str: z4.string().optional(),
|
|
1073
|
+
old_str: z4.string().optional(),
|
|
1074
|
+
view_range: z4.array(z4.number().int()).optional()
|
|
1034
1075
|
});
|
|
1035
1076
|
function textEditorTool_20250124(options = {}) {
|
|
1036
1077
|
return {
|
|
@@ -1042,8 +1083,8 @@ function textEditorTool_20250124(options = {}) {
|
|
|
1042
1083
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1043
1084
|
};
|
|
1044
1085
|
}
|
|
1045
|
-
var Computer20241022Parameters =
|
|
1046
|
-
action:
|
|
1086
|
+
var Computer20241022Parameters = z4.object({
|
|
1087
|
+
action: z4.enum([
|
|
1047
1088
|
"key",
|
|
1048
1089
|
"type",
|
|
1049
1090
|
"mouse_move",
|
|
@@ -1055,8 +1096,8 @@ var Computer20241022Parameters = z3.object({
|
|
|
1055
1096
|
"screenshot",
|
|
1056
1097
|
"cursor_position"
|
|
1057
1098
|
]),
|
|
1058
|
-
coordinate:
|
|
1059
|
-
text:
|
|
1099
|
+
coordinate: z4.array(z4.number().int()).optional(),
|
|
1100
|
+
text: z4.string().optional()
|
|
1060
1101
|
});
|
|
1061
1102
|
function computerTool_20241022(options) {
|
|
1062
1103
|
return {
|
|
@@ -1072,8 +1113,8 @@ function computerTool_20241022(options) {
|
|
|
1072
1113
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1073
1114
|
};
|
|
1074
1115
|
}
|
|
1075
|
-
var Computer20250124Parameters =
|
|
1076
|
-
action:
|
|
1116
|
+
var Computer20250124Parameters = z4.object({
|
|
1117
|
+
action: z4.enum([
|
|
1077
1118
|
"key",
|
|
1078
1119
|
"hold_key",
|
|
1079
1120
|
"type",
|
|
@@ -1091,12 +1132,12 @@ var Computer20250124Parameters = z3.object({
|
|
|
1091
1132
|
"wait",
|
|
1092
1133
|
"screenshot"
|
|
1093
1134
|
]),
|
|
1094
|
-
coordinate:
|
|
1095
|
-
duration:
|
|
1096
|
-
scroll_amount:
|
|
1097
|
-
scroll_direction:
|
|
1098
|
-
start_coordinate:
|
|
1099
|
-
text:
|
|
1135
|
+
coordinate: z4.tuple([z4.number().int(), z4.number().int()]).optional(),
|
|
1136
|
+
duration: z4.number().optional(),
|
|
1137
|
+
scroll_amount: z4.number().optional(),
|
|
1138
|
+
scroll_direction: z4.enum(["up", "down", "left", "right"]).optional(),
|
|
1139
|
+
start_coordinate: z4.tuple([z4.number().int(), z4.number().int()]).optional(),
|
|
1140
|
+
text: z4.string().optional()
|
|
1100
1141
|
});
|
|
1101
1142
|
function computerTool_20250124(options) {
|
|
1102
1143
|
return {
|