omk-ai 0.95.1 → 0.95.2
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.md +31 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/models.generated.d.ts +145 -2
- package/dist/models.generated.d.ts.map +1 -1
- package/dist/models.generated.js +20 -5
- package/dist/models.generated.js.map +1 -1
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +45 -20
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/dist/providers/azure-openai-responses.js +2 -2
- package/dist/providers/azure-openai-responses.js.map +1 -1
- package/dist/providers/openai-codex-moa-stream-limits.d.ts +0 -1
- package/dist/providers/openai-codex-moa-stream-limits.d.ts.map +1 -1
- package/dist/providers/openai-codex-moa-stream-limits.js +1 -17
- package/dist/providers/openai-codex-moa-stream-limits.js.map +1 -1
- package/dist/providers/openai-codex-moa.d.ts.map +1 -1
- package/dist/providers/openai-codex-moa.js +2 -11
- package/dist/providers/openai-codex-moa.js.map +1 -1
- package/dist/providers/openai-codex-responses.d.ts.map +1 -1
- package/dist/providers/openai-codex-responses.js +2 -2
- package/dist/providers/openai-codex-responses.js.map +1 -1
- package/dist/providers/openai-completions.d.ts.map +1 -1
- package/dist/providers/openai-completions.js +23 -10
- package/dist/providers/openai-completions.js.map +1 -1
- package/dist/providers/openai-prompt-cache.d.ts +6 -0
- package/dist/providers/openai-prompt-cache.d.ts.map +1 -1
- package/dist/providers/openai-prompt-cache.js +13 -0
- package/dist/providers/openai-prompt-cache.js.map +1 -1
- package/dist/providers/openai-responses.d.ts.map +1 -1
- package/dist/providers/openai-responses.js +4 -2
- package/dist/providers/openai-responses.js.map +1 -1
- package/dist/providers/prompt-cache.d.ts +10 -0
- package/dist/providers/prompt-cache.d.ts.map +1 -0
- package/dist/providers/prompt-cache.js +40 -0
- package/dist/providers/prompt-cache.js.map +1 -0
- package/dist/providers/tool-schema.d.ts.map +1 -1
- package/dist/providers/tool-schema.js +10 -4
- package/dist/providers/tool-schema.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Unified LLM API with automatic model discovery, provider configuration, token an
|
|
|
9
9
|
- [Supported Providers](#supported-providers)
|
|
10
10
|
- [Installation](#installation)
|
|
11
11
|
- [Quick Start](#quick-start)
|
|
12
|
+
- [Prompt Cache Boundaries](#prompt-cache-boundaries)
|
|
12
13
|
- [Tools](#tools)
|
|
13
14
|
- [Defining Tools](#defining-tools)
|
|
14
15
|
- [Handling Tool Calls](#handling-tool-calls)
|
|
@@ -210,6 +211,29 @@ for (const block of response.content) {
|
|
|
210
211
|
}
|
|
211
212
|
```
|
|
212
213
|
|
|
214
|
+
## Prompt Cache Boundaries
|
|
215
|
+
|
|
216
|
+
Use typed cache-boundary metadata when the start of a system prompt is stable but its suffix changes between requests:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
import { type Context, deriveContextPromptCacheKey } from 'omk-ai';
|
|
220
|
+
|
|
221
|
+
const stablePrefix = 'You are a coding assistant.';
|
|
222
|
+
const dynamicSuffix = '\nCurrent task: Review the changes.';
|
|
223
|
+
const context: Context = {
|
|
224
|
+
systemPrompt: stablePrefix + dynamicSuffix,
|
|
225
|
+
systemPromptCacheBoundary: stablePrefix.length,
|
|
226
|
+
messages: []
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
// Optional diagnostic/affinity key. Keep the scope stable for the same cache domain.
|
|
230
|
+
const cacheKey = deriveContextPromptCacheKey(context, 'openai/gpt-4o-mini');
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`systemPromptCacheBoundary` is a UTF-16 offset, so JavaScript's `.length` produces the expected unit. `deriveContextPromptCacheKey()` hashes the stable prefix, scope, and canonical tool schemas; it excludes the dynamic suffix and session ID. When prompt caching is enabled, Anthropic marks the stable prefix block and supported OpenAI-family transports derive `prompt_cache_key` from the same metadata. Other providers may ignore it.
|
|
234
|
+
|
|
235
|
+
Set `systemPromptCacheBoundaryBypass: true` when an extension or caller replaces the prompt with dynamic content. A bypassed, non-positive, non-integer, or out-of-range boundary suppresses explicit cache markers and content-derived affinity. It does not promise a cache hit: only provider-returned `usage.cacheRead` confirms one.
|
|
236
|
+
|
|
213
237
|
## Tools
|
|
214
238
|
|
|
215
239
|
Tools enable LLMs to interact with external systems. This library uses TypeBox schemas for type-safe tool definitions with automatic validation using TypeBox's built-in validator and value conversion utilities. TypeBox schemas can be serialized and deserialized as plain JSON, making them ideal for distributed systems.
|
|
@@ -328,6 +352,7 @@ for await (const event of s) {
|
|
|
328
352
|
```
|
|
329
353
|
|
|
330
354
|
**Important notes about partial tool arguments:**
|
|
355
|
+
|
|
331
356
|
- During `toolcall_delta` events, `arguments` contains the best-effort parse of partial JSON
|
|
332
357
|
- Fields may be missing or incomplete - always check for existence before use
|
|
333
358
|
- String values may be truncated mid-word
|
|
@@ -377,7 +402,7 @@ for await (const event of s) {
|
|
|
377
402
|
All streaming events emitted during assistant message generation:
|
|
378
403
|
|
|
379
404
|
| Event Type | Description | Key Properties |
|
|
380
|
-
|
|
405
|
+
| ------------ | ------------- | ---------------- |
|
|
381
406
|
| `start` | Stream begins | `partial`: Initial assistant message structure |
|
|
382
407
|
| `text_start` | Text block starts | `contentIndex`: Position in content array |
|
|
383
408
|
| `text_delta` | Text chunk received | `delta`: New text, `contentIndex`: Position |
|
|
@@ -787,6 +812,7 @@ multiModel.unregister();
|
|
|
787
812
|
```
|
|
788
813
|
|
|
789
814
|
Notes:
|
|
815
|
+
|
|
790
816
|
- Responses are consumed from a queue in request start order.
|
|
791
817
|
- If the queue is empty, the faux provider returns an assistant error message with `errorMessage: "No more faux responses queued"`.
|
|
792
818
|
- Use `registration.setResponses([...])` to replace the remaining queue and `registration.appendResponses([...])` to add more responses.
|
|
@@ -801,6 +827,7 @@ Notes:
|
|
|
801
827
|
### Providers and Models
|
|
802
828
|
|
|
803
829
|
A **provider** offers models through a specific API. For example:
|
|
830
|
+
|
|
804
831
|
- **Anthropic** models use the `anthropic-messages` API
|
|
805
832
|
- **Google** models use the `google-generative-ai` API
|
|
806
833
|
- **OpenAI** models use the `openai-responses` API
|
|
@@ -1022,12 +1049,14 @@ const geminiResponse = await complete(gemini, context);
|
|
|
1022
1049
|
### Provider Compatibility
|
|
1023
1050
|
|
|
1024
1051
|
All providers can handle messages from other providers, including:
|
|
1052
|
+
|
|
1025
1053
|
- Text content
|
|
1026
1054
|
- Tool calls and tool results (including images in tool results)
|
|
1027
1055
|
- Thinking/reasoning blocks (transformed to tagged text for cross-provider compatibility)
|
|
1028
1056
|
- Aborted messages with partial content
|
|
1029
1057
|
|
|
1030
1058
|
This enables flexible workflows where you can:
|
|
1059
|
+
|
|
1031
1060
|
- Start with a fast model for initial responses
|
|
1032
1061
|
- Switch to a more capable model for complex reasoning
|
|
1033
1062
|
- Use specialized models for specific tasks
|
|
@@ -1101,7 +1130,7 @@ const response = await complete(model, {
|
|
|
1101
1130
|
In Node.js environments, you can set environment variables to avoid passing API keys:
|
|
1102
1131
|
|
|
1103
1132
|
| Provider | Environment Variable(s) |
|
|
1104
|
-
|
|
1133
|
+
| ---------- | ------------------------ |
|
|
1105
1134
|
| OpenAI | `OPENAI_API_KEY` |
|
|
1106
1135
|
| Ant Ling | `ANT_LING_API_KEY` |
|
|
1107
1136
|
| Azure OpenAI | `AZURE_OPENAI_API_KEY` + `AZURE_OPENAI_BASE_URL` (e.g. `https://{resource}.openai.azure.com`) or `AZURE_OPENAI_RESOURCE_NAME`. Supports `*.openai.azure.com` and `*.cognitiveservices.azure.com`; root endpoints auto-normalize to `/openai/v1`. Optional: `AZURE_OPENAI_API_VERSION` (default `v1`), `AZURE_OPENAI_DEPLOYMENT_NAME_MAP`. |
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type { MistralOptions } from "./providers/mistral.ts";
|
|
|
18
18
|
export type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats, } from "./providers/openai-codex-responses.ts";
|
|
19
19
|
export type { OpenAICompletionsOptions } from "./providers/openai-completions.ts";
|
|
20
20
|
export type { OpenAIResponsesOptions } from "./providers/openai-responses.ts";
|
|
21
|
+
export { deriveContextPromptCacheKey } from "./providers/prompt-cache.ts";
|
|
21
22
|
export * from "./providers/register-builtins.ts";
|
|
22
23
|
export * from "./session-resources.ts";
|
|
23
24
|
export * from "./stream.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5G,YAAY,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,cAAc,qBAAqB,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,cAAc,yCAAyC,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EACX,2BAA2B,EAC3B,8BAA8B,GAC9B,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,YAAY,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,YAAY,EACX,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n\nexport * from \"./api-registry.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./image-models.ts\";\nexport * from \"./images.ts\";\nexport * from \"./images-api-registry.ts\";\nexport * from \"./models.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./providers/amazon-bedrock.ts\";\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./providers/anthropic.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./providers/azure-openai-responses.ts\";\nexport * from \"./providers/faux.ts\";\nexport type { GoogleOptions } from \"./providers/google.ts\";\nexport type { GoogleThinkingLevel } from \"./providers/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./providers/google-vertex.ts\";\nexport * from \"./providers/images/register-builtins.ts\";\nexport type { MistralOptions } from \"./providers/mistral.ts\";\nexport type {\n\tOpenAICodexResponsesOptions,\n\tOpenAICodexWebSocketDebugStats,\n} from \"./providers/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./providers/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./providers/openai-responses.ts\";\nexport * from \"./providers/register-builtins.ts\";\nexport * from \"./session-resources.ts\";\nexport * from \"./stream.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthCredentials,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProvider,\n\tOAuthProviderId,\n\tOAuthProviderInfo,\n\tOAuthProviderInterface,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./utils/oauth/types.ts\";\nexport * from \"./utils/overflow.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport * from \"./utils/validation.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5G,YAAY,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,cAAc,qBAAqB,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,cAAc,yCAAyC,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EACX,2BAA2B,EAC3B,8BAA8B,GAC9B,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,YAAY,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,YAAY,EACX,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n\nexport * from \"./api-registry.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./image-models.ts\";\nexport * from \"./images.ts\";\nexport * from \"./images-api-registry.ts\";\nexport * from \"./models.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./providers/amazon-bedrock.ts\";\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./providers/anthropic.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./providers/azure-openai-responses.ts\";\nexport * from \"./providers/faux.ts\";\nexport type { GoogleOptions } from \"./providers/google.ts\";\nexport type { GoogleThinkingLevel } from \"./providers/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./providers/google-vertex.ts\";\nexport * from \"./providers/images/register-builtins.ts\";\nexport type { MistralOptions } from \"./providers/mistral.ts\";\nexport type {\n\tOpenAICodexResponsesOptions,\n\tOpenAICodexWebSocketDebugStats,\n} from \"./providers/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./providers/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./providers/openai-responses.ts\";\nexport { deriveContextPromptCacheKey } from \"./providers/prompt-cache.ts\";\nexport * from \"./providers/register-builtins.ts\";\nexport * from \"./session-resources.ts\";\nexport * from \"./stream.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthCredentials,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProvider,\n\tOAuthProviderId,\n\tOAuthProviderInfo,\n\tOAuthProviderInterface,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./utils/oauth/types.ts\";\nexport * from \"./utils/overflow.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport * from \"./utils/validation.ts\";\n"]}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./images-api-registry.js";
|
|
|
7
7
|
export * from "./models.js";
|
|
8
8
|
export * from "./providers/faux.js";
|
|
9
9
|
export * from "./providers/images/register-builtins.js";
|
|
10
|
+
export { deriveContextPromptCacheKey } from "./providers/prompt-cache.js";
|
|
10
11
|
export * from "./providers/register-builtins.js";
|
|
11
12
|
export * from "./session-resources.js";
|
|
12
13
|
export * from "./stream.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAI5B,cAAc,qBAAqB,CAAC;AAIpC,cAAc,yCAAyC,CAAC;AAQxD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AActC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n\nexport * from \"./api-registry.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./image-models.ts\";\nexport * from \"./images.ts\";\nexport * from \"./images-api-registry.ts\";\nexport * from \"./models.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./providers/amazon-bedrock.ts\";\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./providers/anthropic.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./providers/azure-openai-responses.ts\";\nexport * from \"./providers/faux.ts\";\nexport type { GoogleOptions } from \"./providers/google.ts\";\nexport type { GoogleThinkingLevel } from \"./providers/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./providers/google-vertex.ts\";\nexport * from \"./providers/images/register-builtins.ts\";\nexport type { MistralOptions } from \"./providers/mistral.ts\";\nexport type {\n\tOpenAICodexResponsesOptions,\n\tOpenAICodexWebSocketDebugStats,\n} from \"./providers/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./providers/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./providers/openai-responses.ts\";\nexport * from \"./providers/register-builtins.ts\";\nexport * from \"./session-resources.ts\";\nexport * from \"./stream.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthCredentials,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProvider,\n\tOAuthProviderId,\n\tOAuthProviderInfo,\n\tOAuthProviderInterface,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./utils/oauth/types.ts\";\nexport * from \"./utils/overflow.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport * from \"./utils/validation.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAI5B,cAAc,qBAAqB,CAAC;AAIpC,cAAc,yCAAyC,CAAC;AAQxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AActC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n\nexport * from \"./api-registry.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./image-models.ts\";\nexport * from \"./images.ts\";\nexport * from \"./images-api-registry.ts\";\nexport * from \"./models.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./providers/amazon-bedrock.ts\";\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./providers/anthropic.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./providers/azure-openai-responses.ts\";\nexport * from \"./providers/faux.ts\";\nexport type { GoogleOptions } from \"./providers/google.ts\";\nexport type { GoogleThinkingLevel } from \"./providers/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./providers/google-vertex.ts\";\nexport * from \"./providers/images/register-builtins.ts\";\nexport type { MistralOptions } from \"./providers/mistral.ts\";\nexport type {\n\tOpenAICodexResponsesOptions,\n\tOpenAICodexWebSocketDebugStats,\n} from \"./providers/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./providers/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./providers/openai-responses.ts\";\nexport { deriveContextPromptCacheKey } from \"./providers/prompt-cache.ts\";\nexport * from \"./providers/register-builtins.ts\";\nexport * from \"./session-resources.ts\";\nexport * from \"./stream.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthCredentials,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProvider,\n\tOAuthProviderId,\n\tOAuthProviderInfo,\n\tOAuthProviderInterface,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./utils/oauth/types.ts\";\nexport * from \"./utils/overflow.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport * from \"./utils/validation.ts\";\n"]}
|
|
@@ -4087,6 +4087,15 @@ export declare const MODELS: {
|
|
|
4087
4087
|
sendSessionAffinityHeaders: true;
|
|
4088
4088
|
};
|
|
4089
4089
|
reasoning: true;
|
|
4090
|
+
thinkingLevelMap: {
|
|
4091
|
+
off: null;
|
|
4092
|
+
minimal: null;
|
|
4093
|
+
low: string;
|
|
4094
|
+
medium: string;
|
|
4095
|
+
high: string;
|
|
4096
|
+
xhigh: string;
|
|
4097
|
+
max: string;
|
|
4098
|
+
};
|
|
4090
4099
|
input: "text"[];
|
|
4091
4100
|
cost: {
|
|
4092
4101
|
input: number;
|
|
@@ -4353,6 +4362,15 @@ export declare const MODELS: {
|
|
|
4353
4362
|
sendSessionAffinityHeaders: true;
|
|
4354
4363
|
};
|
|
4355
4364
|
reasoning: true;
|
|
4365
|
+
thinkingLevelMap: {
|
|
4366
|
+
off: null;
|
|
4367
|
+
minimal: null;
|
|
4368
|
+
low: string;
|
|
4369
|
+
medium: string;
|
|
4370
|
+
high: string;
|
|
4371
|
+
xhigh: string;
|
|
4372
|
+
max: string;
|
|
4373
|
+
};
|
|
4356
4374
|
input: "text"[];
|
|
4357
4375
|
cost: {
|
|
4358
4376
|
input: number;
|
|
@@ -4482,6 +4500,15 @@ export declare const MODELS: {
|
|
|
4482
4500
|
supportsLongCacheRetention: false;
|
|
4483
4501
|
};
|
|
4484
4502
|
reasoning: true;
|
|
4503
|
+
thinkingLevelMap: {
|
|
4504
|
+
off: null;
|
|
4505
|
+
minimal: null;
|
|
4506
|
+
low: string;
|
|
4507
|
+
medium: string;
|
|
4508
|
+
high: string;
|
|
4509
|
+
xhigh: string;
|
|
4510
|
+
max: string;
|
|
4511
|
+
};
|
|
4485
4512
|
input: "text"[];
|
|
4486
4513
|
cost: {
|
|
4487
4514
|
input: number;
|
|
@@ -4693,6 +4720,15 @@ export declare const MODELS: {
|
|
|
4693
4720
|
supportsLongCacheRetention: false;
|
|
4694
4721
|
};
|
|
4695
4722
|
reasoning: true;
|
|
4723
|
+
thinkingLevelMap: {
|
|
4724
|
+
off: null;
|
|
4725
|
+
minimal: null;
|
|
4726
|
+
low: string;
|
|
4727
|
+
medium: string;
|
|
4728
|
+
high: string;
|
|
4729
|
+
xhigh: string;
|
|
4730
|
+
max: string;
|
|
4731
|
+
};
|
|
4696
4732
|
input: "text"[];
|
|
4697
4733
|
cost: {
|
|
4698
4734
|
input: number;
|
|
@@ -7545,6 +7581,15 @@ export declare const MODELS: {
|
|
|
7545
7581
|
supportsDeveloperRole: false;
|
|
7546
7582
|
};
|
|
7547
7583
|
reasoning: true;
|
|
7584
|
+
thinkingLevelMap: {
|
|
7585
|
+
off: null;
|
|
7586
|
+
minimal: null;
|
|
7587
|
+
low: string;
|
|
7588
|
+
medium: string;
|
|
7589
|
+
high: string;
|
|
7590
|
+
xhigh: string;
|
|
7591
|
+
max: string;
|
|
7592
|
+
};
|
|
7548
7593
|
input: "text"[];
|
|
7549
7594
|
cost: {
|
|
7550
7595
|
input: number;
|
|
@@ -9603,6 +9648,15 @@ export declare const MODELS: {
|
|
|
9603
9648
|
supportsLongCacheRetention: false;
|
|
9604
9649
|
};
|
|
9605
9650
|
reasoning: true;
|
|
9651
|
+
thinkingLevelMap: {
|
|
9652
|
+
off: null;
|
|
9653
|
+
minimal: null;
|
|
9654
|
+
low: string;
|
|
9655
|
+
medium: string;
|
|
9656
|
+
high: string;
|
|
9657
|
+
xhigh: string;
|
|
9658
|
+
max: string;
|
|
9659
|
+
};
|
|
9606
9660
|
input: "text"[];
|
|
9607
9661
|
cost: {
|
|
9608
9662
|
input: number;
|
|
@@ -11072,6 +11126,15 @@ export declare const MODELS: {
|
|
|
11072
11126
|
provider: string;
|
|
11073
11127
|
baseUrl: string;
|
|
11074
11128
|
reasoning: true;
|
|
11129
|
+
thinkingLevelMap: {
|
|
11130
|
+
off: null;
|
|
11131
|
+
minimal: null;
|
|
11132
|
+
low: string;
|
|
11133
|
+
medium: string;
|
|
11134
|
+
high: string;
|
|
11135
|
+
xhigh: string;
|
|
11136
|
+
max: string;
|
|
11137
|
+
};
|
|
11075
11138
|
input: "text"[];
|
|
11076
11139
|
cost: {
|
|
11077
11140
|
input: number;
|
|
@@ -11854,6 +11917,15 @@ export declare const MODELS: {
|
|
|
11854
11917
|
provider: string;
|
|
11855
11918
|
baseUrl: string;
|
|
11856
11919
|
reasoning: true;
|
|
11920
|
+
thinkingLevelMap: {
|
|
11921
|
+
off: null;
|
|
11922
|
+
minimal: null;
|
|
11923
|
+
low: string;
|
|
11924
|
+
medium: string;
|
|
11925
|
+
high: string;
|
|
11926
|
+
xhigh: string;
|
|
11927
|
+
max: string;
|
|
11928
|
+
};
|
|
11857
11929
|
input: "text"[];
|
|
11858
11930
|
cost: {
|
|
11859
11931
|
input: number;
|
|
@@ -16764,6 +16836,15 @@ export declare const MODELS: {
|
|
|
16764
16836
|
provider: string;
|
|
16765
16837
|
baseUrl: string;
|
|
16766
16838
|
reasoning: true;
|
|
16839
|
+
thinkingLevelMap: {
|
|
16840
|
+
off: null;
|
|
16841
|
+
minimal: null;
|
|
16842
|
+
low: string;
|
|
16843
|
+
medium: string;
|
|
16844
|
+
high: string;
|
|
16845
|
+
xhigh: string;
|
|
16846
|
+
max: string;
|
|
16847
|
+
};
|
|
16767
16848
|
input: "text"[];
|
|
16768
16849
|
cost: {
|
|
16769
16850
|
input: number;
|
|
@@ -17462,9 +17543,13 @@ export declare const MODELS: {
|
|
|
17462
17543
|
};
|
|
17463
17544
|
reasoning: true;
|
|
17464
17545
|
thinkingLevelMap: {
|
|
17546
|
+
off: null;
|
|
17465
17547
|
minimal: null;
|
|
17466
|
-
low:
|
|
17467
|
-
medium:
|
|
17548
|
+
low: string;
|
|
17549
|
+
medium: string;
|
|
17550
|
+
high: string;
|
|
17551
|
+
xhigh: string;
|
|
17552
|
+
max: string;
|
|
17468
17553
|
};
|
|
17469
17554
|
input: "text"[];
|
|
17470
17555
|
cost: {
|
|
@@ -20901,6 +20986,15 @@ export declare const MODELS: {
|
|
|
20901
20986
|
provider: string;
|
|
20902
20987
|
baseUrl: string;
|
|
20903
20988
|
reasoning: true;
|
|
20989
|
+
thinkingLevelMap: {
|
|
20990
|
+
off: null;
|
|
20991
|
+
minimal: null;
|
|
20992
|
+
low: string;
|
|
20993
|
+
medium: string;
|
|
20994
|
+
high: string;
|
|
20995
|
+
xhigh: string;
|
|
20996
|
+
max: string;
|
|
20997
|
+
};
|
|
20904
20998
|
input: "text"[];
|
|
20905
20999
|
cost: {
|
|
20906
21000
|
input: number;
|
|
@@ -20918,6 +21012,15 @@ export declare const MODELS: {
|
|
|
20918
21012
|
provider: string;
|
|
20919
21013
|
baseUrl: string;
|
|
20920
21014
|
reasoning: true;
|
|
21015
|
+
thinkingLevelMap: {
|
|
21016
|
+
off: null;
|
|
21017
|
+
minimal: null;
|
|
21018
|
+
low: string;
|
|
21019
|
+
medium: string;
|
|
21020
|
+
high: string;
|
|
21021
|
+
xhigh: string;
|
|
21022
|
+
max: string;
|
|
21023
|
+
};
|
|
20921
21024
|
input: "text"[];
|
|
20922
21025
|
cost: {
|
|
20923
21026
|
input: number;
|
|
@@ -21587,9 +21690,19 @@ export declare const MODELS: {
|
|
|
21587
21690
|
compat: {
|
|
21588
21691
|
supportsDeveloperRole: false;
|
|
21589
21692
|
thinkingFormat: "zai";
|
|
21693
|
+
supportsReasoningEffort: true;
|
|
21590
21694
|
zaiToolStream: true;
|
|
21591
21695
|
};
|
|
21592
21696
|
reasoning: true;
|
|
21697
|
+
thinkingLevelMap: {
|
|
21698
|
+
off: null;
|
|
21699
|
+
minimal: null;
|
|
21700
|
+
low: string;
|
|
21701
|
+
medium: string;
|
|
21702
|
+
high: string;
|
|
21703
|
+
xhigh: string;
|
|
21704
|
+
max: string;
|
|
21705
|
+
};
|
|
21593
21706
|
input: "text"[];
|
|
21594
21707
|
cost: {
|
|
21595
21708
|
input: number;
|
|
@@ -21609,9 +21722,19 @@ export declare const MODELS: {
|
|
|
21609
21722
|
compat: {
|
|
21610
21723
|
supportsDeveloperRole: false;
|
|
21611
21724
|
thinkingFormat: "zai";
|
|
21725
|
+
supportsReasoningEffort: true;
|
|
21612
21726
|
zaiToolStream: true;
|
|
21613
21727
|
};
|
|
21614
21728
|
reasoning: true;
|
|
21729
|
+
thinkingLevelMap: {
|
|
21730
|
+
off: null;
|
|
21731
|
+
minimal: null;
|
|
21732
|
+
low: string;
|
|
21733
|
+
medium: string;
|
|
21734
|
+
high: string;
|
|
21735
|
+
xhigh: string;
|
|
21736
|
+
max: string;
|
|
21737
|
+
};
|
|
21615
21738
|
input: "text"[];
|
|
21616
21739
|
cost: {
|
|
21617
21740
|
input: number;
|
|
@@ -21677,9 +21800,19 @@ export declare const MODELS: {
|
|
|
21677
21800
|
compat: {
|
|
21678
21801
|
supportsDeveloperRole: false;
|
|
21679
21802
|
thinkingFormat: "zai";
|
|
21803
|
+
supportsReasoningEffort: true;
|
|
21680
21804
|
zaiToolStream: true;
|
|
21681
21805
|
};
|
|
21682
21806
|
reasoning: true;
|
|
21807
|
+
thinkingLevelMap: {
|
|
21808
|
+
off: null;
|
|
21809
|
+
minimal: null;
|
|
21810
|
+
low: string;
|
|
21811
|
+
medium: string;
|
|
21812
|
+
high: string;
|
|
21813
|
+
xhigh: string;
|
|
21814
|
+
max: string;
|
|
21815
|
+
};
|
|
21683
21816
|
input: "text"[];
|
|
21684
21817
|
cost: {
|
|
21685
21818
|
input: number;
|
|
@@ -21699,9 +21832,19 @@ export declare const MODELS: {
|
|
|
21699
21832
|
compat: {
|
|
21700
21833
|
supportsDeveloperRole: false;
|
|
21701
21834
|
thinkingFormat: "zai";
|
|
21835
|
+
supportsReasoningEffort: true;
|
|
21702
21836
|
zaiToolStream: true;
|
|
21703
21837
|
};
|
|
21704
21838
|
reasoning: true;
|
|
21839
|
+
thinkingLevelMap: {
|
|
21840
|
+
off: null;
|
|
21841
|
+
minimal: null;
|
|
21842
|
+
low: string;
|
|
21843
|
+
medium: string;
|
|
21844
|
+
high: string;
|
|
21845
|
+
xhigh: string;
|
|
21846
|
+
max: string;
|
|
21847
|
+
};
|
|
21705
21848
|
input: "text"[];
|
|
21706
21849
|
cost: {
|
|
21707
21850
|
input: number;
|