@llm-tools/embedjs-utils
Version:
Useful util functions when extending the embedjs ecosystem
24 lines (23 loc) • 638 B
TypeScript
type getSafeResponsePartial = {
headers: Headers;
statusCode: number;
};
export declare function getSafe(url: string, options: {
headers?: Record<string, string>;
format: 'text';
}): Promise<{
body: string;
} & getSafeResponsePartial>;
export declare function getSafe(url: string, options: {
headers?: Record<string, string>;
format: 'buffer';
}): Promise<{
body: Buffer;
} & getSafeResponsePartial>;
export declare function getSafe(url: string, options?: {
headers?: Record<string, string>;
format?: 'stream';
}): Promise<{
body: NodeJS.ReadableStream;
} & getSafeResponsePartial>;
export {};