@warlock.js/ai-openai 5.28.0 → 5.30.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/cjs/index.cjs +21 -21
  3. package/cjs/index.cjs.map +1 -1
  4. package/esm/config.type.d.mts +1 -1
  5. package/esm/config.type.d.mts.map +1 -1
  6. package/esm/embedder.d.mts +1 -1
  7. package/esm/embedder.d.mts.map +1 -1
  8. package/esm/embedder.mjs +1 -1
  9. package/esm/embedder.mjs.map +1 -1
  10. package/esm/image.d.mts +1 -1
  11. package/esm/image.d.mts.map +1 -1
  12. package/esm/image.mjs +1 -1
  13. package/esm/image.mjs.map +1 -1
  14. package/esm/known-reasoning-models.mjs +1 -1
  15. package/esm/known-reasoning-models.mjs.map +1 -1
  16. package/esm/known-vision-models.mjs +1 -1
  17. package/esm/known-vision-models.mjs.map +1 -1
  18. package/esm/model.mjs +1 -1
  19. package/esm/model.mjs.map +1 -1
  20. package/esm/responses-model.mjs +1 -1
  21. package/esm/responses-model.mjs.map +1 -1
  22. package/esm/sdk.d.mts +1 -1
  23. package/esm/sdk.d.mts.map +1 -1
  24. package/esm/sdk.mjs +1 -1
  25. package/esm/sdk.mjs.map +1 -1
  26. package/esm/speech.d.mts +1 -1
  27. package/esm/speech.d.mts.map +1 -1
  28. package/esm/speech.mjs +1 -1
  29. package/esm/speech.mjs.map +1 -1
  30. package/esm/transcription.d.mts +1 -1
  31. package/esm/transcription.d.mts.map +1 -1
  32. package/esm/transcription.mjs +1 -1
  33. package/esm/transcription.mjs.map +1 -1
  34. package/esm/utils/build-usage.mjs +1 -1
  35. package/esm/utils/build-usage.mjs.map +1 -1
  36. package/esm/utils/map-finish-reason.mjs +1 -1
  37. package/esm/utils/map-finish-reason.mjs.map +1 -1
  38. package/esm/utils/map-responses-status.mjs +1 -1
  39. package/esm/utils/map-responses-status.mjs.map +1 -1
  40. package/esm/utils/prompt-cache-params.mjs +1 -1
  41. package/esm/utils/prompt-cache-params.mjs.map +1 -1
  42. package/esm/utils/reasoning-effort.mjs +1 -1
  43. package/esm/utils/reasoning-effort.mjs.map +1 -1
  44. package/esm/utils/reasoning-replay.mjs +1 -1
  45. package/esm/utils/reasoning-replay.mjs.map +1 -1
  46. package/esm/utils/structured-output.mjs +1 -1
  47. package/esm/utils/structured-output.mjs.map +1 -1
  48. package/esm/utils/to-openai-messages.mjs +1 -1
  49. package/esm/utils/to-openai-messages.mjs.map +1 -1
  50. package/esm/utils/to-openai-tools.mjs +1 -1
  51. package/esm/utils/to-openai-tools.mjs.map +1 -1
  52. package/esm/utils/to-responses-input.mjs +1 -1
  53. package/esm/utils/to-responses-input.mjs.map +1 -1
  54. package/esm/utils/to-responses-tools.mjs +1 -1
  55. package/esm/utils/to-responses-tools.mjs.map +1 -1
  56. package/esm/utils/wrap-openai-error.mjs +1 -1
  57. package/esm/utils/wrap-openai-error.mjs.map +1 -1
  58. package/llms-full.txt +7 -7
  59. package/llms.txt +1 -1
  60. package/package.json +5 -4
  61. package/skills/README.md +2 -2
  62. package/skills/setup-openai/SKILL.md +7 -7
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: setup-openai
3
- description: 'Wire @warlock.js/ai-openai — new OpenAISDK({apiKey, baseURL?, provider?, pricing?}) for OpenAI / Azure / OpenRouter, .model({name, vision?, reasoning?, structuredOutput?, responseFormat?, pdf?, audio?}) for ModelContract, .embedder({name, dimensions?}) for embeddings, .image({name, pricing?}) for gpt-image-*/dall-e-* image generation (via ai.image). PDF input maps to OpenAI file parts (opt-in pdf:true), audio input to input_audio (opt-in audio:true). Triggers: `OpenAISDK`, `.model`, `.embedder`, `.image`, `.embed`, `.embedMany`, `baseURL`, `pricing`, `responseSchema`, `responseFormat`, `reasoning_effort`, `reasoningTokens`, `cachedTokens`, `gpt-image`, `dall-e`, `ai.image`, `pdf input`, `input_audio`, o-series / gpt-5 reasoning, `api: "responses"`, Responses API, reasoning with tools, prompt caching; "wire openai into a warlock agent", "configure gpt-4o", "use o3 / gpt-5 reasoning effort", "route through openrouter or azure openai", "openai embeddings with warlock", "generate images with gpt-image / dall-e", "send a pdf / audio to gpt-4o"; typical import `import { OpenAISDK } from "@warlock.js/ai-openai"`. Skip: the ai.image verb surface — `@warlock.js/ai/generate-images/SKILL.md`; agent wiring — `@warlock.js/ai/run-ai-agent/SKILL.md`; adapter comparison — `@warlock.js/ai/pick-ai-provider/SKILL.md`; competing adapters `@warlock.js/ai-anthropic`, `@warlock.js/ai-bedrock`, `@warlock.js/ai-google`, `@warlock.js/ai-ollama`; raw `openai` SDK, Vercel `@ai-sdk/openai`.'
3
+ description: 'Wire @warlock.js/ai-openai — new OpenAISDK({apiKey, baseURL?, provider?, pricing?}) for OpenAI / Azure / OpenRouter, .model({name, vision?, reasoning?, structuredOutput?, responseFormat?, pdf?, audio?}) for ModelContract, .embedder({name, dimensions?}) for embeddings, .image({name, pricing?}) for gpt-image-*/dall-e-* image generation (via ai.image). PDF input maps to OpenAI file parts (opt-in pdf:true), audio input to input_audio (opt-in audio:true). Triggers: `OpenAISDK`, `.model`, `.embedder`, `.image`, `.embed`, `.embedMany`, `baseURL`, `pricing`, `responseSchema`, `responseFormat`, `reasoning_effort`, `reasoningTokens`, `cachedTokens`, `gpt-image`, `dall-e`, `ai.image`, `pdf input`, `input_audio`, o-series / gpt-5 reasoning, `api: "responses"`, Responses API, reasoning with tools, prompt caching; "wire openai into a warlock agent", "configure gpt-4o", "use o3 / gpt-5 reasoning effort", "route through openrouter or azure openai", "openai embeddings with warlock", "generate images with gpt-image / dall-e", "send a pdf / audio to gpt-4o"; typical import `import { OpenAISDK } from "@warlock.js/ai-openai"`. Skip: the ai.image verb surface — the `generate-images` topic of the `warlock-js-ai` skill; agent wiring — the `run-ai-agent` topic of the `warlock-js-ai` skill; adapter comparison — the `pick-ai-provider` topic of the `warlock-js-ai` skill; competing adapters `@warlock.js/ai-anthropic`, `@warlock.js/ai-bedrock`, `@warlock.js/ai-google`, `@warlock.js/ai-ollama`; raw `openai` SDK, Vercel `@ai-sdk/openai`.'
4
4
  ---
5
5
 
6
6
  # `@warlock.js/ai-openai`
@@ -89,7 +89,7 @@ const { data } = await ai.image({ model: gpt, prompt: "a red bicycle", size: "10
89
89
 
90
90
  - `gpt-image-*` is token-metered (price with `{ input, output }`) and always returns base64 bytes — the adapter never sends `response_format` (the API rejects it).
91
91
  - `dall-e-*` is per-image (price with `{ perImage }` / `perImageBySize`); defaults to base64, opt into a hosted URL with `options: { responseFormat: "url" }`.
92
- - The model id is **not validated locally** — `openai.image({ name })` passes it straight to `client.images.generate`, so an id OpenAI does not serve fails at the provider (wrapped into the typed `AIError` hierarchy), not at construction. Same for `openai.speech({ name })` and `openai.transcribe({ name })`. There are no model-id helpers to consult: `isOpenAIImageModel()`, `OPENAI_IMAGE_MODEL_PREFIXES`, `isOpenAISpeechModel()` and `isOpenAITranscriptionModel()` were all removed in 4.13.0 — branch on your own id list if you need one. The verb surface (envelope, options, cost-truth) lives in [`@warlock.js/ai/generate-images/SKILL.md`](@warlock.js/ai/generate-images/SKILL.md).
92
+ - The model id is **not validated locally** — `openai.image({ name })` passes it straight to `client.images.generate`, so an id OpenAI does not serve fails at the provider (wrapped into the typed `AIError` hierarchy), not at construction. Same for `openai.speech({ name })` and `openai.transcribe({ name })`. There are no model-id helpers to consult: `isOpenAIImageModel()`, `OPENAI_IMAGE_MODEL_PREFIXES`, `isOpenAISpeechModel()` and `isOpenAITranscriptionModel()` were all removed in 4.13.0 — branch on your own id list if you need one. The verb surface (envelope, options, cost-truth) lives in the `generate-images` topic of the `warlock-js-ai` skill.
93
93
 
94
94
  ## Streaming
95
95
 
@@ -230,11 +230,11 @@ const { usage } = await ai.agent({ model: openai.model({ name: "gpt-4o-mini" })
230
230
  usage.cost; // { input, output, cachedInput?, cachedOutput? } — per-channel USD breakdown of THIS run
231
231
  ```
232
232
 
233
- The registry is per-model; `usage.cost` is the per-channel breakdown the framework computes from `tokens × pricing[model]`. Resolution at `model()` time: per-model `pricing` (`openai.model({ name, pricing })`) > SDK registry > `undefined` (no cost computed). See [`@warlock.js/ai/pick-ai-provider/SKILL.md`](@warlock.js/ai/pick-ai-provider/SKILL.md).
233
+ The registry is per-model; `usage.cost` is the per-channel breakdown the framework computes from `tokens × pricing[model]`. Resolution at `model()` time: per-model `pricing` (`openai.model({ name, pricing })`) > SDK registry > `undefined` (no cost computed). See the `pick-ai-provider` topic of the `warlock-js-ai` skill.
234
234
 
235
235
  ## Errors
236
236
 
237
- Raw OpenAI SDK errors are wrapped into the typed `@warlock.js/ai` `AIError` hierarchy via the adapter's error wrapper. Dispatch keys on `APIError.status + code` combined — see [`@warlock.js/ai/handle-ai-errors/SKILL.md`](@warlock.js/ai/handle-ai-errors/SKILL.md).
237
+ Raw OpenAI SDK errors are wrapped into the typed `@warlock.js/ai` `AIError` hierarchy via the adapter's error wrapper. Dispatch keys on `APIError.status + code` combined — see the `handle-ai-errors` topic of the `warlock-js-ai` skill.
238
238
 
239
239
  ## When NOT to use this skill
240
240
 
@@ -243,6 +243,6 @@ Raw OpenAI SDK errors are wrapped into the typed `@warlock.js/ai` `AIError` hier
243
243
 
244
244
  ## See also
245
245
 
246
- - [`@warlock.js/ai/run-ai-agent/SKILL.md`](@warlock.js/ai/run-ai-agent/SKILL.md) — passing the model into `ai.agent({...})`
247
- - [`@warlock.js/ai/embed-text/SKILL.md`](@warlock.js/ai/embed-text/SKILL.md) — embedder usage
248
- - [`@warlock.js/ai/pick-ai-provider/SKILL.md`](@warlock.js/ai/pick-ai-provider/SKILL.md) — adapter comparison
246
+ - The `run-ai-agent` topic of the `warlock-js-ai` skill — passing the model into `ai.agent({...})`
247
+ - The `embed-text` topic of the `warlock-js-ai` skill — embedder usage
248
+ - The `pick-ai-provider` topic of the `warlock-js-ai` skill — adapter comparison