@ai-sdk/gmicloud 3.0.55 → 3.0.57

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,33 @@
1
1
  # @ai-sdk/gmicloud
2
2
 
3
+ ## 3.0.57
4
+
5
+ ### Patch Changes
6
+
7
+ - 2838776: Refactor GMI Cloud model ID logic into a model catalog that declares capabilities and provider options, and generate provider capability documentation from it. Request behavior is unchanged.
8
+ - Updated dependencies [b63c06a]
9
+ - Updated dependencies [646a7e3]
10
+ - @ai-sdk/openai-compatible@3.0.86
11
+
12
+ ## 3.0.56
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [36802d4]
17
+ - Updated dependencies [e0143b0]
18
+ - Updated dependencies [934100c]
19
+ - Updated dependencies [add01ab]
20
+ - Updated dependencies [5f19ea5]
21
+ - Updated dependencies [892af4d]
22
+ - Updated dependencies [89aff56]
23
+ - Updated dependencies [41465fd]
24
+ - Updated dependencies [9754014]
25
+ - Updated dependencies [4bb73b0]
26
+ - Updated dependencies [2e44144]
27
+ - @ai-sdk/provider@4.0.36
28
+ - @ai-sdk/openai-compatible@3.0.85
29
+ - @ai-sdk/provider-utils@5.0.75
30
+
3
31
  ## 3.0.55
4
32
 
5
33
  ### Patch Changes
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ const gmicloudErrorStructure = {
46
46
  };
47
47
  //#endregion
48
48
  //#region src/version.ts
49
- const VERSION = "3.0.55";
49
+ const VERSION = "3.0.57";
50
50
  //#endregion
51
51
  //#region src/gmicloud-provider.ts
52
52
  function createGmicloud(options = {}) {
@@ -121,3 +121,27 @@ GMI Cloud serves an evolving catalog of open-weight models, so model ids are typ
121
121
  ## Error diagnostics
122
122
 
123
123
  GMI Cloud's edge reports a generic banner in `error.message` on rejections and nests the backend engine's diagnostic in `error.details`. This provider unwraps the nested diagnostic, so `AI_APICallError.message` carries the engine's reason (e.g. `The request is invalid: Invalid max_tokens value, the valid range of max_tokens is [1, 393216].`) instead of `Backend request failed with status 400`.
124
+
125
+ ## Model Capabilities
126
+
127
+ {/* model-capabilities:gmicloud-language:start */}
128
+
129
+ {/* model-capabilities:gmicloud-language:end */}
130
+
131
+ ## Provider Option Reference
132
+
133
+ The following option definitions are generated from the provider catalog.
134
+
135
+ {/* model-capabilities:gmicloud-provider-options:start */}
136
+
137
+ | Operation | Option | Description |
138
+ | --------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
139
+ | language | `user` | A unique identifier representing your end-user, which can help providers to monitor and detect abuse. |
140
+ | language | `reasoningEffort` | Reasoning effort for reasoning models. Defaults to `medium`. Set to `null` to send `"reasoning_effort": null`, for providers that treat an explicit `null` differently from an omitted field. |
141
+ | language | `textVerbosity` | Controls the verbosity of the generated text. Defaults to `medium`. |
142
+ | language | `strictJsonSchema` | Whether to use strict JSON schema validation. When true, the model uses constrained decoding to guarantee schema compliance. Only used when the provider supports structured outputs and a schema is provided. |
143
+ | language | `echo` | Echo back the prompt in addition to the completion. |
144
+ | language | `logitBias` | Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. |
145
+ | language | `suffix` | The suffix that comes after a completion of inserted text. |
146
+
147
+ {/* model-capabilities:gmicloud-provider-options:end */}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/gmicloud",
3
- "version": "3.0.55",
3
+ "version": "3.0.57",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -29,9 +29,9 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@ai-sdk/openai-compatible": "3.0.84",
33
- "@ai-sdk/provider": "4.0.35",
34
- "@ai-sdk/provider-utils": "5.0.74"
32
+ "@ai-sdk/openai-compatible": "3.0.86",
33
+ "@ai-sdk/provider": "4.0.36",
34
+ "@ai-sdk/provider-utils": "5.0.75"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "22.19.19",
@@ -0,0 +1,90 @@
1
+ import type {
2
+ OpenAICompatibleLanguageModelChatOptions,
3
+ OpenAICompatibleLanguageModelCompletionOptions,
4
+ } from '@ai-sdk/openai-compatible';
5
+ import type {
6
+ ModelCapabilities,
7
+ ModelEntry,
8
+ ProviderOptionDefinition,
9
+ ProviderOptionDefinitions,
10
+ } from '@ai-sdk/provider';
11
+ import type { GmicloudLanguageModelChatOptions } from './gmicloud-chat-language-model-options';
12
+ const compatiblelanguageProviderOptions = {
13
+ user: {
14
+ description:
15
+ 'A unique identifier representing your end-user, which can help providers to\nmonitor and detect abuse.',
16
+ },
17
+ reasoningEffort: {
18
+ description:
19
+ 'Reasoning effort for reasoning models. Defaults to `medium`.\n\nSet to `null` to send `"reasoning_effort": null`, for providers that treat\nan explicit `null` differently from an omitted field.',
20
+ },
21
+ textVerbosity: {
22
+ description:
23
+ 'Controls the verbosity of the generated text. Defaults to `medium`.',
24
+ },
25
+ strictJsonSchema: {
26
+ description:
27
+ 'Whether to use strict JSON schema validation.\nWhen true, the model uses constrained decoding to guarantee schema compliance.\nOnly used when the provider supports structured outputs and a schema is provided.',
28
+ },
29
+ echo: { description: 'Echo back the prompt in addition to the completion.' },
30
+ logitBias: {
31
+ description:
32
+ 'Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in\nthe GPT tokenizer) to an associated bias value from -100 to 100.',
33
+ },
34
+ suffix: {
35
+ description: 'The suffix that comes after a completion of inserted text.',
36
+ },
37
+ } satisfies Record<
38
+ | keyof OpenAICompatibleLanguageModelChatOptions
39
+ | keyof OpenAICompatibleLanguageModelCompletionOptions,
40
+ ProviderOptionDefinition
41
+ >;
42
+
43
+ /** Known options accepted under providerOptions; open-ended extension keys remain undeclared. */
44
+ export const gmicloudProviderOptions = {
45
+ language: {
46
+ ...compatiblelanguageProviderOptions,
47
+ } satisfies Record<
48
+ keyof GmicloudLanguageModelChatOptions,
49
+ ProviderOptionDefinition
50
+ >,
51
+ } as const satisfies ProviderOptionDefinitions;
52
+
53
+ const languageModelIds = [
54
+ 'deepseek-ai/DeepSeek-V4-Flash-0731',
55
+ 'Qwen/Qwen3.8-Max',
56
+ 'moonshotai/kimi-k3',
57
+ 'zai-org/GLM-5.2-FP8',
58
+ 'MiniMaxAI/MiniMax-M3',
59
+ ] as const;
60
+ const documentedLanguageCapabilities: Record<
61
+ string,
62
+ NonNullable<ModelCapabilities['language']>
63
+ > = {};
64
+ const unknownLanguageCapabilities: NonNullable<ModelCapabilities['language']> =
65
+ {
66
+ inputs: { image: 'unknown', audio: 'unknown' },
67
+ objectGeneration: 'unknown',
68
+ tools: { usage: 'unknown', streaming: 'unknown' },
69
+ reasoning: { support: 'unknown' },
70
+ sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },
71
+ };
72
+ export function getGmicloudLanguageModelEntry(modelId: string) {
73
+ return {
74
+ capabilities: {
75
+ language:
76
+ documentedLanguageCapabilities[modelId] ?? unknownLanguageCapabilities,
77
+ },
78
+ providerOptions: {
79
+ language: Object.fromEntries(
80
+ Object.keys(gmicloudProviderOptions.language).map(key => [
81
+ key,
82
+ 'unknown' as const,
83
+ ]),
84
+ ),
85
+ },
86
+ } satisfies ModelEntry;
87
+ }
88
+ export const gmicloudModelCatalog = Object.fromEntries(
89
+ languageModelIds.map(id => [id, getGmicloudLanguageModelEntry(id)]),
90
+ );