@pure01fx/dsh-openai-codex-auth 0.5.0 → 0.6.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.
- package/CHANGELOG.md +42 -0
- package/README.md +33 -5
- package/client.js +186 -16
- package/cordis.patch.yml +2 -6
- package/lib/catalog.d.ts +77 -0
- package/lib/catalog.js +383 -0
- package/lib/endpoint.d.ts +2 -0
- package/lib/endpoint.js +38 -0
- package/lib/index.d.ts +63 -17
- package/lib/index.js +535 -130
- package/lib/native-adapter.d.ts +43 -0
- package/lib/native-adapter.js +246 -0
- package/lib/native-http.d.ts +61 -0
- package/lib/native-http.js +602 -0
- package/lib/native-websocket-session.d.ts +14 -0
- package/lib/native-websocket-session.js +109 -0
- package/lib/native-websocket-socket.d.ts +28 -0
- package/lib/native-websocket-socket.js +215 -0
- package/lib/native-websocket.d.ts +45 -0
- package/lib/native-websocket.js +615 -0
- package/lib/rate-limits.d.ts +35 -0
- package/lib/rate-limits.js +189 -0
- package/lib/replay.d.ts +49 -0
- package/lib/replay.js +240 -0
- package/lib/response-usage.d.ts +14 -0
- package/lib/response-usage.js +35 -0
- package/lib/responses.d.ts +126 -0
- package/lib/responses.js +572 -0
- package/lib/sse.d.ts +13 -0
- package/lib/sse.js +81 -0
- package/lib/upstream.d.ts +6 -0
- package/lib/upstream.js +6 -0
- package/lib/usage.d.ts +29 -0
- package/lib/usage.js +160 -0
- package/package.json +47 -11
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Native Codex adapter with live catalog and HTTP/WebSocket transport delegation. */
|
|
2
|
+
import { LlmAdapter, type GenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
3
|
+
import type { NativeCodexModel, NativeCodexModelCatalog } from './catalog.js';
|
|
4
|
+
/** Production provider route owned by the package native Codex adapter after M6 cutover. */
|
|
5
|
+
export declare const CODEX_PROVIDER = "openai-codex";
|
|
6
|
+
/** Compatibility route retained for sessions created during the native preview. */
|
|
7
|
+
export declare const NATIVE_CODEX_PROVIDER = "openai-codex-native";
|
|
8
|
+
export declare const CODEX_FAST_ALIAS_SUFFIX = "-fast";
|
|
9
|
+
export declare const CODEX_FAST_SERVICE_TIER = "priority";
|
|
10
|
+
/** Pure network establishment failure; retried without consuming the finite stream budget. */
|
|
11
|
+
export declare const NATIVE_CODEX_CONNECTION_FAILED_CODE = "NATIVE_CODEX_CONNECTION_FAILED";
|
|
12
|
+
/** Retryable only at DSH's durable failed-step boundary after output became visible. */
|
|
13
|
+
export declare const NATIVE_CODEX_STREAM_INTERRUPTED_CODE = "NATIVE_CODEX_STREAM_INTERRUPTED";
|
|
14
|
+
/** Identify only DNS/TCP/socket establishment failures suitable for unbounded recovery. */
|
|
15
|
+
export declare function isNativeCodexConnectionFailure(error: unknown, depth?: number): boolean;
|
|
16
|
+
/** Match Codex's model-aware mapping from UI reasoning choices to Responses wire values. */
|
|
17
|
+
export declare function nativeCodexWireReasoningEffort(effort: string | undefined, model?: NativeCodexModel): string | undefined;
|
|
18
|
+
/** Request-scoped native Codex transport owned by this package. */
|
|
19
|
+
export interface NativeCodexTransportMode {
|
|
20
|
+
serviceTier?: typeof CODEX_FAST_SERVICE_TIER;
|
|
21
|
+
publicModel?: string;
|
|
22
|
+
authorityHash?: string;
|
|
23
|
+
/** Turn-scoped sticky routing state captured from a provider response. */
|
|
24
|
+
turnState?: string;
|
|
25
|
+
/** @internal Receives a newly observed bounded turn-state token. */
|
|
26
|
+
captureTurnState?: (state: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface NativeCodexTransport {
|
|
29
|
+
stream(options: GenerateOptions, mode?: NativeCodexTransportMode): AsyncIterable<StreamChunk>;
|
|
30
|
+
}
|
|
31
|
+
/** Package-owned DSH adapter with live catalog metadata and native transport delegation. */
|
|
32
|
+
export declare class NativeCodexAdapter extends LlmAdapter {
|
|
33
|
+
private readonly catalog?;
|
|
34
|
+
private readonly transport?;
|
|
35
|
+
constructor(catalog?: NativeCodexModelCatalog | undefined, transport?: NativeCodexTransport | undefined);
|
|
36
|
+
private assertProvider;
|
|
37
|
+
private assertNotAborted;
|
|
38
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
39
|
+
providerRetryPolicy(provider: string): ResolvedRetryPolicy;
|
|
40
|
+
listModels(provider: string): Promise<readonly LlmModelInfo[]>;
|
|
41
|
+
resolveModel(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
42
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/** Native Codex adapter with live catalog and HTTP/WebSocket transport delegation. */
|
|
2
|
+
import { LlmAdapter, LlmError, ReasoningEffortId, } from '@deepseek-ai/dsh-llm';
|
|
3
|
+
/** Production provider route owned by the package native Codex adapter after M6 cutover. */
|
|
4
|
+
export const CODEX_PROVIDER = 'openai-codex';
|
|
5
|
+
/** Compatibility route retained for sessions created during the native preview. */
|
|
6
|
+
export const NATIVE_CODEX_PROVIDER = 'openai-codex-native';
|
|
7
|
+
const OWNED_CODEX_PROVIDERS = new Set([CODEX_PROVIDER, NATIVE_CODEX_PROVIDER]);
|
|
8
|
+
export const CODEX_FAST_ALIAS_SUFFIX = '-fast';
|
|
9
|
+
export const CODEX_FAST_SERVICE_TIER = 'priority';
|
|
10
|
+
/** Pure network establishment failure; retried without consuming the finite stream budget. */
|
|
11
|
+
export const NATIVE_CODEX_CONNECTION_FAILED_CODE = 'NATIVE_CODEX_CONNECTION_FAILED';
|
|
12
|
+
/** Retryable only at DSH's durable failed-step boundary after output became visible. */
|
|
13
|
+
export const NATIVE_CODEX_STREAM_INTERRUPTED_CODE = 'NATIVE_CODEX_STREAM_INTERRUPTED';
|
|
14
|
+
const NATIVE_CODEX_NETWORK_ERROR_CODES = new Set([
|
|
15
|
+
'EAI_AGAIN', 'ECONNREFUSED', 'ECONNRESET', 'EHOSTDOWN', 'EHOSTUNREACH',
|
|
16
|
+
'ENETDOWN', 'ENETUNREACH', 'ENOTFOUND', 'EPIPE', 'ETIMEDOUT',
|
|
17
|
+
'UND_ERR_CONNECT_TIMEOUT', 'UND_ERR_SOCKET',
|
|
18
|
+
]);
|
|
19
|
+
/** Identify only DNS/TCP/socket establishment failures suitable for unbounded recovery. */
|
|
20
|
+
export function isNativeCodexConnectionFailure(error, depth = 0) {
|
|
21
|
+
if (depth > 4 || typeof error !== 'object' || error === null)
|
|
22
|
+
return false;
|
|
23
|
+
const candidate = error;
|
|
24
|
+
if (typeof candidate.code === 'string'
|
|
25
|
+
&& NATIVE_CODEX_NETWORK_ERROR_CODES.has(candidate.code))
|
|
26
|
+
return true;
|
|
27
|
+
if (typeof candidate.message === 'string'
|
|
28
|
+
&& candidate.message.includes('Opening handshake has timed out'))
|
|
29
|
+
return true;
|
|
30
|
+
if (Array.isArray(candidate.errors)
|
|
31
|
+
&& candidate.errors.some(item => isNativeCodexConnectionFailure(item, depth + 1)))
|
|
32
|
+
return true;
|
|
33
|
+
return isNativeCodexConnectionFailure(candidate.cause, depth + 1);
|
|
34
|
+
}
|
|
35
|
+
function effortName(effort) {
|
|
36
|
+
switch (effort) {
|
|
37
|
+
case 'none': return 'None';
|
|
38
|
+
case 'minimal': return 'Minimal';
|
|
39
|
+
case 'low': return 'Low';
|
|
40
|
+
case 'medium': return 'Medium';
|
|
41
|
+
case 'high': return 'High';
|
|
42
|
+
case 'xhigh': return 'Extra High';
|
|
43
|
+
case 'max': return 'Max';
|
|
44
|
+
case 'ultra': return 'Ultra';
|
|
45
|
+
case 'persistent': return 'Persistent';
|
|
46
|
+
default: return effort;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function inputModalities(model) {
|
|
50
|
+
return model.inputModalities.filter((modality) => modality === 'text' || modality === 'image');
|
|
51
|
+
}
|
|
52
|
+
function supportsFast(model) {
|
|
53
|
+
return model.serviceTiers.some(tier => tier.id === CODEX_FAST_SERVICE_TIER)
|
|
54
|
+
|| model.additionalSpeedTiers.includes('fast');
|
|
55
|
+
}
|
|
56
|
+
function fastRoutes(models) {
|
|
57
|
+
const exact = new Set(models.map(model => model.slug));
|
|
58
|
+
const routes = new Map();
|
|
59
|
+
for (const model of models) {
|
|
60
|
+
const alias = `${model.slug}${CODEX_FAST_ALIAS_SUFFIX}`;
|
|
61
|
+
if (supportsFast(model) && !exact.has(alias))
|
|
62
|
+
routes.set(alias, model);
|
|
63
|
+
}
|
|
64
|
+
return routes;
|
|
65
|
+
}
|
|
66
|
+
/** Match Codex's model-aware mapping from UI reasoning choices to Responses wire values. */
|
|
67
|
+
export function nativeCodexWireReasoningEffort(effort, model) {
|
|
68
|
+
if (effort === undefined)
|
|
69
|
+
return undefined;
|
|
70
|
+
if (effort === 'persistent')
|
|
71
|
+
return 'disabled';
|
|
72
|
+
if (effort !== 'ultra')
|
|
73
|
+
return effort;
|
|
74
|
+
const supported = model?.supportedReasoningLevels ?? [];
|
|
75
|
+
const configured = model?.multiAgentReasoningEffort;
|
|
76
|
+
if (configured !== undefined && configured !== 'ultra'
|
|
77
|
+
&& supported.some(level => level.effort === configured))
|
|
78
|
+
return configured;
|
|
79
|
+
if (supported.some(level => level.effort === 'max'))
|
|
80
|
+
return 'max';
|
|
81
|
+
return [...supported].reverse().find(level => level.effort !== 'ultra')?.effort ?? 'medium';
|
|
82
|
+
}
|
|
83
|
+
function withWireReasoning(options, model) {
|
|
84
|
+
const selected = options.reasoningEffort === undefined ? undefined : String(options.reasoningEffort);
|
|
85
|
+
const wire = nativeCodexWireReasoningEffort(selected, model);
|
|
86
|
+
return wire === undefined || wire === selected
|
|
87
|
+
? options
|
|
88
|
+
: { ...options, reasoningEffort: ReasoningEffortId(wire) };
|
|
89
|
+
}
|
|
90
|
+
function listModel(provider, model, fast = false) {
|
|
91
|
+
const description = model.description;
|
|
92
|
+
return {
|
|
93
|
+
provider,
|
|
94
|
+
id: fast ? `${model.slug}${CODEX_FAST_ALIAS_SUFFIX}` : model.slug,
|
|
95
|
+
name: fast ? `${model.displayName} (Fast)` : model.displayName,
|
|
96
|
+
...description === undefined ? {} : { description },
|
|
97
|
+
inputModalities: inputModalities(model),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function resolvedModel(provider, model, fast = false) {
|
|
101
|
+
const info = {
|
|
102
|
+
...listModel(provider, model, fast),
|
|
103
|
+
...model.contextWindow === undefined ? {} : { context: { contextWindow: model.contextWindow } },
|
|
104
|
+
};
|
|
105
|
+
const efforts = [];
|
|
106
|
+
const seen = new Set();
|
|
107
|
+
for (const level of model.supportedReasoningLevels) {
|
|
108
|
+
if (seen.has(level.effort))
|
|
109
|
+
continue;
|
|
110
|
+
seen.add(level.effort);
|
|
111
|
+
const id = ReasoningEffortId(level.effort);
|
|
112
|
+
efforts.push({
|
|
113
|
+
id,
|
|
114
|
+
name: effortName(level.effort),
|
|
115
|
+
...level.description === undefined ? {} : { description: level.description },
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
const defaultEffort = model.defaultReasoningLevel !== undefined
|
|
119
|
+
&& seen.has(model.defaultReasoningLevel)
|
|
120
|
+
? ReasoningEffortId(model.defaultReasoningLevel)
|
|
121
|
+
: undefined;
|
|
122
|
+
if (efforts.length > 0) {
|
|
123
|
+
info.reasoning = {
|
|
124
|
+
efforts,
|
|
125
|
+
...defaultEffort === undefined ? {} : { defaultEffort },
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return info;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Match Codex's five dropped-stream retries at DSH's durable failed-step boundary.
|
|
132
|
+
* The transports still own only safe pre-output retries; once a chunk is visible,
|
|
133
|
+
* dsh-llm-retry reconstructs a fresh agent turn without persisting failed chunks.
|
|
134
|
+
*/
|
|
135
|
+
const NATIVE_RETRY_POLICY = Object.freeze({
|
|
136
|
+
mode: 'normal',
|
|
137
|
+
maxRetries: 5,
|
|
138
|
+
retryableCodes: Object.freeze([
|
|
139
|
+
'EMPTY_RESPONSE',
|
|
140
|
+
NATIVE_CODEX_STREAM_INTERRUPTED_CODE,
|
|
141
|
+
]),
|
|
142
|
+
initialDelayMs: 200,
|
|
143
|
+
maxDelayMs: 10_000,
|
|
144
|
+
jitterRatio: 0.1,
|
|
145
|
+
});
|
|
146
|
+
/** Package-owned DSH adapter with live catalog metadata and native transport delegation. */
|
|
147
|
+
export class NativeCodexAdapter extends LlmAdapter {
|
|
148
|
+
catalog;
|
|
149
|
+
transport;
|
|
150
|
+
constructor(catalog, transport) {
|
|
151
|
+
super();
|
|
152
|
+
this.catalog = catalog;
|
|
153
|
+
this.transport = transport;
|
|
154
|
+
}
|
|
155
|
+
assertProvider(provider) {
|
|
156
|
+
if (!OWNED_CODEX_PROVIDERS.has(provider)) {
|
|
157
|
+
throw new LlmError(`native Codex adapter does not own provider "${provider}"`, 'NO_ADAPTER');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
assertNotAborted(signal) {
|
|
161
|
+
if (signal?.aborted) {
|
|
162
|
+
throw new LlmError('native Codex request was aborted', 'ABORTED');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
providerInfo(provider) {
|
|
166
|
+
this.assertProvider(provider);
|
|
167
|
+
return {
|
|
168
|
+
id: provider,
|
|
169
|
+
name: provider === CODEX_PROVIDER ? 'OpenAI Codex' : 'OpenAI Codex (Native Compatibility)',
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
providerRetryPolicy(provider) {
|
|
173
|
+
this.assertProvider(provider);
|
|
174
|
+
return NATIVE_RETRY_POLICY;
|
|
175
|
+
}
|
|
176
|
+
async listModels(provider) {
|
|
177
|
+
this.assertProvider(provider);
|
|
178
|
+
const models = await this.catalog?.list() ?? [];
|
|
179
|
+
const aliases = fastRoutes(models);
|
|
180
|
+
return models
|
|
181
|
+
.filter(model => model.visibility === 'list')
|
|
182
|
+
.sort((left, right) => left.priority - right.priority)
|
|
183
|
+
.flatMap(model => {
|
|
184
|
+
const alias = `${model.slug}${CODEX_FAST_ALIAS_SUFFIX}`;
|
|
185
|
+
return [
|
|
186
|
+
listModel(provider, model),
|
|
187
|
+
...aliases.get(alias) === model ? [listModel(provider, model, true)] : [],
|
|
188
|
+
];
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
async resolveModel(provider, model, signal) {
|
|
192
|
+
this.assertNotAborted(signal);
|
|
193
|
+
this.assertProvider(provider);
|
|
194
|
+
const models = await this.catalog?.list(signal) ?? [];
|
|
195
|
+
this.assertNotAborted(signal);
|
|
196
|
+
const exact = models.find(candidate => candidate.slug === model);
|
|
197
|
+
if (exact !== undefined)
|
|
198
|
+
return resolvedModel(provider, exact);
|
|
199
|
+
const fast = fastRoutes(models).get(model);
|
|
200
|
+
if (fast !== undefined)
|
|
201
|
+
return resolvedModel(provider, fast, true);
|
|
202
|
+
if (model.endsWith(CODEX_FAST_ALIAS_SUFFIX)) {
|
|
203
|
+
throw new LlmError('native Codex Fast is not advertised for the selected model', 'FAST_UNSUPPORTED');
|
|
204
|
+
}
|
|
205
|
+
return { provider, id: model, name: model };
|
|
206
|
+
}
|
|
207
|
+
async *stream(options) {
|
|
208
|
+
this.assertNotAborted(options.signal);
|
|
209
|
+
this.assertProvider(options.provider);
|
|
210
|
+
if (this.transport === undefined) {
|
|
211
|
+
throw new LlmError('native Codex transport is not configured', 'NATIVE_TRANSPORT_NOT_CONFIGURED');
|
|
212
|
+
}
|
|
213
|
+
if (options.model.endsWith(CODEX_FAST_ALIAS_SUFFIX)) {
|
|
214
|
+
const view = this.catalog?.listWithAuthority === undefined
|
|
215
|
+
? { models: await this.catalog?.list(options.signal) ?? [] }
|
|
216
|
+
: await this.catalog.listWithAuthority(options.signal);
|
|
217
|
+
this.assertNotAborted(options.signal);
|
|
218
|
+
const exact = view.models.find(candidate => candidate.slug === options.model);
|
|
219
|
+
if (exact !== undefined) {
|
|
220
|
+
yield* this.transport.stream(withWireReasoning(options, exact));
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const fast = fastRoutes(view.models).get(options.model);
|
|
224
|
+
if (fast === undefined) {
|
|
225
|
+
throw new LlmError('native Codex Fast is not advertised for the selected model', 'FAST_UNSUPPORTED');
|
|
226
|
+
}
|
|
227
|
+
if (view.authorityHash === undefined) {
|
|
228
|
+
throw new LlmError('native Codex Fast capability authority is unavailable', 'FAST_CAPABILITY_UNAVAILABLE');
|
|
229
|
+
}
|
|
230
|
+
yield* this.transport.stream({ ...withWireReasoning(options, fast), model: fast.slug }, {
|
|
231
|
+
serviceTier: CODEX_FAST_SERVICE_TIER,
|
|
232
|
+
publicModel: options.model,
|
|
233
|
+
authorityHash: view.authorityHash,
|
|
234
|
+
});
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const selectedEffort = options.reasoningEffort === undefined
|
|
238
|
+
? undefined : String(options.reasoningEffort);
|
|
239
|
+
const model = selectedEffort === 'ultra'
|
|
240
|
+
? (await this.catalog?.list(options.signal) ?? [])
|
|
241
|
+
.find(candidate => candidate.slug === options.model)
|
|
242
|
+
: undefined;
|
|
243
|
+
this.assertNotAborted(options.signal);
|
|
244
|
+
yield* this.transport.stream(withWireReasoning(options, model));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type ContentBlock, type GenerateOptions, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import { type NativeCodexCredential } from './catalog.js';
|
|
3
|
+
import { type NativeCodexTransportMode } from './native-adapter.js';
|
|
4
|
+
import { type CodexResponseUsageCallback } from './response-usage.js';
|
|
5
|
+
import { type CodexRateLimitCallback } from './rate-limits.js';
|
|
6
|
+
export declare const CODEX_RESPONSES_URL = "https://chatgpt.com/backend-api/codex/responses";
|
|
7
|
+
type ImageBlock = Extract<ContentBlock, {
|
|
8
|
+
type: 'image';
|
|
9
|
+
}>;
|
|
10
|
+
export interface NativeCodexImageRead {
|
|
11
|
+
data: Uint8Array;
|
|
12
|
+
}
|
|
13
|
+
export interface NativeCodexHttpOptions {
|
|
14
|
+
resolveCredential(signal?: AbortSignal): Promise<NativeCodexCredential>;
|
|
15
|
+
recoverCredential?(previous: NativeCodexCredential, signal?: AbortSignal): Promise<boolean>;
|
|
16
|
+
readImage?(attachment: ImageBlock['attachment'], signal?: AbortSignal): Promise<NativeCodexImageRead>;
|
|
17
|
+
fetch?: typeof fetch;
|
|
18
|
+
endpoint?: string;
|
|
19
|
+
requestTimeoutMs?: number;
|
|
20
|
+
streamIdleTimeoutMs?: number;
|
|
21
|
+
maxSseEventBytes?: number;
|
|
22
|
+
maxTransientRetries?: number;
|
|
23
|
+
initialRetryDelayMs?: number;
|
|
24
|
+
maxRetryDelayMs?: number;
|
|
25
|
+
maxRequestBodyBytes?: number;
|
|
26
|
+
random?: () => number;
|
|
27
|
+
sleep?: (delayMs: number, signal?: AbortSignal) => Promise<void>;
|
|
28
|
+
createRequestId?: () => string;
|
|
29
|
+
onCompleted?: () => void;
|
|
30
|
+
onRateLimits?: CodexRateLimitCallback;
|
|
31
|
+
onResponseUsage?: CodexResponseUsageCallback;
|
|
32
|
+
warn?: (message: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface NativeCodexPreparedRequest {
|
|
35
|
+
generation: GenerateOptions;
|
|
36
|
+
mode: NativeCodexTransportMode;
|
|
37
|
+
request: Record<string, unknown>;
|
|
38
|
+
body: string;
|
|
39
|
+
routingId: string;
|
|
40
|
+
routingHint: string;
|
|
41
|
+
}
|
|
42
|
+
/** HTTP Responses transport. It never retains a credential outside one attempt. */
|
|
43
|
+
export declare class NativeCodexHttpTransport {
|
|
44
|
+
private readonly options;
|
|
45
|
+
private readonly fetchImpl;
|
|
46
|
+
private readonly endpoint;
|
|
47
|
+
private readonly requestTimeoutMs;
|
|
48
|
+
private readonly idleTimeoutMs;
|
|
49
|
+
private readonly maxRetries;
|
|
50
|
+
private readonly initialDelayMs;
|
|
51
|
+
private readonly maxDelayMs;
|
|
52
|
+
private readonly maxBodyBytes;
|
|
53
|
+
constructor(options: NativeCodexHttpOptions);
|
|
54
|
+
private retryDelay;
|
|
55
|
+
private wait;
|
|
56
|
+
private waitForConnection;
|
|
57
|
+
endpointUrl(): string;
|
|
58
|
+
prepare(generation: GenerateOptions, mode?: NativeCodexTransportMode): Promise<NativeCodexPreparedRequest>;
|
|
59
|
+
stream(generation: GenerateOptions, mode?: NativeCodexTransportMode): AsyncIterable<StreamChunk>;
|
|
60
|
+
}
|
|
61
|
+
export {};
|