@ai-sdk/moonshotai 3.0.31 → 3.0.32
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 +6 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +683 -70
- package/dist/index.js.map +1 -1
- package/package.json +5 -6
- package/src/convert-to-moonshotai-chat-messages.ts +197 -0
- package/src/map-moonshotai-finish-reason.ts +19 -0
- package/src/moonshotai-chat-api-types.ts +161 -0
- package/src/moonshotai-chat-language-model.ts +454 -29
- package/src/moonshotai-chat-options.ts +29 -2
- package/src/moonshotai-prepare-tools.ts +98 -0
- package/src/moonshotai-provider.ts +5 -70
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ai-sdk/moonshotai
|
|
2
2
|
|
|
3
|
+
## 3.0.32
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b283a6f: feat(provider/moonshotai): own the chat implementation, support video input. The provider no longer builds on `@ai-sdk/openai-compatible`; the converter, language model, and helpers are owned by the package. Video file parts (e.g. `mediaType: 'video/mp4'`) are converted to Moonshot's `video_url` content parts for video-capable models (`kimi-k3`, `kimi-k2.7-code`, `kimi-k2.6`, `kimi-k2.5`). Audio and PDF file parts now throw client-side (the API rejects those part types). `reasoningHistory: 'preserved'` now maps to Moonshot's `thinking.keep: 'all'` request field (previously a no-op, the API ignores `reasoning_history`), gated per model with a warning on models without `thinking.keep` support. Adds `promptCacheKey` and `safetyIdentifier` provider options, widens `reasoningEffort` to `'low' | 'high' | 'max'` per Moonshot's docs, maps the generic `reasoning` call option to `reasoning_effort`, and passes `ms://` Files API references through natively (declared in `supportedUrls`).
|
|
8
|
+
|
|
3
9
|
## 3.0.31
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,11 @@ import { z } from 'zod/v4';
|
|
|
4
4
|
|
|
5
5
|
type MoonshotAIChatModelId = 'moonshot-v1-8k' | 'moonshot-v1-32k' | 'moonshot-v1-128k' | 'kimi-k2.5' | 'kimi-k2.6' | 'kimi-k2.7-code' | 'kimi-k2.7-code-highspeed' | 'kimi-k3' | (string & {});
|
|
6
6
|
declare const moonshotaiLanguageModelOptions: z.ZodObject<{
|
|
7
|
-
reasoningEffort: z.ZodOptional<z.
|
|
7
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
low: "low";
|
|
9
|
+
high: "high";
|
|
10
|
+
max: "max";
|
|
11
|
+
}>>;
|
|
8
12
|
thinking: z.ZodOptional<z.ZodObject<{
|
|
9
13
|
type: z.ZodOptional<z.ZodEnum<{
|
|
10
14
|
enabled: "enabled";
|
|
@@ -17,6 +21,8 @@ declare const moonshotaiLanguageModelOptions: z.ZodObject<{
|
|
|
17
21
|
interleaved: "interleaved";
|
|
18
22
|
preserved: "preserved";
|
|
19
23
|
}>>;
|
|
24
|
+
promptCacheKey: z.ZodOptional<z.ZodString>;
|
|
25
|
+
safetyIdentifier: z.ZodOptional<z.ZodString>;
|
|
20
26
|
}, z.core.$strip>;
|
|
21
27
|
type MoonshotAILanguageModelOptions = z.infer<typeof moonshotaiLanguageModelOptions>;
|
|
22
28
|
|