@friendliai/ai-provider 0.3.1 → 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,17 @@
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
+
9
+ ## 0.3.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 0e44c15: Update FSE model list
14
+
3
15
  ## 0.3.1
4
16
 
5
17
  ### 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
4
 
5
- declare const FriendliAIServerlessModelIds: readonly ["meta-llama-3.1-8b-instruct", "meta-llama/Llama-3.1-8B-Instruct", "meta-llama-3.3-70b-instruct", "meta-llama/Llama-3.3-70B-Instruct", "meta-llama/Llama-4-Scout-17B-16E-Instruct", "meta-llama/Llama-4-Maverick-17B-128E-Instruct", "LGAI-EXAONE/EXAONE-4.0.1-32B", "skt/A.X-3.1", "skt/A.X-4.0", "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", "K-intelligence/Midm-2.0-Base-Instruct", "K-intelligence/Midm-2.0-Mini-Instruct", "mistralai/Magistral-Small-2506", "mistralai/Devstral-Small-2505", "mistralai/Mistral-Small-3.1-24B-Instruct-2503", "Qwen/Qwen3-32B", "Qwen/Qwen3-30B-A3B", "Qwen/Qwen3-235B-A22B-Thinking-2507", "Qwen/Qwen3-235B-A22B-Instruct-2507", "deepseek-ai/DeepSeek-R1-0528", "google/gemma-3-27b-it"];
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>;
10
+
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
4
 
5
- declare const FriendliAIServerlessModelIds: readonly ["meta-llama-3.1-8b-instruct", "meta-llama/Llama-3.1-8B-Instruct", "meta-llama-3.3-70b-instruct", "meta-llama/Llama-3.3-70B-Instruct", "meta-llama/Llama-4-Scout-17B-16E-Instruct", "meta-llama/Llama-4-Maverick-17B-128E-Instruct", "LGAI-EXAONE/EXAONE-4.0.1-32B", "skt/A.X-3.1", "skt/A.X-4.0", "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", "K-intelligence/Midm-2.0-Base-Instruct", "K-intelligence/Midm-2.0-Mini-Instruct", "mistralai/Magistral-Small-2506", "mistralai/Devstral-Small-2505", "mistralai/Mistral-Small-3.1-24B-Instruct-2503", "Qwen/Qwen3-32B", "Qwen/Qwen3-30B-A3B", "Qwen/Qwen3-235B-A22B-Thinking-2507", "Qwen/Qwen3-235B-A22B-Instruct-2507", "deepseek-ai/DeepSeek-R1-0528", "google/gemma-3-27b-it"];
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>;
10
+
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,47 +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
- "meta-llama-3.1-8b-instruct",
36
- "meta-llama/Llama-3.1-8B-Instruct",
37
- "meta-llama-3.3-70b-instruct",
38
- "meta-llama/Llama-3.3-70B-Instruct",
39
- "meta-llama/Llama-4-Scout-17B-16E-Instruct",
40
- "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
41
- "LGAI-EXAONE/EXAONE-4.0.1-32B",
42
- "skt/A.X-3.1",
43
- "skt/A.X-4.0",
44
- "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B",
45
- "K-intelligence/Midm-2.0-Base-Instruct",
46
- "K-intelligence/Midm-2.0-Mini-Instruct",
47
- "mistralai/Magistral-Small-2506",
48
- "mistralai/Devstral-Small-2505",
49
- "mistralai/Mistral-Small-3.1-24B-Instruct-2503",
50
- "Qwen/Qwen3-32B",
51
- "Qwen/Qwen3-30B-A3B",
52
- "Qwen/Qwen3-235B-A22B-Thinking-2507",
53
- "Qwen/Qwen3-235B-A22B-Instruct-2507",
54
- "deepseek-ai/DeepSeek-R1-0528",
55
- "google/gemma-3-27b-it"
56
- ];
57
32
 
58
33
  // src/friendli-chat-language-model.ts
34
+ var import_internal = require("@ai-sdk/openai-compatible/internal");
59
35
  var import_provider2 = require("@ai-sdk/provider");
60
36
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
61
- var import_internal = require("@ai-sdk/openai-compatible/internal");
62
- var import_zod2 = require("zod");
37
+ var import_v42 = require("zod/v4");
63
38
 
64
39
  // src/friendli-error.ts
65
- var import_zod = require("zod");
66
40
  var import_provider_utils = require("@ai-sdk/provider-utils");
67
- var friendliaiErrorSchema = import_zod.z.object({
68
- message: import_zod.z.string(),
69
- 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())
70
45
  });
71
46
  var friendliaiErrorStructure = {
72
47
  errorSchema: friendliaiErrorSchema,
@@ -515,168 +490,249 @@ var FriendliAIChatLanguageModel = class {
515
490
  };
516
491
  }
517
492
  };
518
- var friendliAIChatResponseSchema = import_zod2.z.object({
519
- id: import_zod2.z.string().nullish(),
520
- created: import_zod2.z.number().nullish(),
521
- model: import_zod2.z.string().nullish(),
522
- choices: import_zod2.z.array(
523
- import_zod2.z.object({
524
- message: import_zod2.z.object({
525
- role: import_zod2.z.literal("assistant").nullish(),
526
- content: import_zod2.z.string().nullish(),
527
- tool_calls: import_zod2.z.array(
528
- import_zod2.z.object({
529
- id: import_zod2.z.string().nullish(),
530
- type: import_zod2.z.literal("function"),
531
- function: import_zod2.z.object({
532
- name: import_zod2.z.string(),
533
- 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()
534
509
  })
535
510
  })
536
511
  ).nullish()
537
512
  }),
538
- finish_reason: import_zod2.z.string().nullish()
513
+ finish_reason: import_v42.z.string().nullish()
539
514
  })
540
515
  ),
541
- usage: import_zod2.z.object({
542
- prompt_tokens: import_zod2.z.number().nullish(),
543
- 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()
544
519
  }).nullish()
545
520
  });
546
- var friendliaiChatChunkSchema = import_zod2.z.union([
547
- import_zod2.z.object({
548
- id: import_zod2.z.string().nullish(),
549
- created: import_zod2.z.number().nullish(),
550
- model: import_zod2.z.string().nullish(),
551
- choices: import_zod2.z.array(
552
- import_zod2.z.object({
553
- delta: import_zod2.z.object({
554
- role: import_zod2.z.enum(["assistant"]).nullish(),
555
- content: import_zod2.z.string().nullish(),
556
- tool_calls: import_zod2.z.array(
557
- import_zod2.z.object({
558
- index: import_zod2.z.number(),
559
- id: import_zod2.z.string().nullish(),
560
- type: import_zod2.z.literal("function").optional(),
561
- function: import_zod2.z.object({
562
- name: import_zod2.z.string().nullish(),
563
- 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()
564
539
  })
565
540
  })
566
541
  ).nullish()
567
542
  }).nullish(),
568
- finish_reason: import_zod2.z.string().nullish()
543
+ finish_reason: import_v42.z.string().nullish()
569
544
  })
570
545
  ),
571
- usage: import_zod2.z.object({
572
- prompt_tokens: import_zod2.z.number().nullish(),
573
- 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()
574
549
  }).nullish()
575
550
  }),
576
- import_zod2.z.object({
577
- name: import_zod2.z.string(),
578
- status: import_zod2.z.enum(["ENDED", "STARTED", "ERRORED", "UPDATING"]),
579
- message: import_zod2.z.null(),
580
- parameters: import_zod2.z.array(
581
- import_zod2.z.object({
582
- name: import_zod2.z.string(),
583
- 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()
584
559
  })
585
560
  ),
586
- result: import_zod2.z.string().nullable(),
587
- error: import_zod2.z.object({
588
- type: import_zod2.z.enum(["INVALID_PARAMETER", "UNKNOWN"]),
589
- 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()
590
565
  }).nullable(),
591
- timestamp: import_zod2.z.number(),
592
- usage: import_zod2.z.null(),
593
- 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()
594
569
  // temporary fix for "file:text" tool calls
595
570
  }),
596
571
  friendliaiErrorSchema
597
572
  ]);
598
- var openaiCompatibleTokenUsageSchema = import_zod2.z.object({
599
- prompt_tokens: import_zod2.z.number().nullish(),
600
- completion_tokens: import_zod2.z.number().nullish(),
601
- total_tokens: import_zod2.z.number().nullish(),
602
- prompt_tokens_details: import_zod2.z.object({
603
- 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()
604
579
  }).nullish(),
605
- completion_tokens_details: import_zod2.z.object({
606
- reasoning_tokens: import_zod2.z.number().nullish(),
607
- accepted_prediction_tokens: import_zod2.z.number().nullish(),
608
- 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()
609
584
  }).nullish()
610
585
  }).nullish();
611
- var OpenAICompatibleChatResponseSchema = import_zod2.z.object({
612
- id: import_zod2.z.string().nullish(),
613
- created: import_zod2.z.number().nullish(),
614
- model: import_zod2.z.string().nullish(),
615
- choices: import_zod2.z.array(
616
- import_zod2.z.object({
617
- message: import_zod2.z.object({
618
- role: import_zod2.z.literal("assistant").nullish(),
619
- content: import_zod2.z.string().nullish(),
620
- reasoning_content: import_zod2.z.string().nullish(),
621
- tool_calls: import_zod2.z.array(
622
- import_zod2.z.object({
623
- id: import_zod2.z.string().nullish(),
624
- type: import_zod2.z.literal("function"),
625
- function: import_zod2.z.object({
626
- name: import_zod2.z.string(),
627
- 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()
628
603
  })
629
604
  })
630
605
  ).nullish()
631
606
  }),
632
- finish_reason: import_zod2.z.string().nullish()
607
+ finish_reason: import_v42.z.string().nullish()
633
608
  })
634
609
  ),
635
610
  usage: openaiCompatibleTokenUsageSchema
636
611
  });
637
- var createOpenAICompatibleChatChunkSchema = (errorSchema) => import_zod2.z.union([
638
- import_zod2.z.object({
639
- id: import_zod2.z.string().nullish(),
640
- created: import_zod2.z.number().nullish(),
641
- model: import_zod2.z.string().nullish(),
642
- choices: import_zod2.z.array(
643
- import_zod2.z.object({
644
- delta: import_zod2.z.object({
645
- role: import_zod2.z.enum(["assistant"]).nullish(),
646
- content: import_zod2.z.string().nullish(),
647
- reasoning_content: import_zod2.z.string().nullish(),
648
- tool_calls: import_zod2.z.array(
649
- import_zod2.z.object({
650
- index: import_zod2.z.number(),
651
- id: import_zod2.z.string().nullish(),
652
- type: import_zod2.z.literal("function").nullish(),
653
- function: import_zod2.z.object({
654
- name: import_zod2.z.string().nullish(),
655
- 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()
656
631
  })
657
632
  })
658
633
  ).nullish()
659
634
  }).nullish(),
660
- finish_reason: import_zod2.z.string().nullish()
635
+ finish_reason: import_v42.z.string().nullish()
661
636
  })
662
637
  ),
663
638
  usage: openaiCompatibleTokenUsageSchema
664
639
  }),
665
640
  errorSchema
666
641
  ]);
667
- var friendliProviderOptionsSchema = import_zod2.z.object({
642
+ var friendliProviderOptionsSchema = import_v42.z.object({
668
643
  /**
669
644
  * Whether to enable parallel function calling during tool use. Default to true.
670
645
  */
671
- parallelToolCalls: import_zod2.z.boolean().nullish(),
646
+ parallelToolCalls: import_v42.z.boolean().nullish(),
672
647
  /**
673
648
  * BETA FEATURE: You can write a regular expression to force output that satisfies that regular expression.
674
649
  */
675
650
  // regex: z.instanceof(RegExp).nullish(),
676
- regex: import_zod2.z.string().nullish(),
677
- 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()
678
653
  });
679
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
+
680
736
  // src/get-available-models.ts
681
737
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
682
738
  var DEFAULT_GRAPHQL_URL = "https://api-internal.friendli.ai/api/graphql";
@@ -784,64 +840,6 @@ async function getAvailableModelsImpl(options) {
784
840
  return { models };
785
841
  }
786
842
 
787
- // src/friendli-tools.ts
788
- function webUrlBetaTool() {
789
- return {
790
- type: "provider-defined",
791
- id: "friendli.web:url",
792
- name: "web:url",
793
- args: {}
794
- };
795
- }
796
- function webSearchBetaTool() {
797
- return {
798
- type: "provider-defined",
799
- id: "friendli.web:search",
800
- name: "web:search",
801
- args: {}
802
- };
803
- }
804
- function mathCalendarBetaTool() {
805
- return {
806
- type: "provider-defined",
807
- id: "friendli.math:calendar",
808
- name: "math:calendar",
809
- args: {}
810
- };
811
- }
812
- function mathStatisticsBetaTool() {
813
- return {
814
- type: "provider-defined",
815
- id: "friendli.math:statistics",
816
- name: "math:statistics",
817
- args: {}
818
- };
819
- }
820
- function mathCalculatorBetaTool() {
821
- return {
822
- type: "provider-defined",
823
- id: "friendli.math:calculator",
824
- name: "math:calculator",
825
- args: {}
826
- };
827
- }
828
- function codePythonInterpreterBetaTool() {
829
- return {
830
- type: "provider-defined",
831
- id: "friendli.code:python-interpreter",
832
- name: "code:python-interpreter",
833
- args: {}
834
- };
835
- }
836
- var friendliTools = {
837
- webSearchBetaTool,
838
- webUrlBetaTool,
839
- mathCalendarBetaTool,
840
- mathStatisticsBetaTool,
841
- mathCalculatorBetaTool,
842
- codePythonInterpreterBetaTool
843
- };
844
-
845
843
  // src/friendli-provider.ts
846
844
  function createFriendli(options = {}) {
847
845
  const getHeaders = () => ({