@cartanova/qgrid-ai-sdk 2.9.1 → 2.9.4
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 +21 -7
- package/README.md +21 -7
- package/dist/index.d.ts +60 -28
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -204,7 +204,8 @@ const { text } = await generateText({
|
|
|
204
204
|
| `tokenName` | provider prefix를 포함한 토큰 이름 | 공통 | `anthropic/yds`처럼 활성 토큰 하나를 엄격히 지정. prefix는 model provider와 같아야 하며 빈 값·누락·inactive·quota 초과 시 다른 토큰으로 fallback하지 않음 |
|
|
205
205
|
| `logger` | `boolean` | 공통 | qgrid request log 저장 여부. 기본값은 `true`. `false`로 설정해도 client tool 실행과 multi-step 연결은 계속 동작 |
|
|
206
206
|
| `sessionKey` | `string` | OpenAI 전용 | 전체 history 재전송 시 불투명 prompt-cache affinity를 파생하는 멀티턴 대화 식별자 ([아래](#멀티턴-prompt-cache-sessionkey) 참조) |
|
|
207
|
-
| `effort` | `"
|
|
207
|
+
| `effort` | OpenAI: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` \| `"ultra"` | OpenAI 전용 (`QgridOpenAIProviderOptions`) | ChatGPT 구독 Codex 경로의 reasoning 깊이. GPT-6 Astra와 GPT-5.6 Sol/Terra는 `"ultra"`까지, GPT-5.6 Luna는 `"max"`까지 지원하며, 모델이 지원하지 않는 값은 서버가 조용히 무시하고 백엔드 기본값을 적용. 공개 OpenAI API의 `"none"`/`"minimal"`은 이 경로에 없음 |
|
|
208
|
+
| `effort` | Anthropic: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | Anthropic 전용 (`QgridAnthropicProviderOptions`) | Claude Code `--effort` 허용값. 집합 밖의 값은 서버가 조용히 무시하고 qgrid 기본(`"low"`)을 적용. 모델별 상한(예: Sonnet 4.6은 `"xhigh"` 없음)은 Claude Code가 처리 |
|
|
208
209
|
| `verbosity` | `"low"` \| `"medium"` \| `"high"` | OpenAI 전용 | 응답 텍스트의 상세도 |
|
|
209
210
|
| `reasoningSummary` | `"auto"` \| `"concise"` \| `"detailed"` \| `"none"` | OpenAI 전용 | 추론 요약 출력 방식 |
|
|
210
211
|
| `serviceTier` | `string` | OpenAI 전용 | OpenAI/codex service tier |
|
|
@@ -360,6 +361,7 @@ AI SDK response metadata로 실제 serving 모델을 다르게 보고하면 step
|
|
|
360
361
|
```typescript
|
|
361
362
|
type QgridSupportedModel =
|
|
362
363
|
// OpenAI (direct private Codex Responses backend)
|
|
364
|
+
| "openai/gpt-6-astra"
|
|
363
365
|
| "openai/gpt-5.6-sol"
|
|
364
366
|
| "openai/gpt-5.6-terra"
|
|
365
367
|
| "openai/gpt-5.6-luna"
|
|
@@ -389,15 +391,25 @@ type QgridSupportedModel =
|
|
|
389
391
|
|
|
390
392
|
`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
393
|
|
|
394
|
+
### GPT-6 Astra 사양
|
|
395
|
+
|
|
396
|
+
| 모델 | Context (Codex 카탈로그) | 최대 출력 (공개 API) | 1M tokens당 input / cached input / output |
|
|
397
|
+
|---|---:|---:|---:|
|
|
398
|
+
| `openai/gpt-6-astra` | 272K | 128K | $10 / $1 / $50 |
|
|
399
|
+
|
|
400
|
+
2026-09-07에 조회한 Codex 카탈로그는 272K context window와 `low`, `medium`, `high`, `xhigh`, `max`, `ultra` reasoning effort를 제공합니다(백엔드 기본값: `medium`). Qgrid SDK의 기본값은 기존대로 `low`이며, 다른 깊이가 필요하면 effort를 명시하세요. [공개 API 모델 문서](https://developers.openai.com/api/docs/models/gpt-6-astra)는 별도로 1.05M context, 최대 입력 922K, 최대 출력 128K와 `max`까지의 effort를 명시하며 `ultra`는 포함하지 않습니다. 이 공개 API 한도를 구독 경로의 한도로 간주하지 않습니다. Qgrid 비용 추정에는 [표준 API 단가](https://developers.openai.com/api/docs/pricing)를 사용합니다. Cache write는 1M tokens당 $12.50이며, 입력이 272K tokens를 넘으면 요청 전체에 input/cache 2x, output 1.5x 단가가 적용됩니다.
|
|
401
|
+
|
|
392
402
|
### GPT-5.6 사양
|
|
393
403
|
|
|
394
|
-
| 모델 | Context (
|
|
404
|
+
| 모델 | Context (Codex 카탈로그) | 최대 출력 (공개 API) | 1M tokens당 input / cached input / cache write / output |
|
|
395
405
|
|---|---:|---:|---:|
|
|
396
|
-
| `openai/gpt-5.6-sol` |
|
|
397
|
-
| `openai/gpt-5.6-terra` |
|
|
398
|
-
| `openai/gpt-5.6-luna` |
|
|
406
|
+
| `openai/gpt-5.6-sol` | 272K | 128K | $4 / $0.40 / $5 / $20 |
|
|
407
|
+
| `openai/gpt-5.6-terra` | 272K | 128K | $2 / $0.20 / $2.50 / $12 |
|
|
408
|
+
| `openai/gpt-5.6-luna` | 272K | 128K | $0.20 / $0.02 / $0.25 / $1.20 |
|
|
409
|
+
|
|
410
|
+
2026-09-07에 조회한 Codex 카탈로그는 세 모델 모두 272K context window를 제공합니다. Sol과 Terra는 `ultra`까지, Luna는 `max`까지 reasoning effort를 지원합니다. 백엔드 기본값은 Sol이 `low`, Terra와 Luna가 `medium`이며, qgrid SDK의 기본값은 세 모델 모두 `low`입니다. [Sol](https://developers.openai.com/api/docs/models/gpt-5.6-sol), [Terra](https://developers.openai.com/api/docs/models/gpt-5.6-terra), [Luna](https://developers.openai.com/api/docs/models/gpt-5.6-luna)의 공개 API 문서는 별도로 1.05M context, 최대 입력 922K, 최대 출력 128K를 명시합니다. 이 공개 API 한도를 구독 경로의 한도로 간주하지 않습니다.
|
|
399
411
|
|
|
400
|
-
|
|
412
|
+
Qgrid 비용 추정에는 [표준 API 단가](https://developers.openai.com/api/docs/pricing)를 사용합니다. Sol의 표에 명시된 프로모션 가격은 최소 2026-11-21까지 제공되며, 이후 단가는 가정하지 않습니다. 입력이 272K tokens를 넘으면 요청 전체에 input/cache 2x, output 1.5x 단가가 적용됩니다. Cache write는 uncached input 단가의 1.25x입니다.
|
|
401
413
|
|
|
402
414
|
`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을 보존합니다.
|
|
403
415
|
|
|
@@ -414,11 +426,13 @@ Claude Code는 Fable의 safety refusal을 다른 Opus 모델로 자동 재시도
|
|
|
414
426
|
```typescript
|
|
415
427
|
qgrid(modelId, {
|
|
416
428
|
serverUrl?: string; // qgrid 서버 주소 (기본: QGRID_URL 환경변수 또는 http://localhost:44900)
|
|
417
|
-
defaultEffort?:
|
|
429
|
+
defaultEffort?: ...; // effort 기본값 (기본: "low"). 모델 ID prefix에 따라 provider 어휘로 타입 검사
|
|
418
430
|
projectName?: string; // request_logs.project_name (기본: QGRID_PROJECT_NAME 환경변수)
|
|
419
431
|
});
|
|
420
432
|
```
|
|
421
433
|
|
|
434
|
+
`qgrid()`는 모델 ID prefix로 오버로드되어 `openai/*`에는 `QgridOpenAIEffort`, `anthropic/*`에는 `QgridAnthropicEffort`가 `defaultEffort` 타입으로 적용됩니다. `providerOptions.qgrid`는 AI SDK 타입이 모델과 연결해 주지 않으므로 `QgridProviderOptions`는 `QgridOpenAIProviderOptions | QgridAnthropicProviderOptions`의 union이며, provider를 아는 호출자는 provider별 타입에 `satisfies`를 쓰는 편이 정확합니다.
|
|
435
|
+
|
|
422
436
|
여러 프로젝트/워크플로우가 한 qgrid 서버를 공유한다면 `QGRID_PROJECT_NAME`을 설정하세요. 대시보드에서 request log를 프로젝트별로 필터링하고 토큰/비용/캐시 지표를 워크로드별로 비교할 수 있습니다. config `projectName`은 특정 호출자만 다른 이름을 써야 할 때의 override 용도입니다.
|
|
423
437
|
|
|
424
438
|
## 환경변수
|
package/README.md
CHANGED
|
@@ -213,7 +213,8 @@ const { text } = await generateText({
|
|
|
213
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 |
|
|
214
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 |
|
|
215
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)) |
|
|
216
|
-
| `effort` | `"
|
|
216
|
+
| `effort` | OpenAI: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` \| `"ultra"` | OpenAI only (`QgridOpenAIProviderOptions`) | Reasoning depth on the ChatGPT-subscription Codex route. GPT-6 Astra and GPT-5.6 Sol/Terra support effort through `"ultra"`; GPT-5.6 Luna supports it through `"max"`; a value the model does not support is silently ignored by the server and the backend default applies. The public OpenAI API's `"none"`/`"minimal"` do not exist on this route |
|
|
217
|
+
| `effort` | Anthropic: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | Anthropic only (`QgridAnthropicProviderOptions`) | Claude Code `--effort` levels. Values outside this set are silently ignored and qgrid's default (`"low"`) applies; per-model limits (for example no `"xhigh"` on Sonnet 4.6) are handled by Claude Code |
|
|
217
218
|
| `verbosity` | `"low"` \| `"medium"` \| `"high"` | OpenAI only | Response text verbosity |
|
|
218
219
|
| `reasoningSummary` | `"auto"` \| `"concise"` \| `"detailed"` \| `"none"` | OpenAI only | Reasoning summary output mode |
|
|
219
220
|
| `serviceTier` | `string` | OpenAI only | OpenAI/codex service tier |
|
|
@@ -370,6 +371,7 @@ The `qgrid()` provider has its own lifecycle, so the logger automatically suppre
|
|
|
370
371
|
```typescript
|
|
371
372
|
type QgridSupportedModel =
|
|
372
373
|
// OpenAI (direct private Codex Responses backend)
|
|
374
|
+
| "openai/gpt-6-astra"
|
|
373
375
|
| "openai/gpt-5.6-sol"
|
|
374
376
|
| "openai/gpt-5.6-terra"
|
|
375
377
|
| "openai/gpt-5.6-luna"
|
|
@@ -399,15 +401,25 @@ type QgridSupportedModel =
|
|
|
399
401
|
|
|
400
402
|
`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
403
|
|
|
404
|
+
### GPT-6 Astra specifications
|
|
405
|
+
|
|
406
|
+
| Model | Context (Codex catalog) | Max output (public API) | Input / cached input / output per 1M tokens |
|
|
407
|
+
|---|---:|---:|---:|
|
|
408
|
+
| `openai/gpt-6-astra` | 272K | 128K | $10 / $1 / $50 |
|
|
409
|
+
|
|
410
|
+
The Codex catalog fetched on 2026-09-07 advertises a 272K context window and `low`, `medium`, `high`, `xhigh`, `max`, and `ultra` reasoning effort (backend default: `medium`). Qgrid's SDK still defaults to `low`; select an effort explicitly to override it. The [public API model page](https://developers.openai.com/api/docs/models/gpt-6-astra) separately lists a 1.05M context window, 922K maximum input, 128K maximum output, and reasoning effort through `max` (no `ultra`). Those public limits do not establish the subscription route's limits. [Standard API pricing](https://developers.openai.com/api/docs/pricing) is used for qgrid's cost estimate: cache writes cost $12.50 per 1M tokens, and input over 272K tokens applies 2x input/cache and 1.5x output rates to the full request.
|
|
411
|
+
|
|
402
412
|
### GPT-5.6 specifications
|
|
403
413
|
|
|
404
|
-
| Model | Context (
|
|
414
|
+
| Model | Context (Codex catalog) | Max output (public API) | Input / cached input / cache write / output per 1M tokens |
|
|
405
415
|
|---|---:|---:|---:|
|
|
406
|
-
| `openai/gpt-5.6-sol` |
|
|
407
|
-
| `openai/gpt-5.6-terra` |
|
|
408
|
-
| `openai/gpt-5.6-luna` |
|
|
416
|
+
| `openai/gpt-5.6-sol` | 272K | 128K | $4 / $0.40 / $5 / $20 |
|
|
417
|
+
| `openai/gpt-5.6-terra` | 272K | 128K | $2 / $0.20 / $2.50 / $12 |
|
|
418
|
+
| `openai/gpt-5.6-luna` | 272K | 128K | $0.20 / $0.02 / $0.25 / $1.20 |
|
|
419
|
+
|
|
420
|
+
The Codex catalog fetched on 2026-09-07 advertises a 272K context window for all three models. Sol and Terra support reasoning effort through `ultra`; Luna supports it through `max`. Backend defaults are `low` for Sol and `medium` for Terra and Luna, while qgrid's SDK defaults to `low` for all three. The public API model pages for [Sol](https://developers.openai.com/api/docs/models/gpt-5.6-sol), [Terra](https://developers.openai.com/api/docs/models/gpt-5.6-terra), and [Luna](https://developers.openai.com/api/docs/models/gpt-5.6-luna) separately list 1.05M context, 922K maximum input, and 128K maximum output; these do not establish the subscription route's limits.
|
|
409
421
|
|
|
410
|
-
|
|
422
|
+
Qgrid uses [Standard API pricing](https://developers.openai.com/api/docs/pricing) for cost estimates. Sol's listed promotional pricing is available at least through 2026-11-21; no later rate is assumed. Input over 272K tokens applies 2x input/cache and 1.5x output rates to the full request. Cache writes cost 1.25x the uncached input rate.
|
|
411
423
|
|
|
412
424
|
`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.
|
|
413
425
|
|
|
@@ -424,11 +436,13 @@ Claude Code may automatically retry a Fable safety refusal on another Opus model
|
|
|
424
436
|
```typescript
|
|
425
437
|
qgrid(modelId, {
|
|
426
438
|
serverUrl?: string; // qgrid server address (default: QGRID_URL env var, then http://localhost:44900)
|
|
427
|
-
defaultEffort?:
|
|
439
|
+
defaultEffort?: ...; // default effort (default: "low"); typed per provider from the model id prefix
|
|
428
440
|
projectName?: string; // request_logs.project_name (default: QGRID_PROJECT_NAME env var)
|
|
429
441
|
});
|
|
430
442
|
```
|
|
431
443
|
|
|
444
|
+
`qgrid()` is overloaded on the model id prefix, so `defaultEffort` accepts `QgridOpenAIEffort` for `openai/*` models and `QgridAnthropicEffort` for `anthropic/*` models. `providerOptions.qgrid` cannot be linked to the model by the AI SDK types, so `QgridProviderOptions` is the union of `QgridOpenAIProviderOptions` and `QgridAnthropicProviderOptions`; use the provider-specific type with `satisfies` when you know the provider.
|
|
445
|
+
|
|
432
446
|
If multiple projects/workflows share one qgrid server, set `QGRID_PROJECT_NAME`. It lets you filter request logs by project in the dashboard and compare token/cost/cache metrics per workload. The config-level `projectName` is an override for callers that need a different label.
|
|
433
447
|
|
|
434
448
|
## Environment variables
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
import { LanguageModelV3 } from "@ai-sdk/provider";
|
|
2
2
|
import { TelemetrySettings } from "ai";
|
|
3
3
|
//#region src/index.types.d.ts
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* OpenAI 경로(ChatGPT 구독 Codex 백엔드)의 reasoning effort. 백엔드 모델 카탈로그의
|
|
6
|
+
* supported_reasoning_levels 합집합이며, 공개 OpenAI API 의 `none`/`minimal` 은 이 경로에 없다.
|
|
7
|
+
* GPT-6 Astra와 GPT-5.6 Sol/Terra는 `ultra`, Luna는 `max`까지 지원한다.
|
|
8
|
+
* 모델이 지원하지 않는 값은 서버가 조용히 무시한다.
|
|
9
|
+
*/
|
|
10
|
+
type QgridOpenAIEffort = "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
11
|
+
/**
|
|
12
|
+
* Anthropic 경로(Claude Code `--effort`)의 reasoning effort. 모델별 상한(예: Sonnet 4.6 은 `xhigh`
|
|
13
|
+
* 없음)은 Claude Code 가 처리하고, 이 집합 밖의 값은 서버가 조용히 무시한다.
|
|
14
|
+
*/
|
|
15
|
+
type QgridAnthropicEffort = "low" | "medium" | "high" | "xhigh" | "max";
|
|
16
|
+
type QgridOpenAIModel = Extract<QgridSupportedModel, `openai/${string}`>;
|
|
17
|
+
type QgridAnthropicModel = Extract<QgridSupportedModel, `anthropic/${string}`>;
|
|
18
|
+
type QgridCommonProviderConfig = {
|
|
5
19
|
serverUrl?: string;
|
|
6
|
-
defaultEffort?: string;
|
|
7
20
|
/** request_logs.project_name. default: process.env.QGRID_PROJECT_NAME */
|
|
8
21
|
projectName?: string;
|
|
9
22
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
type QgridOpenAIProviderConfig = QgridCommonProviderConfig & {
|
|
24
|
+
defaultEffort?: QgridOpenAIEffort;
|
|
25
|
+
};
|
|
26
|
+
type QgridAnthropicProviderConfig = QgridCommonProviderConfig & {
|
|
27
|
+
defaultEffort?: QgridAnthropicEffort;
|
|
28
|
+
};
|
|
29
|
+
/** `qgrid()` 는 모델 ID prefix 로 오버로드되므로 보통 provider 별 타입이 추론된다. */
|
|
30
|
+
type QgridProviderConfig = QgridOpenAIProviderConfig | QgridAnthropicProviderConfig;
|
|
31
|
+
type QgridCommonProviderOptions = {
|
|
15
32
|
/**
|
|
16
33
|
* 이 요청을 처리할 활성 qgrid 토큰 이름. provider prefix를 포함해야 하며 다른 토큰으로 fallback하지 않는다.
|
|
17
34
|
*/
|
|
@@ -21,34 +38,30 @@ type QgridProviderOptions = {
|
|
|
21
38
|
* false여도 client tool 실행과 multi-step 연결은 계속 동작한다.
|
|
22
39
|
*/
|
|
23
40
|
logger?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @todo 향후 qgrid 서버 fallback routing에 사용할 후보 모델 목록.
|
|
43
|
+
* Claude Code가 처리하는 Fable safety-refusal fallback과는 무관하다.
|
|
44
|
+
*/
|
|
45
|
+
fallbackModels?: string[];
|
|
46
|
+
};
|
|
47
|
+
/** `providerOptions.qgrid` — OpenAI(Codex) 모델용. */
|
|
48
|
+
type QgridOpenAIProviderOptions = QgridCommonProviderOptions & {
|
|
24
49
|
/**
|
|
25
50
|
* 멀티턴 프롬프트 캐시 어피니티용 대화 식별자, 호출자가 자기 도메인 ID(예: 게임 세션 ID) 하나만 넘기면
|
|
26
51
|
* provider가 model+sessionKey에서 opaque cache affinity를 결정적으로 파생해 회송한다.
|
|
27
52
|
* 원문 sessionKey는 서버에 전송하지 않으며 좌표는 model+sessionKey 별로 격리된다.
|
|
28
53
|
*/
|
|
29
54
|
sessionKey?: string;
|
|
30
|
-
/** reasoning
|
|
31
|
-
effort?:
|
|
32
|
-
/** 응답 텍스트의 상세도.
|
|
55
|
+
/** reasoning 깊이. 기본값은 qgrid config의 defaultEffort. 모델이 지원하지 않는 값은 서버가 무시한다. */
|
|
56
|
+
effort?: QgridOpenAIEffort;
|
|
57
|
+
/** 응답 텍스트의 상세도. */
|
|
33
58
|
verbosity?: "low" | "medium" | "high";
|
|
34
|
-
/** reasoning
|
|
59
|
+
/** reasoning 요약 출력 방식. */
|
|
35
60
|
reasoningSummary?: "auto" | "concise" | "detailed" | "none";
|
|
36
|
-
/**
|
|
61
|
+
/** Codex service tier. */
|
|
37
62
|
serviceTier?: string;
|
|
38
63
|
/**
|
|
39
|
-
*
|
|
40
|
-
* 사용되며, SDK의 non-stream 요청별 HTTP headers/body timeout은 이 값보다 60초 길게 설정된다.
|
|
41
|
-
* AI SDK 표준 timeout은 provider에 숫자를 전달하지 않고 abortSignal로 변환되므로, 서버 측
|
|
42
|
-
* 제한을 바꾸려면 이 옵션을 사용한다. 양의 정수만 허용하며 최대 30분, 기본 240초다.
|
|
43
|
-
*/
|
|
44
|
-
timeoutMs?: number;
|
|
45
|
-
/**
|
|
46
|
-
* @todo 향후 qgrid 서버 fallback routing에 사용할 후보 모델 목록.
|
|
47
|
-
* Claude Code가 처리하는 Fable 5 safety-refusal fallback과는 무관하다.
|
|
48
|
-
*/
|
|
49
|
-
fallbackModels?: string[];
|
|
50
|
-
/**
|
|
51
|
-
* OpenAI Responses image_generation tool 을 켠다. OpenAI route + non-stream 전용.
|
|
64
|
+
* OpenAI Responses image_generation tool 을 켠다. non-stream 전용.
|
|
52
65
|
* generateText 결과의 files 로 이미지를 받는다. streaming(streamText)에서는 거부된다.
|
|
53
66
|
*/
|
|
54
67
|
imageGeneration?: boolean;
|
|
@@ -62,7 +75,25 @@ type QgridProviderOptions = {
|
|
|
62
75
|
size?: "1024x1024" | "1024x1536" | "1536x1024";
|
|
63
76
|
};
|
|
64
77
|
};
|
|
65
|
-
|
|
78
|
+
/** `providerOptions.qgrid` — Anthropic(Claude Code) 모델용. */
|
|
79
|
+
type QgridAnthropicProviderOptions = QgridCommonProviderOptions & {
|
|
80
|
+
/** reasoning 깊이. 기본값은 qgrid config의 defaultEffort. 집합 밖의 값은 서버가 무시한다. */
|
|
81
|
+
effort?: QgridAnthropicEffort;
|
|
82
|
+
/**
|
|
83
|
+
* qgrid 서버의 provider 실행 제한(ms). Claude Code 프로세스 타이머로 사용되며, SDK의 non-stream
|
|
84
|
+
* 요청별 HTTP headers/body timeout은 이 값보다 60초 길게 설정된다. AI SDK 표준 timeout은
|
|
85
|
+
* provider에 숫자를 전달하지 않고 abortSignal로 변환되므로, 서버 측 제한을 바꾸려면 이 옵션을
|
|
86
|
+
* 사용한다. 양의 정수만 허용하며 최대 30분, 기본 240초다.
|
|
87
|
+
*/
|
|
88
|
+
timeoutMs?: number;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* `providerOptions.qgrid` 의 공용 타입. AI SDK 의 providerOptions 는 모델과 연결되지 않은 JSON
|
|
92
|
+
* 레코드라 여기서는 두 provider 타입의 union 이다. provider 를 아는 호출자는
|
|
93
|
+
* `QgridOpenAIProviderOptions` / `QgridAnthropicProviderOptions` 를 직접 쓰는 편이 정확하다.
|
|
94
|
+
*/
|
|
95
|
+
type QgridProviderOptions = QgridOpenAIProviderOptions | QgridAnthropicProviderOptions;
|
|
96
|
+
type QgridSupportedModel = "openai/gpt-6-astra" | "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";
|
|
66
97
|
type QgridLoggerConfig = {
|
|
67
98
|
/** qgrid 서버 주소. default: process.env.QGRID_URL, 없으면 기본값은 "http://localhost:44900" */
|
|
68
99
|
serverUrl?: string;
|
|
@@ -95,6 +126,7 @@ type QgridLoggerConfig = {
|
|
|
95
126
|
declare function createQgridLogger(config?: QgridLoggerConfig): TelemetrySettings;
|
|
96
127
|
//#endregion
|
|
97
128
|
//#region src/index.d.ts
|
|
98
|
-
declare function qgrid(modelId:
|
|
129
|
+
declare function qgrid(modelId: QgridOpenAIModel, config?: QgridOpenAIProviderConfig): LanguageModelV3;
|
|
130
|
+
declare function qgrid(modelId: QgridAnthropicModel, config?: QgridAnthropicProviderConfig): LanguageModelV3;
|
|
99
131
|
//#endregion
|
|
100
|
-
export { type QgridLoggerConfig, type QgridProviderOptions, type QgridSupportedModel, createQgridLogger, qgrid as default, qgrid };
|
|
132
|
+
export { type QgridAnthropicEffort, type QgridAnthropicModel, type QgridAnthropicProviderConfig, type QgridAnthropicProviderOptions, type QgridLoggerConfig, type QgridOpenAIEffort, type QgridOpenAIModel, type QgridOpenAIProviderConfig, type QgridOpenAIProviderOptions, type QgridProviderConfig, type QgridProviderOptions, type QgridSupportedModel, createQgridLogger, qgrid as default, qgrid };
|