@friendliai/ai-provider 0.3.2 → 1.0.0-beta.0

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @friendliai/ai-provider
2
2
 
3
+ ## 1.0.0-beta.0
4
+
5
+ ### Major Changes
6
+
7
+ - 3044ef8: Entering the AI ​​SDK v6 compatible migration
8
+
3
9
  ## 0.3.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,11 +1,32 @@
1
+ import { z } from 'zod/v4';
1
2
  import { LanguageModelV2ProviderDefinedTool, ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider';
2
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
- import { z } from 'zod';
4
+
5
+ declare const friendliaiErrorSchema: z.ZodObject<{
6
+ message: z.ZodString;
7
+ error: z.ZodRecord<z.ZodString, z.ZodAny>;
8
+ }, z.core.$strip>;
9
+ type FriendliAIErrorData = z.infer<typeof friendliaiErrorSchema>;
4
10
 
5
11
  declare const FriendliAIServerlessModelIds: readonly ["LGAI-EXAONE/EXAONE-4.0.1-32B", "skt/A.X-4.0", "skt/A.X-3.1", "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", "deepseek-ai/DeepSeek-R1-0528", "meta-llama/Llama-4-Maverick-17B-128E-Instruct", "meta-llama/Llama-4-Scout-17B-16E-Instruct", "meta-llama/Llama-3.3-70B-Instruct", "meta-llama-3.3-70b-instruct", "meta-llama/Llama-3.1-8B-Instruct", "meta-llama-3.1-8b-instruct", "Qwen/Qwen3-235B-A22B-Thinking-2507", "Qwen/Qwen3-235B-A22B-Instruct-2507", "Qwen/Qwen3-30B-A3B", "Qwen/Qwen3-32B", "google/gemma-3-27b-it", "mistralai/Mistral-Small-3.1-24B-Instruct-2503", "mistralai/Devstral-Small-2505", "mistralai/Magistral-Small-2506"];
6
12
  type FriendliAIServerlessModelId = (typeof FriendliAIServerlessModelIds)[number];
7
13
  type FriendliAILanguageModelId = FriendliAIServerlessModelId | (string & {});
8
14
 
15
+ declare function webUrlBetaTool(): LanguageModelV2ProviderDefinedTool;
16
+ declare function webSearchBetaTool(): LanguageModelV2ProviderDefinedTool;
17
+ declare function mathCalendarBetaTool(): LanguageModelV2ProviderDefinedTool;
18
+ declare function mathStatisticsBetaTool(): LanguageModelV2ProviderDefinedTool;
19
+ declare function mathCalculatorBetaTool(): LanguageModelV2ProviderDefinedTool;
20
+ declare function codePythonInterpreterBetaTool(): LanguageModelV2ProviderDefinedTool;
21
+ declare const friendliTools: {
22
+ webSearchBetaTool: typeof webSearchBetaTool;
23
+ webUrlBetaTool: typeof webUrlBetaTool;
24
+ mathCalendarBetaTool: typeof mathCalendarBetaTool;
25
+ mathStatisticsBetaTool: typeof mathStatisticsBetaTool;
26
+ mathCalculatorBetaTool: typeof mathCalculatorBetaTool;
27
+ codePythonInterpreterBetaTool: typeof codePythonInterpreterBetaTool;
28
+ };
29
+
9
30
  type Pricing = {
10
31
  inputToken?: number;
11
32
  outputToken?: number;
@@ -27,21 +48,6 @@ type FriendliAvailableModelsResponse = {
27
48
  models: FriendliAvailableModel[];
28
49
  };
29
50
 
30
- declare function webUrlBetaTool(): LanguageModelV2ProviderDefinedTool;
31
- declare function webSearchBetaTool(): LanguageModelV2ProviderDefinedTool;
32
- declare function mathCalendarBetaTool(): LanguageModelV2ProviderDefinedTool;
33
- declare function mathStatisticsBetaTool(): LanguageModelV2ProviderDefinedTool;
34
- declare function mathCalculatorBetaTool(): LanguageModelV2ProviderDefinedTool;
35
- declare function codePythonInterpreterBetaTool(): LanguageModelV2ProviderDefinedTool;
36
- declare const friendliTools: {
37
- webSearchBetaTool: typeof webSearchBetaTool;
38
- webUrlBetaTool: typeof webUrlBetaTool;
39
- mathCalendarBetaTool: typeof mathCalendarBetaTool;
40
- mathStatisticsBetaTool: typeof mathStatisticsBetaTool;
41
- mathCalculatorBetaTool: typeof mathCalculatorBetaTool;
42
- codePythonInterpreterBetaTool: typeof codePythonInterpreterBetaTool;
43
- };
44
-
45
51
  interface FriendliAIProviderSettings {
46
52
  /**
47
53
  * FriendliAI API key. (FRIENDLI_TOKEN)
@@ -125,10 +131,4 @@ declare function createFriendli(options?: FriendliAIProviderSettings): FriendliA
125
131
  */
126
132
  declare const friendli: FriendliAIProvider;
127
133
 
128
- declare const friendliaiErrorSchema: z.ZodObject<{
129
- message: z.ZodString;
130
- error: z.ZodRecord<z.ZodString, z.ZodAny>;
131
- }, z.core.$strip>;
132
- type FriendliAIErrorData = z.infer<typeof friendliaiErrorSchema>;
133
-
134
134
  export { type FriendliAIErrorData, type FriendliAIProvider, type FriendliAIProviderSettings, type FriendliAvailableModel, type FriendliAvailableModelsResponse, createFriendli, friendli };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,32 @@
1
+ import { z } from 'zod/v4';
1
2
  import { LanguageModelV2ProviderDefinedTool, ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider';
2
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
- import { z } from 'zod';
4
+
5
+ declare const friendliaiErrorSchema: z.ZodObject<{
6
+ message: z.ZodString;
7
+ error: z.ZodRecord<z.ZodString, z.ZodAny>;
8
+ }, z.core.$strip>;
9
+ type FriendliAIErrorData = z.infer<typeof friendliaiErrorSchema>;
4
10
 
5
11
  declare const FriendliAIServerlessModelIds: readonly ["LGAI-EXAONE/EXAONE-4.0.1-32B", "skt/A.X-4.0", "skt/A.X-3.1", "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", "deepseek-ai/DeepSeek-R1-0528", "meta-llama/Llama-4-Maverick-17B-128E-Instruct", "meta-llama/Llama-4-Scout-17B-16E-Instruct", "meta-llama/Llama-3.3-70B-Instruct", "meta-llama-3.3-70b-instruct", "meta-llama/Llama-3.1-8B-Instruct", "meta-llama-3.1-8b-instruct", "Qwen/Qwen3-235B-A22B-Thinking-2507", "Qwen/Qwen3-235B-A22B-Instruct-2507", "Qwen/Qwen3-30B-A3B", "Qwen/Qwen3-32B", "google/gemma-3-27b-it", "mistralai/Mistral-Small-3.1-24B-Instruct-2503", "mistralai/Devstral-Small-2505", "mistralai/Magistral-Small-2506"];
6
12
  type FriendliAIServerlessModelId = (typeof FriendliAIServerlessModelIds)[number];
7
13
  type FriendliAILanguageModelId = FriendliAIServerlessModelId | (string & {});
8
14
 
15
+ declare function webUrlBetaTool(): LanguageModelV2ProviderDefinedTool;
16
+ declare function webSearchBetaTool(): LanguageModelV2ProviderDefinedTool;
17
+ declare function mathCalendarBetaTool(): LanguageModelV2ProviderDefinedTool;
18
+ declare function mathStatisticsBetaTool(): LanguageModelV2ProviderDefinedTool;
19
+ declare function mathCalculatorBetaTool(): LanguageModelV2ProviderDefinedTool;
20
+ declare function codePythonInterpreterBetaTool(): LanguageModelV2ProviderDefinedTool;
21
+ declare const friendliTools: {
22
+ webSearchBetaTool: typeof webSearchBetaTool;
23
+ webUrlBetaTool: typeof webUrlBetaTool;
24
+ mathCalendarBetaTool: typeof mathCalendarBetaTool;
25
+ mathStatisticsBetaTool: typeof mathStatisticsBetaTool;
26
+ mathCalculatorBetaTool: typeof mathCalculatorBetaTool;
27
+ codePythonInterpreterBetaTool: typeof codePythonInterpreterBetaTool;
28
+ };
29
+
9
30
  type Pricing = {
10
31
  inputToken?: number;
11
32
  outputToken?: number;
@@ -27,21 +48,6 @@ type FriendliAvailableModelsResponse = {
27
48
  models: FriendliAvailableModel[];
28
49
  };
29
50
 
30
- declare function webUrlBetaTool(): LanguageModelV2ProviderDefinedTool;
31
- declare function webSearchBetaTool(): LanguageModelV2ProviderDefinedTool;
32
- declare function mathCalendarBetaTool(): LanguageModelV2ProviderDefinedTool;
33
- declare function mathStatisticsBetaTool(): LanguageModelV2ProviderDefinedTool;
34
- declare function mathCalculatorBetaTool(): LanguageModelV2ProviderDefinedTool;
35
- declare function codePythonInterpreterBetaTool(): LanguageModelV2ProviderDefinedTool;
36
- declare const friendliTools: {
37
- webSearchBetaTool: typeof webSearchBetaTool;
38
- webUrlBetaTool: typeof webUrlBetaTool;
39
- mathCalendarBetaTool: typeof mathCalendarBetaTool;
40
- mathStatisticsBetaTool: typeof mathStatisticsBetaTool;
41
- mathCalculatorBetaTool: typeof mathCalculatorBetaTool;
42
- codePythonInterpreterBetaTool: typeof codePythonInterpreterBetaTool;
43
- };
44
-
45
51
  interface FriendliAIProviderSettings {
46
52
  /**
47
53
  * FriendliAI API key. (FRIENDLI_TOKEN)
@@ -125,10 +131,4 @@ declare function createFriendli(options?: FriendliAIProviderSettings): FriendliA
125
131
  */
126
132
  declare const friendli: FriendliAIProvider;
127
133
 
128
- declare const friendliaiErrorSchema: z.ZodObject<{
129
- message: z.ZodString;
130
- error: z.ZodRecord<z.ZodString, z.ZodAny>;
131
- }, z.core.$strip>;
132
- type FriendliAIErrorData = z.infer<typeof friendliaiErrorSchema>;
133
-
134
134
  export { type FriendliAIErrorData, type FriendliAIProvider, type FriendliAIProviderSettings, type FriendliAvailableModel, type FriendliAvailableModelsResponse, createFriendli, friendli };
package/dist/index.js CHANGED
@@ -26,45 +26,22 @@ __export(index_exports, {
26
26
  module.exports = __toCommonJS(index_exports);
27
27
 
28
28
  // src/friendli-provider.ts
29
+ var import_openai_compatible = require("@ai-sdk/openai-compatible");
29
30
  var import_provider3 = require("@ai-sdk/provider");
30
31
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
31
- var import_openai_compatible = require("@ai-sdk/openai-compatible");
32
-
33
- // src/friendli-settings.ts
34
- var FriendliAIServerlessModelIds = [
35
- "LGAI-EXAONE/EXAONE-4.0.1-32B",
36
- "skt/A.X-4.0",
37
- "skt/A.X-3.1",
38
- "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B",
39
- "deepseek-ai/DeepSeek-R1-0528",
40
- "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
41
- "meta-llama/Llama-4-Scout-17B-16E-Instruct",
42
- "meta-llama/Llama-3.3-70B-Instruct",
43
- "meta-llama-3.3-70b-instruct",
44
- "meta-llama/Llama-3.1-8B-Instruct",
45
- "meta-llama-3.1-8b-instruct",
46
- "Qwen/Qwen3-235B-A22B-Thinking-2507",
47
- "Qwen/Qwen3-235B-A22B-Instruct-2507",
48
- "Qwen/Qwen3-30B-A3B",
49
- "Qwen/Qwen3-32B",
50
- "google/gemma-3-27b-it",
51
- "mistralai/Mistral-Small-3.1-24B-Instruct-2503",
52
- "mistralai/Devstral-Small-2505",
53
- "mistralai/Magistral-Small-2506"
54
- ];
55
32
 
56
33
  // src/friendli-chat-language-model.ts
34
+ var import_internal = require("@ai-sdk/openai-compatible/internal");
57
35
  var import_provider2 = require("@ai-sdk/provider");
58
36
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
59
- var import_internal = require("@ai-sdk/openai-compatible/internal");
60
- var import_zod2 = require("zod");
37
+ var import_v42 = require("zod/v4");
61
38
 
62
39
  // src/friendli-error.ts
63
- var import_zod = require("zod");
64
40
  var import_provider_utils = require("@ai-sdk/provider-utils");
65
- var friendliaiErrorSchema = import_zod.z.object({
66
- message: import_zod.z.string(),
67
- error: import_zod.z.record(import_zod.z.string(), import_zod.z.any())
41
+ var import_v4 = require("zod/v4");
42
+ var friendliaiErrorSchema = import_v4.z.object({
43
+ message: import_v4.z.string(),
44
+ error: import_v4.z.record(import_v4.z.string(), import_v4.z.any())
68
45
  });
69
46
  var friendliaiErrorStructure = {
70
47
  errorSchema: friendliaiErrorSchema,
@@ -513,168 +490,249 @@ var FriendliAIChatLanguageModel = class {
513
490
  };
514
491
  }
515
492
  };
516
- var friendliAIChatResponseSchema = import_zod2.z.object({
517
- id: import_zod2.z.string().nullish(),
518
- created: import_zod2.z.number().nullish(),
519
- model: import_zod2.z.string().nullish(),
520
- choices: import_zod2.z.array(
521
- import_zod2.z.object({
522
- message: import_zod2.z.object({
523
- role: import_zod2.z.literal("assistant").nullish(),
524
- content: import_zod2.z.string().nullish(),
525
- tool_calls: import_zod2.z.array(
526
- import_zod2.z.object({
527
- id: import_zod2.z.string().nullish(),
528
- type: import_zod2.z.literal("function"),
529
- function: import_zod2.z.object({
530
- name: import_zod2.z.string(),
531
- arguments: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.any()]).nullish()
493
+ var friendliAIChatResponseSchema = import_v42.z.object({
494
+ id: import_v42.z.string().nullish(),
495
+ created: import_v42.z.number().nullish(),
496
+ model: import_v42.z.string().nullish(),
497
+ choices: import_v42.z.array(
498
+ import_v42.z.object({
499
+ message: import_v42.z.object({
500
+ role: import_v42.z.literal("assistant").nullish(),
501
+ content: import_v42.z.string().nullish(),
502
+ tool_calls: import_v42.z.array(
503
+ import_v42.z.object({
504
+ id: import_v42.z.string().nullish(),
505
+ type: import_v42.z.literal("function"),
506
+ function: import_v42.z.object({
507
+ name: import_v42.z.string(),
508
+ arguments: import_v42.z.union([import_v42.z.string(), import_v42.z.any()]).nullish()
532
509
  })
533
510
  })
534
511
  ).nullish()
535
512
  }),
536
- finish_reason: import_zod2.z.string().nullish()
513
+ finish_reason: import_v42.z.string().nullish()
537
514
  })
538
515
  ),
539
- usage: import_zod2.z.object({
540
- prompt_tokens: import_zod2.z.number().nullish(),
541
- completion_tokens: import_zod2.z.number().nullish()
516
+ usage: import_v42.z.object({
517
+ prompt_tokens: import_v42.z.number().nullish(),
518
+ completion_tokens: import_v42.z.number().nullish()
542
519
  }).nullish()
543
520
  });
544
- var friendliaiChatChunkSchema = import_zod2.z.union([
545
- import_zod2.z.object({
546
- id: import_zod2.z.string().nullish(),
547
- created: import_zod2.z.number().nullish(),
548
- model: import_zod2.z.string().nullish(),
549
- choices: import_zod2.z.array(
550
- import_zod2.z.object({
551
- delta: import_zod2.z.object({
552
- role: import_zod2.z.enum(["assistant"]).nullish(),
553
- content: import_zod2.z.string().nullish(),
554
- tool_calls: import_zod2.z.array(
555
- import_zod2.z.object({
556
- index: import_zod2.z.number(),
557
- id: import_zod2.z.string().nullish(),
558
- type: import_zod2.z.literal("function").optional(),
559
- function: import_zod2.z.object({
560
- name: import_zod2.z.string().nullish(),
561
- arguments: import_zod2.z.string().nullish()
521
+ var friendliaiChatChunkSchema = import_v42.z.union([
522
+ import_v42.z.object({
523
+ id: import_v42.z.string().nullish(),
524
+ created: import_v42.z.number().nullish(),
525
+ model: import_v42.z.string().nullish(),
526
+ choices: import_v42.z.array(
527
+ import_v42.z.object({
528
+ delta: import_v42.z.object({
529
+ role: import_v42.z.enum(["assistant"]).nullish(),
530
+ content: import_v42.z.string().nullish(),
531
+ tool_calls: import_v42.z.array(
532
+ import_v42.z.object({
533
+ index: import_v42.z.number(),
534
+ id: import_v42.z.string().nullish(),
535
+ type: import_v42.z.literal("function").optional(),
536
+ function: import_v42.z.object({
537
+ name: import_v42.z.string().nullish(),
538
+ arguments: import_v42.z.string().nullish()
562
539
  })
563
540
  })
564
541
  ).nullish()
565
542
  }).nullish(),
566
- finish_reason: import_zod2.z.string().nullish()
543
+ finish_reason: import_v42.z.string().nullish()
567
544
  })
568
545
  ),
569
- usage: import_zod2.z.object({
570
- prompt_tokens: import_zod2.z.number().nullish(),
571
- completion_tokens: import_zod2.z.number().nullish()
546
+ usage: import_v42.z.object({
547
+ prompt_tokens: import_v42.z.number().nullish(),
548
+ completion_tokens: import_v42.z.number().nullish()
572
549
  }).nullish()
573
550
  }),
574
- import_zod2.z.object({
575
- name: import_zod2.z.string(),
576
- status: import_zod2.z.enum(["ENDED", "STARTED", "ERRORED", "UPDATING"]),
577
- message: import_zod2.z.null(),
578
- parameters: import_zod2.z.array(
579
- import_zod2.z.object({
580
- name: import_zod2.z.string(),
581
- value: import_zod2.z.string()
551
+ import_v42.z.object({
552
+ name: import_v42.z.string(),
553
+ status: import_v42.z.enum(["ENDED", "STARTED", "ERRORED", "UPDATING"]),
554
+ message: import_v42.z.null(),
555
+ parameters: import_v42.z.array(
556
+ import_v42.z.object({
557
+ name: import_v42.z.string(),
558
+ value: import_v42.z.string()
582
559
  })
583
560
  ),
584
- result: import_zod2.z.string().nullable(),
585
- error: import_zod2.z.object({
586
- type: import_zod2.z.enum(["INVALID_PARAMETER", "UNKNOWN"]),
587
- msg: import_zod2.z.string()
561
+ result: import_v42.z.string().nullable(),
562
+ error: import_v42.z.object({
563
+ type: import_v42.z.enum(["INVALID_PARAMETER", "UNKNOWN"]),
564
+ msg: import_v42.z.string()
588
565
  }).nullable(),
589
- timestamp: import_zod2.z.number(),
590
- usage: import_zod2.z.null(),
591
- tool_call_id: import_zod2.z.string().nullable()
566
+ timestamp: import_v42.z.number(),
567
+ usage: import_v42.z.null(),
568
+ tool_call_id: import_v42.z.string().nullable()
592
569
  // temporary fix for "file:text" tool calls
593
570
  }),
594
571
  friendliaiErrorSchema
595
572
  ]);
596
- var openaiCompatibleTokenUsageSchema = import_zod2.z.object({
597
- prompt_tokens: import_zod2.z.number().nullish(),
598
- completion_tokens: import_zod2.z.number().nullish(),
599
- total_tokens: import_zod2.z.number().nullish(),
600
- prompt_tokens_details: import_zod2.z.object({
601
- cached_tokens: import_zod2.z.number().nullish()
573
+ var openaiCompatibleTokenUsageSchema = import_v42.z.object({
574
+ prompt_tokens: import_v42.z.number().nullish(),
575
+ completion_tokens: import_v42.z.number().nullish(),
576
+ total_tokens: import_v42.z.number().nullish(),
577
+ prompt_tokens_details: import_v42.z.object({
578
+ cached_tokens: import_v42.z.number().nullish()
602
579
  }).nullish(),
603
- completion_tokens_details: import_zod2.z.object({
604
- reasoning_tokens: import_zod2.z.number().nullish(),
605
- accepted_prediction_tokens: import_zod2.z.number().nullish(),
606
- rejected_prediction_tokens: import_zod2.z.number().nullish()
580
+ completion_tokens_details: import_v42.z.object({
581
+ reasoning_tokens: import_v42.z.number().nullish(),
582
+ accepted_prediction_tokens: import_v42.z.number().nullish(),
583
+ rejected_prediction_tokens: import_v42.z.number().nullish()
607
584
  }).nullish()
608
585
  }).nullish();
609
- var OpenAICompatibleChatResponseSchema = import_zod2.z.object({
610
- id: import_zod2.z.string().nullish(),
611
- created: import_zod2.z.number().nullish(),
612
- model: import_zod2.z.string().nullish(),
613
- choices: import_zod2.z.array(
614
- import_zod2.z.object({
615
- message: import_zod2.z.object({
616
- role: import_zod2.z.literal("assistant").nullish(),
617
- content: import_zod2.z.string().nullish(),
618
- reasoning_content: import_zod2.z.string().nullish(),
619
- tool_calls: import_zod2.z.array(
620
- import_zod2.z.object({
621
- id: import_zod2.z.string().nullish(),
622
- type: import_zod2.z.literal("function"),
623
- function: import_zod2.z.object({
624
- name: import_zod2.z.string(),
625
- arguments: import_zod2.z.string()
586
+ var OpenAICompatibleChatResponseSchema = import_v42.z.object({
587
+ id: import_v42.z.string().nullish(),
588
+ created: import_v42.z.number().nullish(),
589
+ model: import_v42.z.string().nullish(),
590
+ choices: import_v42.z.array(
591
+ import_v42.z.object({
592
+ message: import_v42.z.object({
593
+ role: import_v42.z.literal("assistant").nullish(),
594
+ content: import_v42.z.string().nullish(),
595
+ reasoning_content: import_v42.z.string().nullish(),
596
+ tool_calls: import_v42.z.array(
597
+ import_v42.z.object({
598
+ id: import_v42.z.string().nullish(),
599
+ type: import_v42.z.literal("function"),
600
+ function: import_v42.z.object({
601
+ name: import_v42.z.string(),
602
+ arguments: import_v42.z.string()
626
603
  })
627
604
  })
628
605
  ).nullish()
629
606
  }),
630
- finish_reason: import_zod2.z.string().nullish()
607
+ finish_reason: import_v42.z.string().nullish()
631
608
  })
632
609
  ),
633
610
  usage: openaiCompatibleTokenUsageSchema
634
611
  });
635
- var createOpenAICompatibleChatChunkSchema = (errorSchema) => import_zod2.z.union([
636
- import_zod2.z.object({
637
- id: import_zod2.z.string().nullish(),
638
- created: import_zod2.z.number().nullish(),
639
- model: import_zod2.z.string().nullish(),
640
- choices: import_zod2.z.array(
641
- import_zod2.z.object({
642
- delta: import_zod2.z.object({
643
- role: import_zod2.z.enum(["assistant"]).nullish(),
644
- content: import_zod2.z.string().nullish(),
645
- reasoning_content: import_zod2.z.string().nullish(),
646
- tool_calls: import_zod2.z.array(
647
- import_zod2.z.object({
648
- index: import_zod2.z.number(),
649
- id: import_zod2.z.string().nullish(),
650
- type: import_zod2.z.literal("function").nullish(),
651
- function: import_zod2.z.object({
652
- name: import_zod2.z.string().nullish(),
653
- arguments: import_zod2.z.string().nullish()
612
+ var createOpenAICompatibleChatChunkSchema = (errorSchema) => import_v42.z.union([
613
+ import_v42.z.object({
614
+ id: import_v42.z.string().nullish(),
615
+ created: import_v42.z.number().nullish(),
616
+ model: import_v42.z.string().nullish(),
617
+ choices: import_v42.z.array(
618
+ import_v42.z.object({
619
+ delta: import_v42.z.object({
620
+ role: import_v42.z.enum(["assistant"]).nullish(),
621
+ content: import_v42.z.string().nullish(),
622
+ reasoning_content: import_v42.z.string().nullish(),
623
+ tool_calls: import_v42.z.array(
624
+ import_v42.z.object({
625
+ index: import_v42.z.number(),
626
+ id: import_v42.z.string().nullish(),
627
+ type: import_v42.z.literal("function").nullish(),
628
+ function: import_v42.z.object({
629
+ name: import_v42.z.string().nullish(),
630
+ arguments: import_v42.z.string().nullish()
654
631
  })
655
632
  })
656
633
  ).nullish()
657
634
  }).nullish(),
658
- finish_reason: import_zod2.z.string().nullish()
635
+ finish_reason: import_v42.z.string().nullish()
659
636
  })
660
637
  ),
661
638
  usage: openaiCompatibleTokenUsageSchema
662
639
  }),
663
640
  errorSchema
664
641
  ]);
665
- var friendliProviderOptionsSchema = import_zod2.z.object({
642
+ var friendliProviderOptionsSchema = import_v42.z.object({
666
643
  /**
667
644
  * Whether to enable parallel function calling during tool use. Default to true.
668
645
  */
669
- parallelToolCalls: import_zod2.z.boolean().nullish(),
646
+ parallelToolCalls: import_v42.z.boolean().nullish(),
670
647
  /**
671
648
  * BETA FEATURE: You can write a regular expression to force output that satisfies that regular expression.
672
649
  */
673
650
  // regex: z.instanceof(RegExp).nullish(),
674
- regex: import_zod2.z.string().nullish(),
675
- chat_template_kwargs: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.any()).nullish()
651
+ regex: import_v42.z.string().nullish(),
652
+ chat_template_kwargs: import_v42.z.record(import_v42.z.string(), import_v42.z.any()).nullish()
676
653
  });
677
654
 
655
+ // src/friendli-settings.ts
656
+ var FriendliAIServerlessModelIds = [
657
+ "LGAI-EXAONE/EXAONE-4.0.1-32B",
658
+ "skt/A.X-4.0",
659
+ "skt/A.X-3.1",
660
+ "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B",
661
+ "deepseek-ai/DeepSeek-R1-0528",
662
+ "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
663
+ "meta-llama/Llama-4-Scout-17B-16E-Instruct",
664
+ "meta-llama/Llama-3.3-70B-Instruct",
665
+ "meta-llama-3.3-70b-instruct",
666
+ "meta-llama/Llama-3.1-8B-Instruct",
667
+ "meta-llama-3.1-8b-instruct",
668
+ "Qwen/Qwen3-235B-A22B-Thinking-2507",
669
+ "Qwen/Qwen3-235B-A22B-Instruct-2507",
670
+ "Qwen/Qwen3-30B-A3B",
671
+ "Qwen/Qwen3-32B",
672
+ "google/gemma-3-27b-it",
673
+ "mistralai/Mistral-Small-3.1-24B-Instruct-2503",
674
+ "mistralai/Devstral-Small-2505",
675
+ "mistralai/Magistral-Small-2506"
676
+ ];
677
+
678
+ // src/friendli-tools.ts
679
+ function webUrlBetaTool() {
680
+ return {
681
+ type: "provider-defined",
682
+ id: "friendli.web:url",
683
+ name: "web:url",
684
+ args: {}
685
+ };
686
+ }
687
+ function webSearchBetaTool() {
688
+ return {
689
+ type: "provider-defined",
690
+ id: "friendli.web:search",
691
+ name: "web:search",
692
+ args: {}
693
+ };
694
+ }
695
+ function mathCalendarBetaTool() {
696
+ return {
697
+ type: "provider-defined",
698
+ id: "friendli.math:calendar",
699
+ name: "math:calendar",
700
+ args: {}
701
+ };
702
+ }
703
+ function mathStatisticsBetaTool() {
704
+ return {
705
+ type: "provider-defined",
706
+ id: "friendli.math:statistics",
707
+ name: "math:statistics",
708
+ args: {}
709
+ };
710
+ }
711
+ function mathCalculatorBetaTool() {
712
+ return {
713
+ type: "provider-defined",
714
+ id: "friendli.math:calculator",
715
+ name: "math:calculator",
716
+ args: {}
717
+ };
718
+ }
719
+ function codePythonInterpreterBetaTool() {
720
+ return {
721
+ type: "provider-defined",
722
+ id: "friendli.code:python-interpreter",
723
+ name: "code:python-interpreter",
724
+ args: {}
725
+ };
726
+ }
727
+ var friendliTools = {
728
+ webSearchBetaTool,
729
+ webUrlBetaTool,
730
+ mathCalendarBetaTool,
731
+ mathStatisticsBetaTool,
732
+ mathCalculatorBetaTool,
733
+ codePythonInterpreterBetaTool
734
+ };
735
+
678
736
  // src/get-available-models.ts
679
737
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
680
738
  var DEFAULT_GRAPHQL_URL = "https://api-internal.friendli.ai/api/graphql";
@@ -782,64 +840,6 @@ async function getAvailableModelsImpl(options) {
782
840
  return { models };
783
841
  }
784
842
 
785
- // src/friendli-tools.ts
786
- function webUrlBetaTool() {
787
- return {
788
- type: "provider-defined",
789
- id: "friendli.web:url",
790
- name: "web:url",
791
- args: {}
792
- };
793
- }
794
- function webSearchBetaTool() {
795
- return {
796
- type: "provider-defined",
797
- id: "friendli.web:search",
798
- name: "web:search",
799
- args: {}
800
- };
801
- }
802
- function mathCalendarBetaTool() {
803
- return {
804
- type: "provider-defined",
805
- id: "friendli.math:calendar",
806
- name: "math:calendar",
807
- args: {}
808
- };
809
- }
810
- function mathStatisticsBetaTool() {
811
- return {
812
- type: "provider-defined",
813
- id: "friendli.math:statistics",
814
- name: "math:statistics",
815
- args: {}
816
- };
817
- }
818
- function mathCalculatorBetaTool() {
819
- return {
820
- type: "provider-defined",
821
- id: "friendli.math:calculator",
822
- name: "math:calculator",
823
- args: {}
824
- };
825
- }
826
- function codePythonInterpreterBetaTool() {
827
- return {
828
- type: "provider-defined",
829
- id: "friendli.code:python-interpreter",
830
- name: "code:python-interpreter",
831
- args: {}
832
- };
833
- }
834
- var friendliTools = {
835
- webSearchBetaTool,
836
- webUrlBetaTool,
837
- mathCalendarBetaTool,
838
- mathStatisticsBetaTool,
839
- mathCalculatorBetaTool,
840
- codePythonInterpreterBetaTool
841
- };
842
-
843
843
  // src/friendli-provider.ts
844
844
  function createFriendli(options = {}) {
845
845
  const getHeaders = () => ({