@cartanova/qgrid-ai-sdk 2.10.4 → 2.10.5

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
@@ -308,11 +308,12 @@ const result = await generateText({
308
308
  - `streamText`에서는 거부됩니다 (non-stream 전용).
309
309
  - 이미지 생성 요청은 provider 대화 상태를 보관하지 않고 전체 input을 직접 전송합니다.
310
310
  - 레퍼런스 이미지는 JSON data URL로 전송됩니다. 큰 사진은 압축하거나 리사이즈해서 전달하세요. 과도하게 큰 base64 입력은 SDK가 거부하며, 사진에는 WebP/JPEG를 권장합니다.
311
- - 이미지 비용은 `gpt-image-2` 공개 단가표 기반 **추정치**로 request log의 `image_cost_usd`에 별도 기록됩니다 (codex가 정확한 이미지 tool 사용량을 노출하지 않음).
311
+ - 일반 Responses 이미지 비용은 알 수 없어 `image_cost_usd: null`로 기록합니다. 요청한 크기·품질이나 텍스트 모델 사용량을 이미지 비용으로 간주하지 않습니다. 출력 metadata가 없는 기존 응답만 세 가지 표준 크기의 공개 가격표 추정을 유지하며, 임의 크기와 `auto`는 추정하지 않습니다.
312
312
  - `imageGenerationOptions.background`는 `"auto" | "opaque" | "transparent"`를 지원합니다. `"transparent"` 요청만 기존 ChatGPT 구독 토큰으로 Codex 전용 `images/generations` 또는 `images/edits` 경로를 사용합니다. 나머지는 기존 Responses 도구 경로를 유지합니다. 투명 경로는 텍스트 모델 없이 `gpt-image-2`를 직접 실행하며, tools·structured output은 지원하지 않습니다. 레퍼런스는 최대 5장입니다. 불투명·완전 빈 이미지·손상된 PNG는 오류로 처리하고, 별도 배경 제거로 대체하지 않습니다.
313
- - 실제 출력 정보는 `result.providerMetadata.qgrid.imageGeneration` 배열에 있습니다(`contentIndex`, `model`, `route`, `size`, `quality`, `background`, 이미지 `usage`). `result.content` 파일 파트에도 metadata가 있지만 `result.files[]`에는 없습니다. 실호출에서 `1024x1024`/`high` 요청이 `1254x1254`/`medium`으로 반환됐으므로, 요청값을 최종 출력값으로 간주하면 안 됩니다. qgrid는 실제 PNG 크기를 보고하며 리사이즈하지 않습니다.
313
+ - 두 경로 모두 `result.providerMetadata.qgrid.imageGeneration` 배열로 출력 정보를 제공합니다. `contentIndex`, `route`와 선택적인 `model`, `size`, `quality`, `background`, 이미지 `usage`가 포함됩니다. 경로는 `codex-responses` 또는 `codex-images`이며, 일반 경로에서 보고되지 않은 이미지 모델은 비워 둡니다. `result.content` 파일 파트에도 metadata가 있지만 `result.files[]`에는 없습니다. PNG 크기는 실제 바이트에서 읽고, JPEG/WebP는 백엔드가 보고한 출력 크기를 사용합니다. qgrid는 리사이즈하지 않습니다.
314
+ - `imageGenerationOptions.size`는 `"auto"` 또는 `"1152x2560"` 같은 양의 정수 `가로x세로` 힌트를 받습니다. 정확한 출력 크기를 보장하지 않으므로 생략하거나 `auto`를 사용하고, 원하는 비율은 프롬프트에 적으세요. 2026-10-13 실호출에서 두 구독 경로 모두 크기 옵션을 무시했고, 9:20 요청은 `841x1870`, 4K 세로 요청은 `941x1672`, 4:1 요청은 3:1로 반환됐습니다. 약 157만 픽셀이라는 관측값은 모든 계정의 고정 상한이 아닙니다. 공개 Images API의 16배수·4K 규칙도 구독 경로의 보장 사양이 아닙니다. 확장된 크기 힌트와 일반 이미지 metadata를 사용하려면 서버와 SDK를 함께 업데이트하세요.
314
315
  - 투명 경로는 텍스트 모델을 실행하지 않아 일반 토큰 usage·비용이 0입니다. 이미지 usage는 별도로 보존하고, `image_cost_usd`는 보고된 토큰과 공개 API 단가로 추정합니다. 알려진 text/image input은 구분하고 불명확한 input은 보수적으로 계산하며, 캐시 할인은 반영하지 않습니다. 구독 청구액을 뜻하지 않습니다.
315
- - 명시한 이미지 옵션은 이미지 도구 로그의 `requestedOptions`에 기록하며 `pricingAssumption`과 구분합니다. 옵션 생략 시 비용 추정에 쓰는 `1536x1024`/`medium`은 실제 출력 크기·품질의 기본값을 보장하지 않습니다.
316
+ - 이미지 도구 로그는 `requestedOptions`와 `observedGeneration`을 구분합니다. 관측 정보가 없고 가격표에 있는 크기의 기존 응답만 `pricingAssumption`을 유지합니다. 그 기본값 `1536x1024`/`medium`은 실제 출력 설정을 뜻하지 않습니다.
316
317
 
317
318
  투명 생성은 위 `imageGenerationOptions`에 `background: "transparent"`를 추가하고, 프롬프트에도 피사체 밖의 투명 배경을 명시하세요. 크로마키·배경색 지시는 제거해야 합니다. 이 기능이 포함된 서버와 SDK가 모두 필요하며, 저장 시 PNG 알파를 유지하세요. 정확한 최종 크기는 소비 앱의 명시적인 crop/resize 정책으로 처리합니다.
318
319
 
package/README.md CHANGED
@@ -319,11 +319,12 @@ const result = await generateText({
319
319
  - Rejected in `streamText` (non-stream only).
320
320
  - Image-generation requests do not retain provider conversation state. Their full input is sent directly.
321
321
  - Reference images are sent as JSON data URLs. Compress or resize large photos before passing them in; oversized base64 inputs are rejected by the SDK. WebP/JPEG is recommended for photos.
322
- - The image cost is an **estimate** based on the public `gpt-image-2` price table, recorded separately as `image_cost_usd` on the request log (codex does not expose exact image-tool usage).
322
+ - Hosted Responses image cost is unknown (`image_cost_usd: null`): requested size/quality and text-driver usage cannot determine image cost. Standalone image usage is priced separately as described below. Legacy responses without generation metadata retain the three-size public price estimate; custom sizes and `auto` never receive an invented estimate.
323
323
  - `imageGenerationOptions.background` accepts `"auto" | "opaque" | "transparent"`. Only `"transparent"` uses Codex's standalone `images/generations` or `images/edits` endpoint with the existing ChatGPT subscription token. Other image requests keep the hosted Responses tool. The transparent route runs `gpt-image-2` directly, without a text driver; it rejects tools and structured output. It accepts up to five reference images and preserves PNG bytes. Fully opaque, entirely empty, or invalid PNG results fail explicitly; there is no background-removal fallback.
324
- - Transparent image output metadata is available in `result.providerMetadata.qgrid.imageGeneration` (an array containing `contentIndex`, `model`, `route`, `size`, `quality`, `background`, and optional image `usage`). Per-file metadata also appears on `result.content` file parts, not on `result.files[]`. Request options are hints: a live `1024x1024`/`high` request returned `1254x1254`/`medium`. qgrid reports the actual PNG dimensions and does not resize it.
324
+ - Both routes expose output metadata in `result.providerMetadata.qgrid.imageGeneration` (an array with `contentIndex`, `route`, and optional `model`, `size`, `quality`, `background`, and image `usage`). Routes are `codex-responses` and `codex-images`. An unreported hosted image model stays absent; the text driver is not the image model. Per-file metadata also appears on `result.content` file parts, not on `result.files[]`. PNG dimensions come from the returned bytes; JPEG/WebP dimensions use the backend's reported output size when available. qgrid does not resize output.
325
+ - `imageGenerationOptions.size` accepts `"auto"` or positive integer `WIDTHxHEIGHT` hints, such as `"1152x2560"`. These are not exact-output guarantees. Omit size or use `auto`, and put the desired aspect ratio in the prompt (for example, "9:20 portrait"). On 2026-10-13, both subscription routes ignored explicit size, returned `841x1870` for a 9:20 prompt, `941x1672` for a 4K portrait request, and 3:1 for a 4:1 prompt. The observed approximately 1.57MP output is not a guaranteed account-wide limit. Public Images API rules (16-pixel multiples and up to 4K) do not establish subscription output behavior. Update server and SDK together to use expanded size hints and hosted metadata.
325
326
  - On the transparent route, regular token usage/cost is zero because no text driver ran. Image usage is preserved separately and `image_cost_usd` is an API-price estimate from reported usage, with known text/image input splits and conservative pricing for unknown input. It omits cache discounts and is not subscription billing.
326
- - Explicit image options are recorded as `requestedOptions` in the synthetic image tool log, separately from `pricingAssumption`. When size/quality are omitted, the `1536x1024`/`medium` pricing defaults do not establish actual output dimensions or quality.
327
+ - Image logs distinguish `requestedOptions` from `observedGeneration`. Only legacy responses without observations and with a known size price retain `pricingAssumption`; its `1536x1024`/`medium` defaults never establish actual output settings.
327
328
 
328
329
  Transparent generation example (requires a server and SDK containing this feature):
329
330
 
package/dist/index.d.ts CHANGED
@@ -75,13 +75,16 @@ type QgridOpenAIProviderOptions = QgridCommonProviderOptions & {
75
75
  imageGeneration?: boolean;
76
76
  /**
77
77
  * Image generation controls. The Responses backend selects the image model;
78
- * quality/size cost estimates use the GPT Image 2 public calculator table.
78
+ * Size/quality are hints, not output guarantees. Hosted image cost is unknown;
79
+ * standalone usage is estimated using public image-token prices.
79
80
  */
80
81
  imageGenerationOptions?: {
81
82
  /** Responses output format. Defaults to PNG; transparent output only supports PNG. */
82
83
  outputFormat?: "png" | "jpeg" | "webp";
83
84
  quality?: "low" | "medium" | "high";
84
- size?: "1024x1024" | "1024x1536" | "1536x1024";
85
+ /** Requested hint only; Codex may ignore it. Put the desired aspect ratio in the prompt.
86
+ * Omit or use auto for backend sizing; read actual output size from generation metadata. */
87
+ size?: "auto" | `${number}x${number}`;
85
88
  /** Transparent uses Codex standalone Images and validates PNG alpha. See README for limits. */
86
89
  background?: "auto" | "opaque" | "transparent";
87
90
  };
@@ -107,8 +110,9 @@ type QgridProviderOptions = QgridOpenAIProviderOptions | QgridAnthropicProviderO
107
110
  type QgridSupportedModel = "openai/gpt-6-astra" | "openai/gpt-6.1-sol" | "openai/gpt-6-sol" | "openai/gpt-6-luna" | "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" | "anthropic/claude-opus-5-5" | "anthropic/claude-sonnet-5-5" | "anthropic/claude-haiku-5-5";
108
111
  /** Observed image response values. Usage is response-level and appears on the first image only. */
109
112
  type QgridImageGenerationMetadata = {
110
- route: "codex-images";
111
- model: "gpt-image-2";
113
+ route: "codex-images" | "codex-responses";
114
+ /** Present only when reported or known from the standalone route. */
115
+ model?: string;
112
116
  background?: string;
113
117
  quality?: string;
114
118
  size?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartanova/qgrid-ai-sdk",
3
- "version": "2.10.4",
3
+ "version": "2.10.5",
4
4
  "description": "AI SDK LanguageModelV3 provider for qgrid",
5
5
  "repository": {
6
6
  "type": "git",