@cartanova/qgrid-ai-sdk 2.7.9 → 2.9.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/README.ko.md CHANGED
@@ -12,8 +12,8 @@ AI SDK v6 custom `LanguageModelV3` provider for [qgrid](https://github.com/carta
12
12
  +import { qgrid } from "@cartanova/qgrid-ai-sdk";
13
13
 
14
14
  const { text } = await generateText({
15
- - model: openai("gpt-5.4-mini"),
16
- + model: qgrid("openai/gpt-5.4-mini"),
15
+ - model: openai("gpt-5.6-luna"),
16
+ + model: qgrid("openai/gpt-5.6-luna"),
17
17
  prompt: "서울 날씨 알려줘",
18
18
  });
19
19
  ```
@@ -43,7 +43,7 @@ import { generateText } from "ai";
43
43
  import { qgrid } from "@cartanova/qgrid-ai-sdk";
44
44
 
45
45
  const { text } = await generateText({
46
- model: qgrid("openai/gpt-5.4-mini"),
46
+ model: qgrid("openai/gpt-5.6-luna"),
47
47
  prompt: "서울 날씨 알려줘",
48
48
  });
49
49
  ```
@@ -62,7 +62,7 @@ import { generateText } from "ai";
62
62
  import { qgrid } from "@cartanova/qgrid-ai-sdk";
63
63
 
64
64
  const { text } = await generateText({
65
- model: qgrid("openai/gpt-5.4-mini"),
65
+ model: qgrid("openai/gpt-5.6-luna"),
66
66
  system: "당신은 학술 논문 요약가입니다.",
67
67
  prompt: paperText,
68
68
  });
@@ -77,7 +77,7 @@ import { qgrid } from "@cartanova/qgrid-ai-sdk";
77
77
  import { z } from "zod";
78
78
 
79
79
  const { output } = await generateText({
80
- model: qgrid("openai/gpt-5.4"),
80
+ model: qgrid("openai/gpt-5.6-terra"),
81
81
  system: "논문 메타데이터를 추출해주세요.",
82
82
  prompt: paperText,
83
83
  output: Output.object({
@@ -104,7 +104,7 @@ import { streamText } from "ai";
104
104
  import { qgrid } from "@cartanova/qgrid-ai-sdk";
105
105
 
106
106
  const { textStream } = streamText({
107
- model: qgrid("openai/gpt-5.4-mini"),
107
+ model: qgrid("openai/gpt-5.6-luna"),
108
108
  prompt: "TypeScript의 장점을 설명해줘",
109
109
  });
110
110
 
@@ -121,7 +121,7 @@ import { qgrid } from "@cartanova/qgrid-ai-sdk";
121
121
  import { z } from "zod";
122
122
 
123
123
  const { text } = await generateText({
124
- model: qgrid("openai/gpt-5.4-mini"),
124
+ model: qgrid("openai/gpt-5.6-luna"),
125
125
  prompt: "서울 날씨 알려줘",
126
126
  tools: {
127
127
  getWeather: tool({
@@ -149,7 +149,7 @@ import { qgrid } from "@cartanova/qgrid-ai-sdk";
149
149
  import { z } from "zod";
150
150
 
151
151
  const { output } = await generateText({
152
- model: qgrid("openai/gpt-5.4"),
152
+ model: qgrid("openai/gpt-5.6-terra"),
153
153
  prompt: "서울 날씨를 조회해서 예보를 반환해줘.",
154
154
  tools: {
155
155
  getWeather: tool({
@@ -187,7 +187,7 @@ import { generateText } from "ai";
187
187
  import { qgrid, type QgridProviderOptions } from "@cartanova/qgrid-ai-sdk";
188
188
 
189
189
  const { text } = await generateText({
190
- model: qgrid("openai/gpt-5.4"),
190
+ model: qgrid("openai/gpt-5.6-terra"),
191
191
  prompt: "복잡한 문제를 분석해줘",
192
192
  providerOptions: {
193
193
  qgrid: {
@@ -201,6 +201,7 @@ const { text } = await generateText({
201
201
 
202
202
  | 옵션 | 값 | 적용 범위 | 설명 |
203
203
  |---|---|---|---|
204
+ | `tokenName` | provider prefix를 포함한 토큰 이름 | 공통 | `anthropic/yds`처럼 활성 토큰 하나를 엄격히 지정. prefix는 model provider와 같아야 하며 빈 값·누락·inactive·quota 초과 시 다른 토큰으로 fallback하지 않음 |
204
205
  | `logger` | `boolean` | 공통 | qgrid request log 저장 여부. 기본값은 `true`. `false`로 설정해도 client tool 실행과 multi-step 연결은 계속 동작 |
205
206
  | `sessionKey` | `string` | OpenAI 전용 | 전체 history 재전송 시 불투명 prompt-cache affinity를 파생하는 멀티턴 대화 식별자 ([아래](#멀티턴-prompt-cache-sessionkey) 참조) |
206
207
  | `effort` | `"none"` \| `"minimal"` \| `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | 공통 (지원 값은 모델별 상이, 예: `"max"`는 GPT-5.6+) | reasoning 모델의 추론 깊이. 기본값은 config의 `defaultEffort` (`"low"`) |
@@ -212,6 +213,18 @@ const { text } = await generateText({
212
213
  | `imageGenerationOptions` | `{ quality?, size? }` | OpenAI 전용 | 이미지 품질/크기 힌트. `quality: "low" \| "medium" \| "high"`, `size: "1024x1024" \| "1024x1536" \| "1536x1024"` (기본: `medium` / `1536x1024`) |
213
214
  | `fallbackModels` | `string[]` | 예약 | 향후 qgrid 서버 fallback routing용 예약 필드. 현재 동작하지 않으며 Claude Code의 Fable refusal fallback과 무관 |
214
215
 
216
+ ```typescript
217
+ await generateText({
218
+ model: qgrid("anthropic/claude-fable-5"),
219
+ prompt,
220
+ providerOptions: {
221
+ qgrid: { tokenName: "anthropic/yds" } satisfies QgridProviderOptions,
222
+ },
223
+ });
224
+ ```
225
+
226
+ `tokenName`은 `streamText`에서도 같은 방식으로 동작합니다.
227
+
215
228
  AI SDK 최상위 `timeout`은 전체 클라이언트 제한시간이며 custom provider 실행 전에
216
229
  `AbortSignal`로 변환됩니다. 따라서 그 숫자 자체는 qgrid에 전달되지 않습니다. qgrid 서버의
217
230
  Claude Code 프로세스 제한시간을 바꾸려면 `providerOptions.qgrid.timeoutMs`를 사용하세요.
@@ -227,7 +240,7 @@ Anthropic `generateText` 요청에는 전역 설정을 바꾸지 않는 요청
227
240
 
228
241
  ```typescript
229
242
  const { text } = await generateText({
230
- model: qgrid("openai/gpt-5.4-mini"),
243
+ model: qgrid("openai/gpt-5.6-luna"),
231
244
  prompt: nextTurnPrompt,
232
245
  providerOptions: { qgrid: { sessionKey: "game-session-123" } },
233
246
  });
@@ -242,7 +255,7 @@ OpenAI/codex 경로 전용, `generateText` 전용입니다. 해당 요청에만
242
255
 
243
256
  ```typescript
244
257
  const result = await generateText({
245
- model: qgrid("openai/gpt-5.4"),
258
+ model: qgrid("openai/gpt-5.6-terra"),
246
259
  prompt: "우주를 나는 고래 일러스트",
247
260
  providerOptions: {
248
261
  qgrid: {
@@ -259,7 +272,7 @@ const image = result.files[0]; // mediaType: "image/png", base64
259
272
 
260
273
  ```typescript
261
274
  const result = await generateText({
262
- model: qgrid("openai/gpt-5.4"),
275
+ model: qgrid("openai/gpt-5.6-terra"),
263
276
  messages: [
264
277
  {
265
278
  role: "user",
@@ -357,6 +370,7 @@ type QgridSupportedModel =
357
370
  | "openai/gpt-5.3-codex"
358
371
  | "openai/gpt-5.3-codex-spark"
359
372
  // Anthropic
373
+ | "anthropic/claude-fable-5-1"
360
374
  | "anthropic/claude-fable-5"
361
375
  | "anthropic/claude-haiku-4-5"
362
376
  | "anthropic/claude-sonnet-4"
@@ -373,6 +387,8 @@ type QgridSupportedModel =
373
387
  | "anthropic/claude-opus-5"
374
388
  ```
375
389
 
390
+ `openai/gpt-5.4`, `openai/gpt-5.4-mini`, `openai/gpt-5.2`, `openai/gpt-5.3-codex`는 하위 호환을 위해 타입에 남아 있지만, qgrid가 사용하는 ChatGPT 구독 Codex 경로에서는 더 이상 제공되지 않습니다. `gpt-5.4`와 `gpt-5.4-mini`는 2026-08-31에 retire되었고(대체: `openai/gpt-5.6-terra`, `openai/gpt-5.6-luna`), `gpt-5.2`와 `gpt-5.3-codex`는 그보다 먼저 해당 경로에서 제거되었습니다. 이 id로 요청하면 백엔드에서 실패합니다.
391
+
376
392
  ### GPT-5.6 사양
377
393
 
378
394
  | 모델 | Context (qgrid OpenAI 경로) | 최대 출력 | 1M tokens당 input / cached input / output |
@@ -385,9 +401,11 @@ type QgridSupportedModel =
385
401
 
386
402
  `anthropic/claude-fable-5`는 1M context와 128K 최대 출력을 지원합니다. 1M tokens당 표준 단가는 input $10, cache read $1, 5분 cache write $12.50, 1시간 cache write $20, output $50입니다. qgrid는 Claude 응답의 5분/1시간 cache creation breakdown을 보존해 TTL별 단가를 각각 적용하며, breakdown이 없는 구버전 응답에서만 Claude Code가 subscription OAuth 경로에 자동 적용하는 1시간 TTL 단가로 fallback합니다. Fable은 adaptive thinking이 항상 켜져 있어야 하므로 qgrid는 이 모델의 adaptive thinking을 보존합니다.
387
403
 
404
+ `anthropic/claude-fable-5-1`(2026-09-01 출시)은 Fable 5와 같은 1M context, 128K 최대 출력, 항상 켜진 adaptive thinking, input $10 / output $50 단가를 공유합니다. cache read만 Fable 5의 $1 대신 1M tokens당 $0.25(input의 0.025x)로 과금되며, cache write는 $12.50(5분)/$20(1시간)으로 같습니다. Fable 5.1의 API 수준 파괴적 변경(forced `tool_choice` 거부, 모델에 귀속된 thinking 블록)은 qgrid에 영향을 주지 않습니다. qgrid는 도구를 끈 Claude Code를 fresh 프로세스로 실행하고 히스토리를 텍스트로 평탄화해 전달하기 때문입니다.
405
+
388
406
  `anthropic/claude-opus-5`는 기본 1M context와 128K 최대 출력을 지원합니다. 1M tokens당 단가는 input $5, cache read $0.50, 5분 cache write $6.25, 1시간 cache write $10, output $25입니다. qgrid는 Opus 5의 기본 adaptive thinking 동작을 유지하고 `effort`로 추론 깊이를 조절합니다. 따라서 `xhigh` 또는 `max` effort에서 허용되지 않는 `thinking: disabled` 조합도 만들지 않습니다.
389
407
 
390
- Claude Code는 Fable의 safety refusal을 Opus 4.8로 자동 재시도할 수 있습니다. 이 경우 AI SDK 응답의 `response.modelId`와 `providerMetadata.qgrid.model`은 실제 serving 모델인 Opus를 가리킵니다. `providerMetadata.qgrid.requestedModel`은 Fable로 유지되고, `providerMetadata.qgrid.modelFallbacks`에 refusal fallback 이력이 담깁니다. 같은 metadata에서 `costSource`와 5분/1시간 cache-write 토큰 분해도 확인할 수 있습니다.
408
+ Claude Code는 Fable의 safety refusal을 다른 Opus 모델로 자동 재시도할 수 있습니다. 현재 CLI는 refusal 카테고리에 따라 Opus 5 또는 Opus 4.8을 고릅니다. 이 경우 AI SDK 응답의 `response.modelId`와 `providerMetadata.qgrid.model`은 실제 serving 모델인 Opus를 가리킵니다. `providerMetadata.qgrid.requestedModel`은 Fable로 유지되고, `providerMetadata.qgrid.modelFallbacks`에 refusal fallback 이력이 담깁니다. 같은 metadata에서 `costSource`와 5분/1시간 cache-write 토큰 분해도 확인할 수 있습니다.
391
409
 
392
410
  `openai/gpt-5.3-codex-spark`는 아직 token 단가가 확정·공개되지 않은 research preview입니다. 따라서 qgrid는 generic fallback 추정치를 보고하며, 이를 공식 단가로 취급하지 않습니다.
393
411
 
package/README.md CHANGED
@@ -12,8 +12,8 @@ AI SDK v6 custom `LanguageModelV3` provider for [qgrid](https://github.com/carta
12
12
  +import { qgrid } from "@cartanova/qgrid-ai-sdk";
13
13
 
14
14
  const { text } = await generateText({
15
- - model: openai("gpt-5.4-mini"),
16
- + model: qgrid("openai/gpt-5.4-mini"),
15
+ - model: openai("gpt-5.6-luna"),
16
+ + model: qgrid("openai/gpt-5.6-luna"),
17
17
  prompt: "What's the weather in Seoul?",
18
18
  });
19
19
  ```
@@ -43,7 +43,7 @@ import { generateText } from "ai";
43
43
  import { qgrid } from "@cartanova/qgrid-ai-sdk";
44
44
 
45
45
  const { text } = await generateText({
46
- model: qgrid("openai/gpt-5.4-mini"),
46
+ model: qgrid("openai/gpt-5.6-luna"),
47
47
  prompt: "What's the weather in Seoul?",
48
48
  });
49
49
  ```
@@ -62,7 +62,7 @@ import { generateText } from "ai";
62
62
  import { qgrid } from "@cartanova/qgrid-ai-sdk";
63
63
 
64
64
  const { text } = await generateText({
65
- model: qgrid("openai/gpt-5.4-mini"),
65
+ model: qgrid("openai/gpt-5.6-luna"),
66
66
  system: "You are an academic paper summarizer.",
67
67
  prompt: paperText,
68
68
  });
@@ -77,7 +77,7 @@ import { qgrid } from "@cartanova/qgrid-ai-sdk";
77
77
  import { z } from "zod";
78
78
 
79
79
  const { output } = await generateText({
80
- model: qgrid("openai/gpt-5.4"),
80
+ model: qgrid("openai/gpt-5.6-terra"),
81
81
  system: "Extract the paper metadata.",
82
82
  prompt: paperText,
83
83
  output: Output.object({
@@ -112,7 +112,7 @@ import { streamText } from "ai";
112
112
  import { qgrid } from "@cartanova/qgrid-ai-sdk";
113
113
 
114
114
  const { textStream } = streamText({
115
- model: qgrid("openai/gpt-5.4-mini"),
115
+ model: qgrid("openai/gpt-5.6-luna"),
116
116
  prompt: "Explain the benefits of TypeScript",
117
117
  });
118
118
 
@@ -129,7 +129,7 @@ import { qgrid } from "@cartanova/qgrid-ai-sdk";
129
129
  import { z } from "zod";
130
130
 
131
131
  const { text } = await generateText({
132
- model: qgrid("openai/gpt-5.4-mini"),
132
+ model: qgrid("openai/gpt-5.6-luna"),
133
133
  prompt: "What's the weather in Seoul?",
134
134
  tools: {
135
135
  getWeather: tool({
@@ -157,7 +157,7 @@ import { qgrid } from "@cartanova/qgrid-ai-sdk";
157
157
  import { z } from "zod";
158
158
 
159
159
  const { output } = await generateText({
160
- model: qgrid("openai/gpt-5.4"),
160
+ model: qgrid("openai/gpt-5.6-terra"),
161
161
  prompt: "Look up Seoul's weather and return a forecast.",
162
162
  tools: {
163
163
  getWeather: tool({
@@ -196,7 +196,7 @@ import { generateText } from "ai";
196
196
  import { qgrid, type QgridProviderOptions } from "@cartanova/qgrid-ai-sdk";
197
197
 
198
198
  const { text } = await generateText({
199
- model: qgrid("openai/gpt-5.4"),
199
+ model: qgrid("openai/gpt-5.6-terra"),
200
200
  prompt: "Analyze this complex problem",
201
201
  providerOptions: {
202
202
  qgrid: {
@@ -210,6 +210,7 @@ const { text } = await generateText({
210
210
 
211
211
  | Option | Values | Applies to | Description |
212
212
  |---|---|---|---|
213
+ | `tokenName` | provider-prefixed token name | both providers | Strictly targets one active token, such as `anthropic/yds`. The prefix must match the model provider; empty, missing, inactive, or over-threshold targets fail without fallback |
213
214
  | `logger` | `boolean` | both providers | qgrid request logging. Defaults to `true`; `false` disables request-log persistence for this generation without disabling client tools or multi-step continuation |
214
215
  | `sessionKey` | `string` | OpenAI only | Multi-turn conversation identifier used to derive opaque prompt-cache affinity while replaying full history (see [below](#multi-turn-prompt-cache-sessionkey)) |
215
216
  | `effort` | `"none"` \| `"minimal"` \| `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | both providers (supported values are model-dependent, e.g. `"max"` is GPT-5.6+) | Reasoning depth. Defaults to the config's `defaultEffort` (`"low"`) |
@@ -221,6 +222,18 @@ const { text } = await generateText({
221
222
  | `imageGenerationOptions` | `{ quality?, size? }` | OpenAI only | Image quality/size hints. `quality: "low" \| "medium" \| "high"`, `size: "1024x1024" \| "1024x1536" \| "1536x1024"` (defaults: `medium` / `1536x1024`) |
222
223
  | `fallbackModels` | `string[]` | reserved | Reserved for future qgrid server-side fallback routing. Not functional yet and unrelated to Claude Code's Fable refusal fallback |
223
224
 
225
+ ```typescript
226
+ await generateText({
227
+ model: qgrid("anthropic/claude-fable-5"),
228
+ prompt,
229
+ providerOptions: {
230
+ qgrid: { tokenName: "anthropic/yds" } satisfies QgridProviderOptions,
231
+ },
232
+ });
233
+ ```
234
+
235
+ `tokenName` works the same way with `streamText`.
236
+
224
237
  AI SDK's top-level `timeout` remains the overall client-side budget and is converted to an
225
238
  `AbortSignal` before the custom provider runs. It does not expose the numeric timeout to qgrid.
226
239
  Use `providerOptions.qgrid.timeoutMs` when the qgrid server's Claude Code process needs a different
@@ -236,7 +249,7 @@ For multi-turn conversations, pass a caller-side domain ID (game session ID, cha
236
249
 
237
250
  ```typescript
238
251
  const { text } = await generateText({
239
- model: qgrid("openai/gpt-5.4-mini"),
252
+ model: qgrid("openai/gpt-5.6-luna"),
240
253
  prompt: nextTurnPrompt,
241
254
  providerOptions: { qgrid: { sessionKey: "game-session-123" } },
242
255
  });
@@ -251,7 +264,7 @@ OpenAI/codex route only, `generateText` only. Enables codex's built-in `image_ge
251
264
 
252
265
  ```typescript
253
266
  const result = await generateText({
254
- model: qgrid("openai/gpt-5.4"),
267
+ model: qgrid("openai/gpt-5.6-terra"),
255
268
  prompt: "An illustration of a whale flying through space",
256
269
  providerOptions: {
257
270
  qgrid: {
@@ -268,7 +281,7 @@ Reference images can be passed through normal AI SDK multimodal message parts:
268
281
 
269
282
  ```typescript
270
283
  const result = await generateText({
271
- model: qgrid("openai/gpt-5.4"),
284
+ model: qgrid("openai/gpt-5.6-terra"),
272
285
  messages: [
273
286
  {
274
287
  role: "user",
@@ -367,6 +380,7 @@ type QgridSupportedModel =
367
380
  | "openai/gpt-5.3-codex"
368
381
  | "openai/gpt-5.3-codex-spark"
369
382
  // Anthropic
383
+ | "anthropic/claude-fable-5-1"
370
384
  | "anthropic/claude-fable-5"
371
385
  | "anthropic/claude-haiku-4-5"
372
386
  | "anthropic/claude-sonnet-4"
@@ -383,6 +397,8 @@ type QgridSupportedModel =
383
397
  | "anthropic/claude-opus-5"
384
398
  ```
385
399
 
400
+ `openai/gpt-5.4`, `openai/gpt-5.4-mini`, `openai/gpt-5.2`, and `openai/gpt-5.3-codex` remain in the type for backward compatibility, but the ChatGPT-subscription Codex route that qgrid uses no longer serves them. `gpt-5.4` and `gpt-5.4-mini` retired on 2026-08-31 (replacements: `openai/gpt-5.6-terra` and `openai/gpt-5.6-luna`); `gpt-5.2` and `gpt-5.3-codex` were removed from that route earlier. Requests for these ids fail at the backend.
401
+
386
402
  ### GPT-5.6 specifications
387
403
 
388
404
  | Model | Context (qgrid OpenAI route) | Max output | Input / cached input / output per 1M tokens |
@@ -395,9 +411,11 @@ All GPT-5.6 models support reasoning through `max`. Qgrid retains the observed s
395
411
 
396
412
  `anthropic/claude-fable-5` has a 1M context window and 128K max output. Its standard prices per 1M tokens are $10 input, $1 cache read, $12.50 five-minute cache write, $20 one-hour cache write, and $50 output. qgrid preserves Claude's 5m/1h cache-creation breakdown and prices each TTL separately; only legacy responses without that breakdown fall back to the one-hour TTL automatically selected by Claude Code on subscription OAuth. Fable requires always-on adaptive thinking, so qgrid preserves adaptive thinking for this model.
397
413
 
414
+ `anthropic/claude-fable-5-1` (released 2026-09-01) shares Fable 5's 1M context window, 128K max output, always-on adaptive thinking, and $10 input / $50 output pricing. Its cache reads cost $0.25 per 1M tokens (0.025x the input price) instead of Fable 5's $1; cache writes stay at $12.50 (5m) and $20 (1h). Fable 5.1's API-level breaking changes (forced `tool_choice` rejection, model-bound thinking blocks) do not affect qgrid, which runs Claude Code with tools disabled and replays history as flattened text in a fresh process.
415
+
398
416
  `anthropic/claude-opus-5` has a default 1M context window and 128K max output. Its prices per 1M tokens are $5 input, $0.50 cache read, $6.25 five-minute cache write, $10 one-hour cache write, and $25 output. qgrid keeps Opus 5's default adaptive thinking behavior and uses `effort` to control reasoning depth. This also avoids the invalid `thinking: disabled` combination at `xhigh` or `max` effort.
399
417
 
400
- Claude Code may automatically retry a Fable safety refusal on Opus 4.8. In that case, the AI SDK response's `response.modelId` and `providerMetadata.qgrid.model` identify Opus as the actual serving model. `providerMetadata.qgrid.requestedModel` remains Fable, and `providerMetadata.qgrid.modelFallbacks` contains the refusal fallback history. The metadata also exposes `costSource` and the 5m/1h cache-write token split.
418
+ Claude Code may automatically retry a Fable safety refusal on another Opus model; the current CLI picks Opus 5 or Opus 4.8 by refusal category. In that case, the AI SDK response's `response.modelId` and `providerMetadata.qgrid.model` identify Opus as the actual serving model. `providerMetadata.qgrid.requestedModel` remains Fable, and `providerMetadata.qgrid.modelFallbacks` contains the refusal fallback history. The metadata also exposes `costSource` and the 5m/1h cache-write token split.
401
419
 
402
420
  `openai/gpt-5.3-codex-spark` remains a research preview without final published per-token rates. qgrid therefore reports its generic fallback estimate rather than presenting that estimate as official pricing.
403
421
 
package/dist/index.d.ts CHANGED
@@ -12,6 +12,10 @@ type QgridProviderConfig = {
12
12
  * providerOptions.qgrid 로 전달한다.
13
13
  */
14
14
  type QgridProviderOptions = {
15
+ /**
16
+ * 이 요청을 처리할 활성 qgrid 토큰 이름. provider prefix를 포함해야 하며 다른 토큰으로 fallback하지 않는다.
17
+ */
18
+ tokenName?: string;
15
19
  /**
16
20
  * qgrid request log 저장 여부. 기본값은 true.
17
21
  * false여도 client tool 실행과 multi-step 연결은 계속 동작한다.
@@ -58,7 +62,7 @@ type QgridProviderOptions = {
58
62
  size?: "1024x1024" | "1024x1536" | "1536x1024";
59
63
  };
60
64
  };
61
- type QgridSupportedModel = "openai/gpt-5.6-sol" | "openai/gpt-5.6-terra" | "openai/gpt-5.6-luna" | "openai/gpt-5.5" | "openai/gpt-5.4" | "openai/gpt-5.2" | "openai/gpt-5.4-mini" | "openai/gpt-5.3-codex" | "openai/gpt-5.3-codex-spark" | "anthropic/claude-fable-5" | "anthropic/claude-haiku-4-5" | "anthropic/claude-sonnet-4" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-sonnet-4-6" | "anthropic/claude-sonnet-4-7" | "anthropic/claude-sonnet-5" | "anthropic/claude-opus-4" | "anthropic/claude-opus-4-1" | "anthropic/claude-opus-4-5" | "anthropic/claude-opus-4-6" | "anthropic/claude-opus-4-7" | "anthropic/claude-opus-4-8" | "anthropic/claude-opus-5";
65
+ type QgridSupportedModel = "openai/gpt-5.6-sol" | "openai/gpt-5.6-terra" | "openai/gpt-5.6-luna" | "openai/gpt-5.5" | "openai/gpt-5.4" | "openai/gpt-5.2" | "openai/gpt-5.4-mini" | "openai/gpt-5.3-codex" | "openai/gpt-5.3-codex-spark" | "anthropic/claude-fable-5-1" | "anthropic/claude-fable-5" | "anthropic/claude-haiku-4-5" | "anthropic/claude-sonnet-4" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-sonnet-4-6" | "anthropic/claude-sonnet-4-7" | "anthropic/claude-sonnet-5" | "anthropic/claude-opus-4" | "anthropic/claude-opus-4-1" | "anthropic/claude-opus-4-5" | "anthropic/claude-opus-4-6" | "anthropic/claude-opus-4-7" | "anthropic/claude-opus-4-8" | "anthropic/claude-opus-5";
62
66
  type QgridLoggerConfig = {
63
67
  /** qgrid 서버 주소. default: process.env.QGRID_URL, 없으면 기본값은 "http://localhost:44900" */
64
68
  serverUrl?: string;
package/dist/index.js CHANGED
@@ -1075,7 +1075,9 @@ function qgridProviderMetadata(data) {
1075
1075
  } };
1076
1076
  }
1077
1077
  function getQgridProviderOptions(options) {
1078
- return options.providerOptions?.qgrid ?? {};
1078
+ const qgridOptions = options.providerOptions?.qgrid ?? {};
1079
+ if (qgridOptions.tokenName !== void 0 && qgridOptions.tokenName.trim() === "") throw new Error("qgrid: tokenName must not be empty");
1080
+ return qgridOptions;
1079
1081
  }
1080
1082
  function toAiSdkUsage(usage) {
1081
1083
  const cacheRead = usage.cache_read_input_tokens;
@@ -1150,6 +1152,7 @@ function qgrid(modelId, config) {
1150
1152
  const serviceTier = qgridOptions.serviceTier;
1151
1153
  const timeoutMs = qgridOptions.timeoutMs;
1152
1154
  const logger = qgridOptions.logger;
1155
+ const tokenName = qgridOptions.tokenName;
1153
1156
  const imageGenerationOptions = qgridOptions.imageGenerationOptions;
1154
1157
  if (imageGeneration) assertImageInputFitsJsonTransport(imageUrls);
1155
1158
  const sessionKey = qgridOptions.sessionKey;
@@ -1184,6 +1187,7 @@ function qgrid(modelId, config) {
1184
1187
  ...projectName ? { projectName } : {},
1185
1188
  ...cacheAffinityKey ? { cacheAffinityKey } : {},
1186
1189
  ...logger === false ? { logger: false } : {},
1190
+ ...tokenName ? { tokenName } : {},
1187
1191
  ...runContext ? { runContext } : {},
1188
1192
  ...toolResultsPayload ? { toolResults: toolResultsPayload } : {},
1189
1193
  ...imageGeneration ? { imageGeneration } : {},
@@ -1254,6 +1258,7 @@ function qgrid(modelId, config) {
1254
1258
  const serviceTier = qgridOptions.serviceTier;
1255
1259
  const timeoutMs = qgridOptions.timeoutMs;
1256
1260
  const logger = qgridOptions.logger;
1261
+ const tokenName = qgridOptions.tokenName;
1257
1262
  if (qgridOptions.imageGeneration) throw new Error("qgrid: imageGeneration is not supported with streamText — use generateText instead.");
1258
1263
  const { prompt, system, history, droppedImageCount } = extractPromptAndHistory(options.prompt, { includeImages: false });
1259
1264
  warnDroppedImages(droppedImageCount);
@@ -1287,6 +1292,7 @@ function qgrid(modelId, config) {
1287
1292
  ...projectName ? { projectName } : {},
1288
1293
  ...cacheAffinityKey ? { cacheAffinityKey } : {},
1289
1294
  ...logger === false ? { logger: false } : {},
1295
+ ...tokenName ? { tokenName } : {},
1290
1296
  ...runContext ? { runContext } : {},
1291
1297
  ...toolResultsPayload ? { toolResults: toolResultsPayload } : {}
1292
1298
  } }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartanova/qgrid-ai-sdk",
3
- "version": "2.7.9",
3
+ "version": "2.9.0",
4
4
  "description": "AI SDK LanguageModelV3 provider for qgrid",
5
5
  "repository": {
6
6
  "type": "git",