@ai-sdk/anthropic 2.0.0-alpha.1 → 2.0.0-alpha.10

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/dist/index.mjs CHANGED
@@ -3,18 +3,21 @@ import {
3
3
  NoSuchModelError
4
4
  } from "@ai-sdk/provider";
5
5
  import {
6
+ generateId as generateId2,
6
7
  loadApiKey,
7
8
  withoutTrailingSlash
8
9
  } from "@ai-sdk/provider-utils";
9
10
 
10
11
  // src/anthropic-messages-language-model.ts
11
12
  import {
13
+ APICallError,
12
14
  UnsupportedFunctionalityError as UnsupportedFunctionalityError3
13
15
  } from "@ai-sdk/provider";
14
16
  import {
15
17
  combineHeaders,
16
18
  createEventSourceResponseHandler,
17
19
  createJsonResponseHandler,
20
+ generateId,
18
21
  parseProviderOptions as parseProviderOptions2,
19
22
  postJsonToApi,
20
23
  resolve
@@ -38,6 +41,13 @@ var anthropicFailedResponseHandler = createJsonErrorResponseHandler({
38
41
 
39
42
  // src/anthropic-messages-options.ts
40
43
  import { z as z2 } from "zod";
44
+ var webSearchLocationSchema = z2.object({
45
+ type: z2.literal("approximate"),
46
+ city: z2.string().optional(),
47
+ region: z2.string().optional(),
48
+ country: z2.string(),
49
+ timezone: z2.string().optional()
50
+ });
41
51
  var anthropicProviderOptions = z2.object({
42
52
  /**
43
53
  Include reasoning content in requests sent to the model. Defaults to `true`.
@@ -48,6 +58,31 @@ var anthropicProviderOptions = z2.object({
48
58
  thinking: z2.object({
49
59
  type: z2.union([z2.literal("enabled"), z2.literal("disabled")]),
50
60
  budgetTokens: z2.number().optional()
61
+ }).optional(),
62
+ /**
63
+ * Web search tool configuration for Claude models that support it.
64
+ * When provided, automatically adds the web search tool to the request.
65
+ */
66
+ webSearch: z2.object({
67
+ /**
68
+ * Limit the number of searches per request (optional)
69
+ * Defaults to 5 if not specified
70
+ */
71
+ maxUses: z2.number().min(1).max(20).optional(),
72
+ /**
73
+ * Only include results from these domains (optional)
74
+ * Cannot be used with blockedDomains
75
+ */
76
+ allowedDomains: z2.array(z2.string()).optional(),
77
+ /**
78
+ * Never include results from these domains (optional)
79
+ * Cannot be used with allowedDomains
80
+ */
81
+ blockedDomains: z2.array(z2.string()).optional(),
82
+ /**
83
+ * Localize search results based on user location (optional)
84
+ */
85
+ userLocation: webSearchLocationSchema.optional()
51
86
  }).optional()
52
87
  });
53
88
 
@@ -55,6 +90,9 @@ var anthropicProviderOptions = z2.object({
55
90
  import {
56
91
  UnsupportedFunctionalityError
57
92
  } from "@ai-sdk/provider";
93
+ function isWebSearchTool(tool) {
94
+ return typeof tool === "object" && tool !== null && "type" in tool && tool.type === "web_search_20250305";
95
+ }
58
96
  function prepareTools({
59
97
  tools,
60
98
  toolChoice
@@ -67,6 +105,10 @@ function prepareTools({
67
105
  }
68
106
  const anthropicTools2 = [];
69
107
  for (const tool of tools) {
108
+ if (isWebSearchTool(tool)) {
109
+ anthropicTools2.push(tool);
110
+ continue;
111
+ }
70
112
  switch (tool.type) {
71
113
  case "function":
72
114
  anthropicTools2.push({
@@ -459,13 +501,16 @@ function groupIntoBlocks(prompt) {
459
501
  }
460
502
 
461
503
  // src/map-anthropic-stop-reason.ts
462
- function mapAnthropicStopReason(finishReason) {
504
+ function mapAnthropicStopReason({
505
+ finishReason,
506
+ isJsonResponseFromTool
507
+ }) {
463
508
  switch (finishReason) {
464
509
  case "end_turn":
465
510
  case "stop_sequence":
466
511
  return "stop";
467
512
  case "tool_use":
468
- return "tool-calls";
513
+ return isJsonResponseFromTool ? "stop" : "tool-calls";
469
514
  case "max_tokens":
470
515
  return "length";
471
516
  default:
@@ -477,8 +522,10 @@ function mapAnthropicStopReason(finishReason) {
477
522
  var AnthropicMessagesLanguageModel = class {
478
523
  constructor(modelId, config) {
479
524
  this.specificationVersion = "v2";
525
+ var _a;
480
526
  this.modelId = modelId;
481
527
  this.config = config;
528
+ this.generateId = (_a = config.generateId) != null ? _a : generateId;
482
529
  }
483
530
  supportsUrl(url) {
484
531
  return url.protocol === "https:";
@@ -526,13 +573,27 @@ var AnthropicMessagesLanguageModel = class {
526
573
  setting: "seed"
527
574
  });
528
575
  }
529
- if (responseFormat != null && responseFormat.type !== "text") {
530
- warnings.push({
531
- type: "unsupported-setting",
532
- setting: "responseFormat",
533
- details: "JSON response format is not supported."
534
- });
576
+ if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
577
+ if (responseFormat.schema == null) {
578
+ warnings.push({
579
+ type: "unsupported-setting",
580
+ setting: "responseFormat",
581
+ details: "JSON response format requires a schema. The response format is ignored."
582
+ });
583
+ } else if (tools != null) {
584
+ warnings.push({
585
+ type: "unsupported-setting",
586
+ setting: "tools",
587
+ details: "JSON response format does not support tools. The provided tools are ignored."
588
+ });
589
+ }
535
590
  }
591
+ const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null ? {
592
+ type: "function",
593
+ name: "json",
594
+ description: "Respond with a JSON object.",
595
+ parameters: responseFormat.schema
596
+ } : void 0;
536
597
  const anthropicOptions = await parseProviderOptions2({
537
598
  provider: "anthropic",
538
599
  providerOptions,
@@ -594,12 +655,38 @@ var AnthropicMessagesLanguageModel = class {
594
655
  }
595
656
  baseArgs.max_tokens = maxOutputTokens + thinkingBudget;
596
657
  }
658
+ let modifiedTools = tools;
659
+ let modifiedToolChoice = toolChoice;
660
+ if (anthropicOptions == null ? void 0 : anthropicOptions.webSearch) {
661
+ const webSearchTool = {
662
+ type: "web_search_20250305",
663
+ name: "web_search",
664
+ max_uses: anthropicOptions.webSearch.maxUses,
665
+ allowed_domains: anthropicOptions.webSearch.allowedDomains,
666
+ blocked_domains: anthropicOptions.webSearch.blockedDomains,
667
+ ...anthropicOptions.webSearch.userLocation && {
668
+ user_location: {
669
+ type: anthropicOptions.webSearch.userLocation.type,
670
+ country: anthropicOptions.webSearch.userLocation.country,
671
+ city: anthropicOptions.webSearch.userLocation.city,
672
+ region: anthropicOptions.webSearch.userLocation.region,
673
+ timezone: anthropicOptions.webSearch.userLocation.timezone
674
+ }
675
+ }
676
+ };
677
+ modifiedTools = tools ? [...tools, webSearchTool] : [webSearchTool];
678
+ }
597
679
  const {
598
680
  tools: anthropicTools2,
599
681
  toolChoice: anthropicToolChoice,
600
682
  toolWarnings,
601
683
  betas: toolsBetas
602
- } = prepareTools({ tools, toolChoice });
684
+ } = prepareTools(
685
+ jsonResponseTool != null ? {
686
+ tools: [jsonResponseTool],
687
+ toolChoice: { type: "tool", toolName: jsonResponseTool.name }
688
+ } : { tools: modifiedTools, toolChoice: modifiedToolChoice }
689
+ );
603
690
  return {
604
691
  args: {
605
692
  ...baseArgs,
@@ -607,7 +694,8 @@ var AnthropicMessagesLanguageModel = class {
607
694
  tool_choice: anthropicToolChoice
608
695
  },
609
696
  warnings: [...warnings, ...toolWarnings],
610
- betas: /* @__PURE__ */ new Set([...messagesBetas, ...toolsBetas])
697
+ betas: /* @__PURE__ */ new Set([...messagesBetas, ...toolsBetas]),
698
+ jsonResponseTool
611
699
  };
612
700
  }
613
701
  async getHeaders({
@@ -629,8 +717,8 @@ var AnthropicMessagesLanguageModel = class {
629
717
  return (_c = (_b = (_a = this.config).transformRequestBody) == null ? void 0 : _b.call(_a, args)) != null ? _c : args;
630
718
  }
631
719
  async doGenerate(options) {
632
- var _a, _b, _c, _d;
633
- const { args, warnings, betas } = await this.getArgs(options);
720
+ var _a, _b, _c, _d, _e;
721
+ const { args, warnings, betas, jsonResponseTool } = await this.getArgs(options);
634
722
  const {
635
723
  responseHeaders,
636
724
  value: response,
@@ -650,7 +738,9 @@ var AnthropicMessagesLanguageModel = class {
650
738
  for (const part of response.content) {
651
739
  switch (part.type) {
652
740
  case "text": {
653
- content.push({ type: "text", text: part.text });
741
+ if (jsonResponseTool == null) {
742
+ content.push({ type: "text", text: part.text });
743
+ }
654
744
  break;
655
745
  }
656
746
  case "thinking": {
@@ -678,43 +768,84 @@ var AnthropicMessagesLanguageModel = class {
678
768
  break;
679
769
  }
680
770
  case "tool_use": {
681
- content.push({
682
- type: "tool-call",
683
- toolCallType: "function",
684
- toolCallId: part.id,
685
- toolName: part.name,
686
- args: JSON.stringify(part.input)
687
- });
771
+ content.push(
772
+ // when a json response tool is used, the tool call becomes the text:
773
+ jsonResponseTool != null ? {
774
+ type: "text",
775
+ text: JSON.stringify(part.input)
776
+ } : {
777
+ type: "tool-call",
778
+ toolCallType: "function",
779
+ toolCallId: part.id,
780
+ toolName: part.name,
781
+ args: JSON.stringify(part.input)
782
+ }
783
+ );
784
+ break;
785
+ }
786
+ case "server_tool_use": {
787
+ continue;
788
+ }
789
+ case "web_search_tool_result": {
790
+ if (Array.isArray(part.content)) {
791
+ for (const result of part.content) {
792
+ if (result.type === "web_search_result") {
793
+ content.push({
794
+ type: "source",
795
+ sourceType: "url",
796
+ id: this.generateId(),
797
+ url: result.url,
798
+ title: result.title,
799
+ providerMetadata: {
800
+ anthropic: {
801
+ encryptedContent: result.encrypted_content,
802
+ pageAge: (_a = result.page_age) != null ? _a : null
803
+ }
804
+ }
805
+ });
806
+ }
807
+ }
808
+ } else if (part.content.type === "web_search_tool_result_error") {
809
+ throw new APICallError({
810
+ message: `Web search failed: ${part.content.error_code}`,
811
+ url: "web_search_api",
812
+ requestBodyValues: { tool_use_id: part.tool_use_id },
813
+ data: { error_code: part.content.error_code }
814
+ });
815
+ }
688
816
  break;
689
817
  }
690
818
  }
691
819
  }
692
820
  return {
693
821
  content,
694
- finishReason: mapAnthropicStopReason(response.stop_reason),
822
+ finishReason: mapAnthropicStopReason({
823
+ finishReason: response.stop_reason,
824
+ isJsonResponseFromTool: jsonResponseTool != null
825
+ }),
695
826
  usage: {
696
827
  inputTokens: response.usage.input_tokens,
697
828
  outputTokens: response.usage.output_tokens,
698
829
  totalTokens: response.usage.input_tokens + response.usage.output_tokens,
699
- cachedInputTokens: (_a = response.usage.cache_read_input_tokens) != null ? _a : void 0
830
+ cachedInputTokens: (_b = response.usage.cache_read_input_tokens) != null ? _b : void 0
700
831
  },
701
832
  request: { body: args },
702
833
  response: {
703
- id: (_b = response.id) != null ? _b : void 0,
704
- modelId: (_c = response.model) != null ? _c : void 0,
834
+ id: (_c = response.id) != null ? _c : void 0,
835
+ modelId: (_d = response.model) != null ? _d : void 0,
705
836
  headers: responseHeaders,
706
837
  body: rawResponse
707
838
  },
708
839
  warnings,
709
840
  providerMetadata: {
710
841
  anthropic: {
711
- cacheCreationInputTokens: (_d = response.usage.cache_creation_input_tokens) != null ? _d : null
842
+ cacheCreationInputTokens: (_e = response.usage.cache_creation_input_tokens) != null ? _e : null
712
843
  }
713
844
  }
714
845
  };
715
846
  }
716
847
  async doStream(options) {
717
- const { args, warnings, betas } = await this.getArgs(options);
848
+ const { args, warnings, betas, jsonResponseTool } = await this.getArgs(options);
718
849
  const body = { ...args, stream: true };
719
850
  const { responseHeaders, value: response } = await postJsonToApi({
720
851
  url: this.buildRequestUrl(true),
@@ -736,6 +867,8 @@ var AnthropicMessagesLanguageModel = class {
736
867
  const toolCallContentBlocks = {};
737
868
  let providerMetadata = void 0;
738
869
  let blockType = void 0;
870
+ const config = this.config;
871
+ const generateId3 = this.generateId;
739
872
  return {
740
873
  stream: response.pipeThrough(
741
874
  new TransformStream({
@@ -743,7 +876,7 @@ var AnthropicMessagesLanguageModel = class {
743
876
  controller.enqueue({ type: "stream-start", warnings });
744
877
  },
745
878
  transform(chunk, controller) {
746
- var _a, _b, _c, _d, _e, _f;
879
+ var _a, _b, _c, _d, _e, _f, _g;
747
880
  if (!chunk.success) {
748
881
  controller.enqueue({ type: "error", error: chunk.error });
749
882
  return;
@@ -782,6 +915,40 @@ var AnthropicMessagesLanguageModel = class {
782
915
  };
783
916
  return;
784
917
  }
918
+ case "server_tool_use": {
919
+ return;
920
+ }
921
+ case "web_search_tool_result": {
922
+ if (Array.isArray(value.content_block.content)) {
923
+ for (const result of value.content_block.content) {
924
+ if (result.type === "web_search_result") {
925
+ controller.enqueue({
926
+ type: "source",
927
+ sourceType: "url",
928
+ id: generateId3(),
929
+ url: result.url,
930
+ title: result.title,
931
+ providerMetadata: {
932
+ anthropic: {
933
+ encryptedContent: result.encrypted_content,
934
+ pageAge: (_a = result.page_age) != null ? _a : null
935
+ }
936
+ }
937
+ });
938
+ }
939
+ }
940
+ } else if (value.content_block.content.type === "web_search_tool_result_error") {
941
+ controller.enqueue({
942
+ type: "error",
943
+ error: {
944
+ type: "web-search-error",
945
+ message: `Web search failed: ${value.content_block.content.error_code}`,
946
+ code: value.content_block.content.error_code
947
+ }
948
+ });
949
+ }
950
+ return;
951
+ }
785
952
  default: {
786
953
  const _exhaustiveCheck = contentBlockType;
787
954
  throw new Error(
@@ -793,13 +960,15 @@ var AnthropicMessagesLanguageModel = class {
793
960
  case "content_block_stop": {
794
961
  if (toolCallContentBlocks[value.index] != null) {
795
962
  const contentBlock = toolCallContentBlocks[value.index];
796
- controller.enqueue({
797
- type: "tool-call",
798
- toolCallType: "function",
799
- toolCallId: contentBlock.toolCallId,
800
- toolName: contentBlock.toolName,
801
- args: contentBlock.jsonText
802
- });
963
+ if (jsonResponseTool == null) {
964
+ controller.enqueue({
965
+ type: "tool-call",
966
+ toolCallType: "function",
967
+ toolCallId: contentBlock.toolCallId,
968
+ toolName: contentBlock.toolName,
969
+ args: contentBlock.jsonText
970
+ });
971
+ }
803
972
  delete toolCallContentBlocks[value.index];
804
973
  }
805
974
  blockType = void 0;
@@ -809,6 +978,9 @@ var AnthropicMessagesLanguageModel = class {
809
978
  const deltaType = value.delta.type;
810
979
  switch (deltaType) {
811
980
  case "text_delta": {
981
+ if (jsonResponseTool != null) {
982
+ return;
983
+ }
812
984
  controller.enqueue({
813
985
  type: "text",
814
986
  text: value.delta.text
@@ -839,16 +1011,27 @@ var AnthropicMessagesLanguageModel = class {
839
1011
  }
840
1012
  case "input_json_delta": {
841
1013
  const contentBlock = toolCallContentBlocks[value.index];
842
- controller.enqueue({
843
- type: "tool-call-delta",
844
- toolCallType: "function",
845
- toolCallId: contentBlock.toolCallId,
846
- toolName: contentBlock.toolName,
847
- argsTextDelta: value.delta.partial_json
848
- });
1014
+ if (!contentBlock) {
1015
+ return;
1016
+ }
1017
+ controller.enqueue(
1018
+ jsonResponseTool != null ? {
1019
+ type: "text",
1020
+ text: value.delta.partial_json
1021
+ } : {
1022
+ type: "tool-call-delta",
1023
+ toolCallType: "function",
1024
+ toolCallId: contentBlock.toolCallId,
1025
+ toolName: contentBlock.toolName,
1026
+ argsTextDelta: value.delta.partial_json
1027
+ }
1028
+ );
849
1029
  contentBlock.jsonText += value.delta.partial_json;
850
1030
  return;
851
1031
  }
1032
+ case "citations_delta": {
1033
+ return;
1034
+ }
852
1035
  default: {
853
1036
  const _exhaustiveCheck = deltaType;
854
1037
  throw new Error(
@@ -859,23 +1042,26 @@ var AnthropicMessagesLanguageModel = class {
859
1042
  }
860
1043
  case "message_start": {
861
1044
  usage.inputTokens = value.message.usage.input_tokens;
862
- usage.cachedInputTokens = (_a = value.message.usage.cache_read_input_tokens) != null ? _a : void 0;
1045
+ usage.cachedInputTokens = (_b = value.message.usage.cache_read_input_tokens) != null ? _b : void 0;
863
1046
  providerMetadata = {
864
1047
  anthropic: {
865
- cacheCreationInputTokens: (_b = value.message.usage.cache_creation_input_tokens) != null ? _b : null
1048
+ cacheCreationInputTokens: (_c = value.message.usage.cache_creation_input_tokens) != null ? _c : null
866
1049
  }
867
1050
  };
868
1051
  controller.enqueue({
869
1052
  type: "response-metadata",
870
- id: (_c = value.message.id) != null ? _c : void 0,
871
- modelId: (_d = value.message.model) != null ? _d : void 0
1053
+ id: (_d = value.message.id) != null ? _d : void 0,
1054
+ modelId: (_e = value.message.model) != null ? _e : void 0
872
1055
  });
873
1056
  return;
874
1057
  }
875
1058
  case "message_delta": {
876
1059
  usage.outputTokens = value.usage.output_tokens;
877
- usage.totalTokens = ((_e = usage.inputTokens) != null ? _e : 0) + ((_f = value.usage.output_tokens) != null ? _f : 0);
878
- finishReason = mapAnthropicStopReason(value.delta.stop_reason);
1060
+ usage.totalTokens = ((_f = usage.inputTokens) != null ? _f : 0) + ((_g = value.usage.output_tokens) != null ? _g : 0);
1061
+ finishReason = mapAnthropicStopReason({
1062
+ finishReason: value.delta.stop_reason,
1063
+ isJsonResponseFromTool: jsonResponseTool != null
1064
+ });
879
1065
  return;
880
1066
  }
881
1067
  case "message_stop": {
@@ -928,6 +1114,31 @@ var anthropicMessagesResponseSchema = z3.object({
928
1114
  id: z3.string(),
929
1115
  name: z3.string(),
930
1116
  input: z3.unknown()
1117
+ }),
1118
+ z3.object({
1119
+ type: z3.literal("server_tool_use"),
1120
+ id: z3.string(),
1121
+ name: z3.string(),
1122
+ input: z3.record(z3.unknown()).nullish()
1123
+ }),
1124
+ z3.object({
1125
+ type: z3.literal("web_search_tool_result"),
1126
+ tool_use_id: z3.string(),
1127
+ content: z3.union([
1128
+ z3.array(
1129
+ z3.object({
1130
+ type: z3.literal("web_search_result"),
1131
+ url: z3.string(),
1132
+ title: z3.string(),
1133
+ encrypted_content: z3.string(),
1134
+ page_age: z3.string().nullish()
1135
+ })
1136
+ ),
1137
+ z3.object({
1138
+ type: z3.literal("web_search_tool_result_error"),
1139
+ error_code: z3.string()
1140
+ })
1141
+ ])
931
1142
  })
932
1143
  ])
933
1144
  ),
@@ -936,7 +1147,10 @@ var anthropicMessagesResponseSchema = z3.object({
936
1147
  input_tokens: z3.number(),
937
1148
  output_tokens: z3.number(),
938
1149
  cache_creation_input_tokens: z3.number().nullish(),
939
- cache_read_input_tokens: z3.number().nullish()
1150
+ cache_read_input_tokens: z3.number().nullish(),
1151
+ server_tool_use: z3.object({
1152
+ web_search_requests: z3.number()
1153
+ }).nullish()
940
1154
  })
941
1155
  });
942
1156
  var anthropicMessagesChunkSchema = z3.discriminatedUnion("type", [
@@ -973,6 +1187,31 @@ var anthropicMessagesChunkSchema = z3.discriminatedUnion("type", [
973
1187
  z3.object({
974
1188
  type: z3.literal("redacted_thinking"),
975
1189
  data: z3.string()
1190
+ }),
1191
+ z3.object({
1192
+ type: z3.literal("server_tool_use"),
1193
+ id: z3.string(),
1194
+ name: z3.string(),
1195
+ input: z3.record(z3.unknown()).nullish()
1196
+ }),
1197
+ z3.object({
1198
+ type: z3.literal("web_search_tool_result"),
1199
+ tool_use_id: z3.string(),
1200
+ content: z3.union([
1201
+ z3.array(
1202
+ z3.object({
1203
+ type: z3.literal("web_search_result"),
1204
+ url: z3.string(),
1205
+ title: z3.string(),
1206
+ encrypted_content: z3.string(),
1207
+ page_age: z3.string().nullish()
1208
+ })
1209
+ ),
1210
+ z3.object({
1211
+ type: z3.literal("web_search_tool_result_error"),
1212
+ error_code: z3.string()
1213
+ })
1214
+ ])
976
1215
  })
977
1216
  ])
978
1217
  }),
@@ -995,6 +1234,16 @@ var anthropicMessagesChunkSchema = z3.discriminatedUnion("type", [
995
1234
  z3.object({
996
1235
  type: z3.literal("signature_delta"),
997
1236
  signature: z3.string()
1237
+ }),
1238
+ z3.object({
1239
+ type: z3.literal("citations_delta"),
1240
+ citation: z3.object({
1241
+ type: z3.literal("web_search_result_location"),
1242
+ cited_text: z3.string(),
1243
+ url: z3.string(),
1244
+ title: z3.string(),
1245
+ encrypted_index: z3.string()
1246
+ })
998
1247
  })
999
1248
  ])
1000
1249
  }),
@@ -1186,15 +1435,19 @@ function createAnthropic(options = {}) {
1186
1435
  }),
1187
1436
  ...options.headers
1188
1437
  });
1189
- const createChatModel = (modelId) => new AnthropicMessagesLanguageModel(modelId, {
1190
- provider: "anthropic.messages",
1191
- baseURL,
1192
- headers: getHeaders,
1193
- fetch: options.fetch,
1194
- supportedUrls: () => ({
1195
- "image/*": [/^https?:\/\/.*$/]
1196
- })
1197
- });
1438
+ const createChatModel = (modelId) => {
1439
+ var _a2;
1440
+ return new AnthropicMessagesLanguageModel(modelId, {
1441
+ provider: "anthropic.messages",
1442
+ baseURL,
1443
+ headers: getHeaders,
1444
+ fetch: options.fetch,
1445
+ generateId: (_a2 = options.generateId) != null ? _a2 : generateId2,
1446
+ supportedUrls: () => ({
1447
+ "image/*": [/^https?:\/\/.*$/]
1448
+ })
1449
+ });
1450
+ };
1198
1451
  const provider = function(modelId) {
1199
1452
  if (new.target) {
1200
1453
  throw new Error(