@cartanova/qgrid-ai-sdk 2.5.1 → 2.5.3
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 +6 -0
- package/README.md +7 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -168,10 +168,16 @@ const { text } = await generateText({
|
|
|
168
168
|
| `verbosity` | `"low"` \| `"medium"` \| `"high"` | OpenAI 전용 | 응답 텍스트의 상세도 |
|
|
169
169
|
| `reasoningSummary` | `"auto"` \| `"concise"` \| `"detailed"` \| `"none"` | OpenAI 전용 | 추론 요약 출력 방식 |
|
|
170
170
|
| `serviceTier` | `string` | OpenAI 전용 | OpenAI/codex service tier |
|
|
171
|
+
| `timeoutMs` | 양의 정수, 최대 `1_800_000` | Anthropic 전용 | 서버의 Claude Code 프로세스 제한시간(ms). 기본값은 240초 |
|
|
171
172
|
| `imageGeneration` | `boolean` | OpenAI 전용, non-stream | codex 내장 `image_generation` tool 활성화 ([아래](#image-generation) 참조) |
|
|
172
173
|
| `imageGenerationOptions` | `{ quality?, size? }` | OpenAI 전용 | 이미지 품질/크기 힌트. `quality: "low" \| "medium" \| "high"`, `size: "1024x1024" \| "1024x1536" \| "1536x1024"` (기본: `medium` / `1536x1024`) |
|
|
173
174
|
| `fallbackModels` | `string[]` | 예약 | 향후 qgrid 서버 fallback routing용 예약 필드. 현재 동작하지 않으며 Claude Code의 Fable refusal fallback과 무관 |
|
|
174
175
|
|
|
176
|
+
AI SDK 최상위 `timeout`은 전체 클라이언트 제한시간이며 custom provider 실행 전에
|
|
177
|
+
`AbortSignal`로 변환됩니다. 따라서 그 숫자 자체는 qgrid에 전달되지 않습니다. qgrid 서버의
|
|
178
|
+
Claude Code 프로세스 제한시간을 바꾸려면 `providerOptions.qgrid.timeoutMs`를 사용하세요.
|
|
179
|
+
클라이언트 취소 또는 비스트리밍 HTTP 연결 종료도 서버의 provider 실행을 중단합니다.
|
|
180
|
+
|
|
175
181
|
### 멀티턴 prompt cache (sessionKey)
|
|
176
182
|
|
|
177
183
|
멀티턴 대화에서 `sessionKey`로 호출자의 도메인 ID(게임 세션 ID, 채팅방 ID 등) 하나만 넘기면, provider가 같은 대화를 같은 codex thread로 라우팅하여 prompt cache를 적중시킵니다. thread 좌표의 발급/보관/회송은 provider 내부에서 처리하므로 호출자는 key만 넘기면 됩니다.
|
package/README.md
CHANGED
|
@@ -168,10 +168,17 @@ const { text } = await generateText({
|
|
|
168
168
|
| `verbosity` | `"low"` \| `"medium"` \| `"high"` | OpenAI only | Response text verbosity |
|
|
169
169
|
| `reasoningSummary` | `"auto"` \| `"concise"` \| `"detailed"` \| `"none"` | OpenAI only | Reasoning summary output mode |
|
|
170
170
|
| `serviceTier` | `string` | OpenAI only | OpenAI/codex service tier |
|
|
171
|
+
| `timeoutMs` | positive integer, max `1_800_000` | Anthropic only | Server-side Claude Code process timeout in milliseconds. Defaults to 240 seconds |
|
|
171
172
|
| `imageGeneration` | `boolean` | OpenAI only, non-stream | Enables codex's built-in `image_generation` tool (see [below](#image-generation)) |
|
|
172
173
|
| `imageGenerationOptions` | `{ quality?, size? }` | OpenAI only | Image quality/size hints. `quality: "low" \| "medium" \| "high"`, `size: "1024x1024" \| "1024x1536" \| "1536x1024"` (defaults: `medium` / `1536x1024`) |
|
|
173
174
|
| `fallbackModels` | `string[]` | reserved | Reserved for future qgrid server-side fallback routing. Not functional yet and unrelated to Claude Code's Fable refusal fallback |
|
|
174
175
|
|
|
176
|
+
AI SDK's top-level `timeout` remains the overall client-side budget and is converted to an
|
|
177
|
+
`AbortSignal` before the custom provider runs. It does not expose the numeric timeout to qgrid.
|
|
178
|
+
Use `providerOptions.qgrid.timeoutMs` when the qgrid server's Claude Code process needs a different
|
|
179
|
+
limit. A client abort or disconnected non-streaming HTTP request also terminates the server-side
|
|
180
|
+
provider execution.
|
|
181
|
+
|
|
175
182
|
### Multi-turn prompt cache (sessionKey)
|
|
176
183
|
|
|
177
184
|
For multi-turn conversations, pass a single caller-side domain ID (game session ID, chat room ID, ...) as `sessionKey` and the provider routes the same conversation to the same codex thread, hitting the prompt cache. Thread coordinate issuance/storage/replay is handled inside the provider — the caller only passes the key.
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,12 @@ type QgridProviderOptions = {
|
|
|
31
31
|
reasoningSummary?: "auto" | "concise" | "detailed" | "none";
|
|
32
32
|
/** OpenAI/codex service tier. OpenAI/codex route에서만 적용된다. */
|
|
33
33
|
serviceTier?: string;
|
|
34
|
+
/**
|
|
35
|
+
* qgrid 서버의 provider 실행 제한(ms). Anthropic 경로에서는 Claude Code 프로세스 타이머로
|
|
36
|
+
* 사용된다. AI SDK 표준 timeout은 provider에 숫자를 전달하지 않고 abortSignal로 변환되므로,
|
|
37
|
+
* 서버 측 제한을 바꾸려면 이 옵션을 사용한다. 양의 정수만 허용하며 최대 30분, 기본 240초다.
|
|
38
|
+
*/
|
|
39
|
+
timeoutMs?: number;
|
|
34
40
|
/**
|
|
35
41
|
* @todo 향후 qgrid 서버 fallback routing에 사용할 후보 모델 목록.
|
|
36
42
|
* Claude Code가 처리하는 Fable 5 safety-refusal fallback과는 무관하다.
|
package/dist/index.js
CHANGED
|
@@ -782,6 +782,7 @@ function qgrid(modelId, config) {
|
|
|
782
782
|
const verbosity = qgridOptions.verbosity;
|
|
783
783
|
const reasoningSummary = qgridOptions.reasoningSummary;
|
|
784
784
|
const serviceTier = qgridOptions.serviceTier;
|
|
785
|
+
const timeoutMs = qgridOptions.timeoutMs;
|
|
785
786
|
const logger = qgridOptions.logger;
|
|
786
787
|
const imageGenerationOptions = qgridOptions.imageGenerationOptions;
|
|
787
788
|
if (imageGeneration) assertImageInputFitsJsonTransport(imageUrls);
|
|
@@ -812,6 +813,7 @@ function qgrid(modelId, config) {
|
|
|
812
813
|
...verbosity ? { verbosity } : {},
|
|
813
814
|
...reasoningSummary ? { reasoningSummary } : {},
|
|
814
815
|
...serviceTier ? { serviceTier } : {},
|
|
816
|
+
...timeoutMs !== void 0 ? { timeout: timeoutMs } : {},
|
|
815
817
|
...hasTools ? { tools: tools.map(toQgridTool) } : {},
|
|
816
818
|
...jsonSchema ? { jsonSchema } : {},
|
|
817
819
|
...history.length > 0 ? { history: JSON.stringify(history) } : {},
|
|
@@ -880,6 +882,7 @@ function qgrid(modelId, config) {
|
|
|
880
882
|
const verbosity = qgridOptions.verbosity;
|
|
881
883
|
const reasoningSummary = qgridOptions.reasoningSummary;
|
|
882
884
|
const serviceTier = qgridOptions.serviceTier;
|
|
885
|
+
const timeoutMs = qgridOptions.timeoutMs;
|
|
883
886
|
const logger = qgridOptions.logger;
|
|
884
887
|
if (qgridOptions.imageGeneration) throw new Error("qgrid: imageGeneration is not supported with streamText — use generateText instead.");
|
|
885
888
|
const { prompt, system, history, droppedImageCount } = extractPromptAndHistory(options.prompt, { includeImages: false });
|
|
@@ -908,6 +911,7 @@ function qgrid(modelId, config) {
|
|
|
908
911
|
...verbosity ? { verbosity } : {},
|
|
909
912
|
...reasoningSummary ? { reasoningSummary } : {},
|
|
910
913
|
...serviceTier ? { serviceTier } : {},
|
|
914
|
+
...timeoutMs !== void 0 ? { timeout: timeoutMs } : {},
|
|
911
915
|
...hasTools ? { tools: tools.map(toQgridTool) } : {},
|
|
912
916
|
...jsonSchema ? { jsonSchema } : {},
|
|
913
917
|
...history.length > 0 ? { history: JSON.stringify(history) } : {},
|