@ai-sdk/moonshotai 3.0.60 → 3.0.62

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,23 @@
1
1
  # @ai-sdk/moonshotai
2
2
 
3
+ ## 3.0.62
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [8c65988]
8
+ - Updated dependencies [527a163]
9
+ - @ai-sdk/provider@4.0.21
10
+ - @ai-sdk/provider-utils@5.0.53
11
+
12
+ ## 3.0.61
13
+
14
+ ### Patch Changes
15
+
16
+ - ede5b89: chore: migrate package builds from tsup to tsdown
17
+ - Updated dependencies [ede5b89]
18
+ - @ai-sdk/provider@4.0.20
19
+ - @ai-sdk/provider-utils@5.0.52
20
+
3
21
  ## 3.0.60
4
22
 
5
23
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,105 +1,108 @@
1
- import { LanguageModelV4FunctionTool, ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
2
- import { FetchFunction } from '@ai-sdk/provider-utils';
3
- import { z } from 'zod/v4';
4
-
1
+ import { LanguageModelV4, LanguageModelV4FunctionTool, ProviderV4 } from "@ai-sdk/provider";
2
+ import { FetchFunction } from "@ai-sdk/provider-utils";
3
+ import { z } from "zod/v4";
4
+ //#region src/moonshotai-chat-options.d.ts
5
5
  type MoonshotAIChatModelId = 'moonshot-v1-auto' | 'moonshot-v1-8k' | 'moonshot-v1-32k' | 'moonshot-v1-128k' | 'moonshot-v1-8k-vision-preview' | 'moonshot-v1-32k-vision-preview' | 'moonshot-v1-128k-vision-preview' | 'kimi-k2.5' | 'kimi-k2.6' | 'kimi-k2.7-code' | 'kimi-k2.7-code-highspeed' | 'kimi-k3' | (string & {});
6
6
  type MoonshotAILanguageModelOptions = {
7
+ /**
8
+ * Whether to use strict JSON schema validation for structured outputs.
9
+ *
10
+ * @default true
11
+ */
12
+ strictJsonSchema?: boolean;
13
+ /** Whether to return log probabilities for generated tokens. */
14
+ logprobs?: boolean;
15
+ /**
16
+ * Number of most likely tokens to return at each token position.
17
+ * Setting this option automatically enables `logprobs`.
18
+ */
19
+ topLogprobs?: number;
20
+ /** Reasoning effort for Kimi K3. */
21
+ reasoningEffort?: 'low' | 'high' | 'max';
22
+ /**
23
+ * Static predicted content that can accelerate responses when much of the
24
+ * output is known ahead of time.
25
+ */
26
+ prediction?: {
27
+ type: 'content';
28
+ content: string | Array<{
29
+ type: 'text';
30
+ text: string;
31
+ }>;
32
+ };
33
+ /** Controls thinking on Kimi K2.5 and K2.6. K2.7 is always enabled. */
34
+ thinking?: {
35
+ type?: 'enabled' | 'disabled';
7
36
  /**
8
- * Whether to use strict JSON schema validation for structured outputs.
9
- *
10
- * @default true
37
+ * @deprecated Moonshot Chat Completions does not support thinking budgets.
38
+ * This value is ignored with a warning.
11
39
  */
12
- strictJsonSchema?: boolean;
13
- /** Whether to return log probabilities for generated tokens. */
14
- logprobs?: boolean;
15
- /**
16
- * Number of most likely tokens to return at each token position.
17
- * Setting this option automatically enables `logprobs`.
18
- */
19
- topLogprobs?: number;
20
- /** Reasoning effort for Kimi K3. */
21
- reasoningEffort?: 'low' | 'high' | 'max';
22
- /**
23
- * Static predicted content that can accelerate responses when much of the
24
- * output is known ahead of time.
25
- */
26
- prediction?: {
27
- type: 'content';
28
- content: string | Array<{
29
- type: 'text';
30
- text: string;
31
- }>;
32
- };
33
- /** Controls thinking on Kimi K2.5 and K2.6. K2.7 is always enabled. */
34
- thinking?: {
35
- type?: 'enabled' | 'disabled';
36
- /**
37
- * @deprecated Moonshot Chat Completions does not support thinking budgets.
38
- * This value is ignored with a warning.
39
- */
40
- budgetTokens?: number;
41
- };
42
- /**
43
- * Controls preserved reasoning behavior in multi-turn conversations.
44
- * `disabled` and `interleaved` are compatibility values that leave the
45
- * request unchanged. `preserved` maps to `thinking.keep: 'all'` for Kimi
46
- * K2.6. Kimi K2.7 and K3 preserve reasoning by default.
47
- */
48
- reasoningHistory?: 'disabled' | 'interleaved' | 'preserved';
49
- promptCacheKey?: string;
50
- safetyIdentifier?: string;
40
+ budgetTokens?: number;
41
+ };
42
+ /**
43
+ * Controls preserved reasoning behavior in multi-turn conversations.
44
+ * `disabled` and `interleaved` are compatibility values that leave the
45
+ * request unchanged. `preserved` maps to `thinking.keep: 'all'` for Kimi
46
+ * K2.6. Kimi K2.7 and K3 preserve reasoning by default.
47
+ */
48
+ reasoningHistory?: 'disabled' | 'interleaved' | 'preserved';
49
+ promptCacheKey?: string;
50
+ safetyIdentifier?: string;
51
51
  };
52
52
  declare const moonshotaiMessageProviderOptions: z.ZodObject<{
53
- name: z.ZodOptional<z.ZodString>;
53
+ name: z.ZodOptional<z.ZodString>;
54
54
  }, z.core.$strip>;
55
55
  type MoonshotAIMessageProviderOptions = z.infer<typeof moonshotaiMessageProviderOptions>;
56
56
  declare const moonshotaiAssistantMessageProviderOptions: z.ZodObject<{
57
- name: z.ZodOptional<z.ZodString>;
58
- partial: z.ZodOptional<z.ZodLiteral<true>>;
57
+ name: z.ZodOptional<z.ZodString>;
58
+ partial: z.ZodOptional<z.ZodLiteral<true>>;
59
59
  }, z.core.$strip>;
60
60
  type MoonshotAIAssistantMessageProviderOptions = z.infer<typeof moonshotaiAssistantMessageProviderOptions>;
61
61
  type MoonshotAISystemMessageProviderOptions = MoonshotAIMessageProviderOptions & {
62
- /** Function tools to load at this point in a Kimi K3 conversation. */
63
- tools?: Array<Pick<LanguageModelV4FunctionTool, 'type' | 'name' | 'description' | 'inputSchema' | 'strict'>>;
62
+ /** Function tools to load at this point in a Kimi K3 conversation. */
63
+ tools?: Array<Pick<LanguageModelV4FunctionTool, 'type' | 'name' | 'description' | 'inputSchema' | 'strict'>>;
64
64
  };
65
-
65
+ //#endregion
66
+ //#region src/moonshotai-provider.d.ts
66
67
  interface MoonshotAIProviderSettings {
67
- /**
68
- * Moonshot API key. Default value is taken from the `MOONSHOT_API_KEY`
69
- * environment variable.
70
- */
71
- apiKey?: string;
72
- /**
73
- * Base URL for the API calls.
74
- */
75
- baseURL?: string;
76
- /**
77
- * Custom headers to include in the requests.
78
- */
79
- headers?: Record<string, string>;
80
- /**
81
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
82
- * or to provide a custom fetch implementation for e.g. testing.
83
- */
84
- fetch?: FetchFunction;
68
+ /**
69
+ * Moonshot API key. Default value is taken from the `MOONSHOT_API_KEY`
70
+ * environment variable.
71
+ */
72
+ apiKey?: string;
73
+ /**
74
+ * Base URL for the API calls.
75
+ */
76
+ baseURL?: string;
77
+ /**
78
+ * Custom headers to include in the requests.
79
+ */
80
+ headers?: Record<string, string>;
81
+ /**
82
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
83
+ * or to provide a custom fetch implementation for e.g. testing.
84
+ */
85
+ fetch?: FetchFunction;
85
86
  }
86
87
  interface MoonshotAIProvider extends ProviderV4 {
87
- /**
88
- * Creates a model for text generation.
89
- */
90
- (modelId: MoonshotAIChatModelId): LanguageModelV4;
91
- /**
92
- * Creates a chat model for text generation.
93
- */
94
- chatModel(modelId: MoonshotAIChatModelId): LanguageModelV4;
95
- /**
96
- * Creates a language model for text generation.
97
- */
98
- languageModel(modelId: MoonshotAIChatModelId): LanguageModelV4;
88
+ /**
89
+ * Creates a model for text generation.
90
+ */
91
+ (modelId: MoonshotAIChatModelId): LanguageModelV4;
92
+ /**
93
+ * Creates a chat model for text generation.
94
+ */
95
+ chatModel(modelId: MoonshotAIChatModelId): LanguageModelV4;
96
+ /**
97
+ * Creates a language model for text generation.
98
+ */
99
+ languageModel(modelId: MoonshotAIChatModelId): LanguageModelV4;
99
100
  }
100
- declare function createMoonshotAI(options?: MoonshotAIProviderSettings): MoonshotAIProvider;
101
- declare const moonshotai: MoonshotAIProvider;
102
-
103
- declare const VERSION: string;
104
-
105
- export { type MoonshotAIAssistantMessageProviderOptions, type MoonshotAIChatModelId, type MoonshotAILanguageModelOptions, type MoonshotAIMessageProviderOptions, type MoonshotAIProvider, type MoonshotAILanguageModelOptions as MoonshotAIProviderOptions, type MoonshotAIProviderSettings, type MoonshotAISystemMessageProviderOptions, VERSION, createMoonshotAI, moonshotai };
101
+ export declare function createMoonshotAI(options?: MoonshotAIProviderSettings): MoonshotAIProvider;
102
+ export declare const moonshotai: MoonshotAIProvider;
103
+ //#endregion
104
+ //#region src/version.d.ts
105
+ export declare const VERSION: string;
106
+ //#endregion
107
+ export type { MoonshotAIAssistantMessageProviderOptions, MoonshotAIChatModelId, MoonshotAILanguageModelOptions, MoonshotAILanguageModelOptions as MoonshotAIProviderOptions, MoonshotAIMessageProviderOptions, MoonshotAIProvider, MoonshotAIProviderSettings, MoonshotAISystemMessageProviderOptions };
108
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/moonshotai-chat-options.ts","../src/moonshotai-provider.ts","../src/version.ts"],"mappings":";;;;KAGY;KAsHA;;;;;;EAMV;;EAGA;;;;;EAMA;;EAGA;;;;;EAMA;IACE;IACA,kBAAkB;MAAQ;MAAc;;;;EAI1C;IACE;;;;;IAMA;;;;;;;;EASF;EACA;EACA;;cAGW,kCAAgC,EAAA;;GAO3C,EAAA,KAAA;KAEU,mCAAmC,EAAE,aACxC;cAGI,2CAAyC,EAAA;;;GAQlD,EAAA,KAAA;KAEQ,4CAA4C,EAAE,aACjD;KAiBG,yCACV;;EAEE,QAAQ,MACN,KACE;;;;UCzMS;;;;;EAKf;;;;EAIA;;;;EAIA,UAAU;;;;;EAKV,QAAQ;;UAGO,2BAA2B;;;;GAIzC,SAAS,wBAAwB;;;;EAKlC,UAAU,SAAS,wBAAwB;;;;EAK3C,cAAc,SAAS,wBAAwB;;wBAoBjC,iBACd,UAAS,6BACR;qBA2CU,YAAU;;;qBCnHV"}