@workglow/openai 0.3.23 → 0.3.25

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.
@@ -18,6 +18,11 @@ declare const OpenAiProvider_base: new (promiseRunFns?: readonly import("@workgl
18
18
  credential_key?: string | undefined;
19
19
  model_name: string;
20
20
  organization?: string | undefined;
21
+ prompt_cache_key?: string | undefined;
22
+ reasoning?: {
23
+ effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
24
+ mode?: "pro" | undefined;
25
+ } | undefined;
21
26
  trustedBaseUrl?: boolean | undefined;
22
27
  };
23
28
  title?: string | undefined;
@@ -34,6 +39,11 @@ declare const OpenAiProvider_base: new (promiseRunFns?: readonly import("@workgl
34
39
  credential_key?: string | undefined;
35
40
  model_name: string;
36
41
  organization?: string | undefined;
42
+ prompt_cache_key?: string | undefined;
43
+ reasoning?: {
44
+ effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
45
+ mode?: "pro" | undefined;
46
+ } | undefined;
37
47
  trustedBaseUrl?: boolean | undefined;
38
48
  };
39
49
  title?: string | undefined;
@@ -50,6 +60,11 @@ declare const OpenAiProvider_base: new (promiseRunFns?: readonly import("@workgl
50
60
  credential_key?: string | undefined;
51
61
  model_name: string;
52
62
  organization?: string | undefined;
63
+ prompt_cache_key?: string | undefined;
64
+ reasoning?: {
65
+ effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
66
+ mode?: "pro" | undefined;
67
+ } | undefined;
53
68
  trustedBaseUrl?: boolean | undefined;
54
69
  };
55
70
  title?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAiProvider.d.ts","sourceRoot":"","sources":["../../src/ai/OpenAiProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKjD;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,mBAGlC;IACS,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAEpE;IAED,UAAmB,gBAAgB,IAAI,SAAS;QAAE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,CAElF;CACF"}
1
+ {"version":3,"file":"OpenAiProvider.d.ts","sourceRoot":"","sources":["../../src/ai/OpenAiProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKjD;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,mBAGlC;IACS,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAEpE;IAED,UAAmB,gBAAgB,IAAI,SAAS;QAAE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,CAElF;CACF"}
@@ -18,6 +18,11 @@ declare const OpenAiQueuedProvider_base: new (promiseRunFns?: readonly import("@
18
18
  credential_key?: string | undefined;
19
19
  model_name: string;
20
20
  organization?: string | undefined;
21
+ prompt_cache_key?: string | undefined;
22
+ reasoning?: {
23
+ effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
24
+ mode?: "pro" | undefined;
25
+ } | undefined;
21
26
  trustedBaseUrl?: boolean | undefined;
22
27
  };
23
28
  title?: string | undefined;
@@ -34,6 +39,11 @@ declare const OpenAiQueuedProvider_base: new (promiseRunFns?: readonly import("@
34
39
  credential_key?: string | undefined;
35
40
  model_name: string;
36
41
  organization?: string | undefined;
42
+ prompt_cache_key?: string | undefined;
43
+ reasoning?: {
44
+ effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
45
+ mode?: "pro" | undefined;
46
+ } | undefined;
37
47
  trustedBaseUrl?: boolean | undefined;
38
48
  };
39
49
  title?: string | undefined;
@@ -50,6 +60,11 @@ declare const OpenAiQueuedProvider_base: new (promiseRunFns?: readonly import("@
50
60
  credential_key?: string | undefined;
51
61
  model_name: string;
52
62
  organization?: string | undefined;
63
+ prompt_cache_key?: string | undefined;
64
+ reasoning?: {
65
+ effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
66
+ mode?: "pro" | undefined;
67
+ } | undefined;
53
68
  trustedBaseUrl?: boolean | undefined;
54
69
  };
55
70
  title?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAiQueuedProvider.d.ts","sourceRoot":"","sources":["../../src/ai/OpenAiQueuedProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM1C;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,yBAGxC;IACS,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAEpE;IAED,UAAmB,gBAAgB,IAAI,SAAS;QAAE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,CAElF;CACF"}
1
+ {"version":3,"file":"OpenAiQueuedProvider.d.ts","sourceRoot":"","sources":["../../src/ai/OpenAiQueuedProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM1C;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,yBAGxC;IACS,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAEpE;IAED,UAAmB,gBAAgB,IAAI,SAAS;QAAE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,CAElF;CACF"}
@@ -13,5 +13,36 @@ type OpenAIClientClass = new (config: any) => any;
13
13
  export declare function loadOpenAISDK(): Promise<OpenAIClientClass>;
14
14
  export declare function getClient(model: OpenAiModelConfig | undefined): Promise<any>;
15
15
  export declare function getModelName(model: OpenAiModelConfig | undefined): string;
16
+ /**
17
+ * Resolves the configured `reasoning` object for reasoning-capable models
18
+ * (the GPT-5.6 sol/terra/luna family and the o-series), sent verbatim as the
19
+ * Responses `reasoning` parameter. Returns `undefined` when unset so
20
+ * non-reasoning models and callers that don't opt in send no reasoning field.
21
+ */
22
+ export declare function getReasoningConfig(model: OpenAiModelConfig | undefined): {
23
+ effort?: string;
24
+ mode?: string;
25
+ } | undefined;
26
+ /**
27
+ * Resolves the Responses `prompt_cache_key`. Uses an explicit
28
+ * `provider_config.prompt_cache_key` override when set, otherwise derives a
29
+ * stable key from the request's cache-relevant prefix (model + system
30
+ * instructions + tools) so requests sharing that prefix converge on one key and
31
+ * hit the cache. GPT-5.6 bills cache writes, so a stable key (not a random one)
32
+ * is the cost-correct default.
33
+ */
34
+ export declare function resolvePromptCacheKey(model: OpenAiModelConfig | undefined, params: {
35
+ model?: unknown;
36
+ instructions?: unknown;
37
+ tools?: unknown;
38
+ }): string;
39
+ /**
40
+ * Applies the per-request Responses fields common to every OpenAI text run-fn:
41
+ * the model's `reasoning` config (when set) and a stable `prompt_cache_key`.
42
+ * Mutates and returns `params` so callers can inline it into the create call.
43
+ * Call this last, after model/instructions/tools are populated, so the cache
44
+ * key sees the full prefix.
45
+ */
46
+ export declare function finalizeResponsesRequest(model: OpenAiModelConfig | undefined, params: Record<string, unknown>): Record<string, unknown>;
16
47
  export {};
17
48
  //# sourceMappingURL=OpenAI_Client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_Client.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_Client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAA4C,CAAC;AAE/F,KAAK,iBAAiB,GAAG,KAAK,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;AAKlD,wBAAsB,aAAa,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAShE;AAgBD,wBAAsB,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,gBA4BnE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAMzE"}
1
+ {"version":3,"file":"OpenAI_Client.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_Client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAA4C,CAAC;AAE/F,KAAK,iBAAiB,GAAG,KAAK,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;AAKlD,wBAAsB,aAAa,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAShE;AAkBD,wBAAsB,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,gBA4BnE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAMzE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GACnC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAMhD;AAYD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GACnE,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB"}
@@ -40,6 +40,28 @@ export declare const OpenAiModelSchema: {
40
40
  readonly type: "string";
41
41
  readonly description: "OpenAI organization ID (optional).";
42
42
  };
43
+ readonly prompt_cache_key: {
44
+ readonly type: "string";
45
+ readonly description: "Overrides the auto-derived Responses prompt_cache_key. Requests sharing a key share a cached prefix; leave unset to derive a stable key from the model + system instructions + tools.";
46
+ readonly "x-ui-hidden": true;
47
+ };
48
+ readonly reasoning: {
49
+ readonly type: "object";
50
+ readonly description: "Reasoning controls for reasoning-capable models (e.g. the GPT-5.6 sol/terra/luna family), sent on the Responses API.";
51
+ readonly properties: {
52
+ readonly effort: {
53
+ readonly type: "string";
54
+ readonly enum: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
55
+ readonly description: "Reasoning effort. Higher effort trades latency and cost for quality.";
56
+ };
57
+ readonly mode: {
58
+ readonly type: "string";
59
+ readonly enum: readonly ["pro"];
60
+ readonly description: "Set to 'pro' for the quality-first pro configuration on supported models.";
61
+ };
62
+ };
63
+ readonly additionalProperties: false;
64
+ };
43
65
  };
44
66
  readonly required: readonly ["model_name"];
45
67
  readonly additionalProperties: false;
@@ -106,6 +128,28 @@ export declare const OpenAiModelRecordSchema: {
106
128
  readonly type: "string";
107
129
  readonly description: "OpenAI organization ID (optional).";
108
130
  };
131
+ readonly prompt_cache_key: {
132
+ readonly type: "string";
133
+ readonly description: "Overrides the auto-derived Responses prompt_cache_key. Requests sharing a key share a cached prefix; leave unset to derive a stable key from the model + system instructions + tools.";
134
+ readonly "x-ui-hidden": true;
135
+ };
136
+ readonly reasoning: {
137
+ readonly type: "object";
138
+ readonly description: "Reasoning controls for reasoning-capable models (e.g. the GPT-5.6 sol/terra/luna family), sent on the Responses API.";
139
+ readonly properties: {
140
+ readonly effort: {
141
+ readonly type: "string";
142
+ readonly enum: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
143
+ readonly description: "Reasoning effort. Higher effort trades latency and cost for quality.";
144
+ };
145
+ readonly mode: {
146
+ readonly type: "string";
147
+ readonly enum: readonly ["pro"];
148
+ readonly description: "Set to 'pro' for the quality-first pro configuration on supported models.";
149
+ };
150
+ };
151
+ readonly additionalProperties: false;
152
+ };
109
153
  };
110
154
  readonly required: readonly ["model_name"];
111
155
  readonly additionalProperties: false;
@@ -173,6 +217,28 @@ export declare const OpenAiModelConfigSchema: {
173
217
  readonly type: "string";
174
218
  readonly description: "OpenAI organization ID (optional).";
175
219
  };
220
+ readonly prompt_cache_key: {
221
+ readonly type: "string";
222
+ readonly description: "Overrides the auto-derived Responses prompt_cache_key. Requests sharing a key share a cached prefix; leave unset to derive a stable key from the model + system instructions + tools.";
223
+ readonly "x-ui-hidden": true;
224
+ };
225
+ readonly reasoning: {
226
+ readonly type: "object";
227
+ readonly description: "Reasoning controls for reasoning-capable models (e.g. the GPT-5.6 sol/terra/luna family), sent on the Responses API.";
228
+ readonly properties: {
229
+ readonly effort: {
230
+ readonly type: "string";
231
+ readonly enum: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
232
+ readonly description: "Reasoning effort. Higher effort trades latency and cost for quality.";
233
+ };
234
+ readonly mode: {
235
+ readonly type: "string";
236
+ readonly enum: readonly ["pro"];
237
+ readonly description: "Set to 'pro' for the quality-first pro configuration on supported models.";
238
+ };
239
+ };
240
+ readonly additionalProperties: false;
241
+ };
176
242
  };
177
243
  readonly required: readonly ["model_name"];
178
244
  readonly additionalProperties: false;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_ModelSchema.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ModelSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAwB,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGzE,eAAO,MAAM,iBAAiB;mBACtB,QAAQ;;iBAEZ,QAAQ;qBACN,KAAK;qBACL,WAAW,EAAE,uCAAuC;;iBAEtD,eAAe;qBACb,IAAI,EAAE,QAAQ;qBACd,WAAW,EAAE,gCAAgC;qBAC7C,UAAU;yBACR,UAAU;6BACR,IAAI,EAAE,QAAQ;6BACd,WAAW,EAAE,yEAAyE;;yBAExF,cAAc;6BACZ,IAAI,EAAE,QAAQ;6BACd,MAAM,EAAE,YAAY;6BACpB,WAAW,EAAE,yDAAyD;6BACtE,aAAa;;yBAEf,QAAQ;6BACN,IAAI,EAAE,QAAQ;6BACd,WAAW,EAAE,wEAAwE;6BACrF,OAAO,EAAE,2BAA2B;;yBAEtC,cAAc;6BACZ,IAAI,EAAE,SAAS;6BACf,WAAW,EACT,gOAAgO;6BAClO,OAAO;6BACP,aAAa;;yBAEf,YAAY;6BACV,IAAI,EAAE,QAAQ;6BACd,WAAW,EAAE,oCAAoC;;;qBAGrD,QAAQ;qBACR,oBAAoB;;;;;CAKe,CAAC;AAE1C,eAAO,MAAM,uBAAuB;mBAC5B,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;qBA3CV,KAAK;qBACL,WAAW,EAAE,uCAAuC;;;qBAGpD,IAAI,EAAE,QAAQ;qBACd,WAAW,EAAE,gC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ACR,UAAU;6BACR,IAAI,EAAE,QAAQ;6BACd,WAAW,EAAE,yEAAyE;;yBAExF,cAAc;6BACZ,IAAI,EAAE,QAAQ;6BACd,MAAM,EAAE,YAAY;6BACpB,WAAW,EAAE,yDAAyD;6BACtE,aAAa;;yBAEf,QAAQ;6BACN,IAAI,EAAE,QAAQ;6BACd,WAAW,EAAE,wEAAwE;6BACrF,OAAO,EAAE,2BAA2B;;yBAEtC,cAAc;6BACZ,IAAI,EAAE,SAAS;6BACf,WAAW,EACT,gOAAgO;6BAClO,OAAO;6BACP,aAAa;;yBAEf,YAAY;6BACV,IAAI,EAAE,QAAQ;6BACd,WAAW,EAAE,oCAAoC;;yBAEnD,gBAAgB;6BACd,IAAI,EAAE,QAAQ;6BACd,WAAW,EACT,uLAAuL;6BACzL,aAAa;;yBAEf,SAAS;6BACP,IAAI,EAAE,QAAQ;6BACd,WAAW,EACT,sHAAsH;6BACxH,UAAU;iCACR,MAAM;qCACJ,IAAI,EAAE,QAAQ;qCACd,IAAI;qCACJ,WAAW,EAAE,sEAAsE;;iCAErF,IAAI;qCACF,IAAI,EAAE,QAAQ;qCACd,IAAI;qCACJ,WAAW,EACT,2EAA2E;;;6BAGjF,oBAAoB;;;qBAGxB,QAAQ;qBACR,oBAAoB;;;;;CA2Be,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_ModelSearch.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ModelSearch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAuEtB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,CAUtB,CAAC"}
1
+ {"version":3,"file":"OpenAI_ModelSearch.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ModelSearch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AA2EtB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,CAUtB,CAAC"}
@@ -5,6 +5,15 @@
5
5
  */
6
6
  import type { AiProviderRunFn, StructuredGenerationTaskInput, StructuredGenerationTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
+ /**
9
+ * Whether a JSON schema satisfies the Responses `strict` subset — every object
10
+ * has `additionalProperties: false` and lists all of its properties in
11
+ * `required`, recursively. Combinators (`anyOf`/`oneOf`/`allOf`) and `$ref` are
12
+ * treated conservatively as non-strict. When false we send `strict: false` so
13
+ * the request isn't rejected with a 400; the `StructuredGenerationTask` consumer
14
+ * still re-validates (and retries) the output against the original schema.
15
+ */
16
+ export declare function isStrictCompatibleSchema(schema: unknown): boolean;
8
17
  /**
9
18
  * Streaming run-fn for `["text.generation", "json-mode"]`. Emits
10
19
  * `object-delta` events with progressively-completed partial JSON snapshots
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_StructuredGeneration.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_StructuredGeneration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,EAAE,eAAe,CAC9D,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,CA6ClB,CAAC"}
1
+ {"version":3,"file":"OpenAI_StructuredGeneration.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_StructuredGeneration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAwBjE;AAED;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,EAAE,eAAe,CAC9D,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,CA0DlB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_TextGeneration.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextGeneration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAgD9D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,eAAe,CACxD,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CA0BlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_TextGeneration.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextGeneration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAoD9D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,eAAe,CACxD,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CAsBlB,CAAC"}
@@ -7,7 +7,8 @@ import type { AiProviderRunFn, TextRewriterTaskInput, TextRewriterTaskOutput } f
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
8
  /**
9
9
  * Streaming run-fn for `["text.rewriter"]`. Emits `text-delta` events on
10
- * the `text` port and a final empty `finish` event.
10
+ * the `text` port and a final empty `finish` event. The rewrite instruction
11
+ * is sent as the Responses `instructions` (system) channel.
11
12
  */
12
13
  export declare const OpenAI_TextRewriter_Stream: AiProviderRunFn<TextRewriterTaskInput, TextRewriterTaskOutput, OpenAiModelConfig>;
13
14
  //# sourceMappingURL=OpenAI_TextRewriter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_TextRewriter.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextRewriter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEnG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,eAAe,CACtD,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAwBlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_TextRewriter.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextRewriter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGnG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,eAAe,CACtD,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAkBlB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_TextSummary.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextSummary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAwBlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_TextSummary.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextSummary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAkBlB,CAAC"}
@@ -7,8 +7,8 @@ import type { AiProviderRunFn, ToolCallingTaskInput, ToolCallingTaskOutput } fro
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
8
  /**
9
9
  * Streaming run-fn for `["text.generation", "tool-use"]`. Calls the OpenAI
10
- * chat-completions endpoint with `stream: true` and forwards delta events via
11
- * {@link accumulateOpenAIStream}, which emits `text-delta` and tool-call
10
+ * Responses endpoint with `stream: true` and forwards delta events via
11
+ * {@link accumulateOpenAIResponsesStream}, which emits `text-delta` and tool-call
12
12
  * `object-delta` events plus a final empty `finish`.
13
13
  *
14
14
  * Defence-in-depth: each tool-call `object-delta` is filtered against
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_ToolCalling.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ToolCalling.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAiClB,CAAC"}
1
+ {"version":3,"file":"OpenAI_ToolCalling.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ToolCalling.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAyClB,CAAC"}
@@ -9,6 +9,8 @@ export * from "./common/OpenAI_ImageValidation";
9
9
  export * from "./common/OpenAI_ModelSchema";
10
10
  export * from "./common/OpenAI_ModelSearch";
11
11
  export * from "./registerOpenAi";
12
+ import { getReasoningConfig, resolvePromptCacheKey } from "./common/OpenAI_Client";
13
+ import { isStrictCompatibleSchema } from "./common/OpenAI_StructuredGeneration";
12
14
  import { OpenAiQueuedProvider } from "./OpenAiQueuedProvider";
13
15
  /**
14
16
  * @internal Symbols exported only for use by `@workglow/test`. Not part of the stable public API.
@@ -31,9 +33,17 @@ export declare const _testOnly: {
31
33
  credential_key?: string | undefined;
32
34
  model_name: string;
33
35
  organization?: string | undefined;
36
+ prompt_cache_key?: string | undefined;
37
+ reasoning?: {
38
+ effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | undefined;
39
+ mode?: "pro" | undefined;
40
+ } | undefined;
34
41
  trustedBaseUrl?: boolean | undefined;
35
42
  };
36
43
  title?: string | undefined;
37
44
  }>[];
45
+ readonly getReasoningConfig: typeof getReasoningConfig;
46
+ readonly resolvePromptCacheKey: typeof resolvePromptCacheKey;
47
+ readonly isStrictCompatibleSchema: typeof isStrictCompatibleSchema;
38
48
  };
39
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AAIjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;CAIZ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOZ,CAAC"}