@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
30 lines (29 loc) • 1.08 kB
TypeScript
import OpenAI from 'openai';
import type { OpenAiCompatibleExecutionToolsNonProxiedOptions } from './OpenAiCompatibleExecutionToolsOptions';
/**
* Manages OpenAI-compatible client creation plus shared retry and rate-limit behavior.
*
* @private helper of `OpenAiCompatibleExecutionTools`
*/
export declare class OpenAiCompatibleRequestManager {
private readonly options;
private client;
private readonly limiter;
constructor(options: OpenAiCompatibleExecutionToolsNonProxiedOptions);
/**
* Returns the lazily initialized OpenAI client configured from execution-tool options.
*/
getClient(): Promise<OpenAI>;
/**
* Schedules one request through the shared limiter and retry policy.
*/
executeRateLimitedRequest<T>(requestFn: () => Promise<T>): Promise<T>;
/**
* Retries transient transport errors with exponential backoff.
*/
private makeRequestWithNetworkRetry;
/**
* Determines whether the thrown error should be retried as a transient network failure.
*/
private isRetryableNetworkError;
}