universal-pdp-scrapper
Version:
A universal pdp scrapper using cheerio & ChatGPT
9 lines (8 loc) • 566 B
TypeScript
import { OpenAI } from 'openai';
import type { ProductMetadata } from '@/types/scrapperOutput';
export declare const getClient: (config: {
apiKey: string;
organization?: string;
}) => OpenAI;
export declare const getCompletion: (prompt: string, client: OpenAI, model?: string) => Promise<string | null | undefined>;
export declare const scrapeUsingAI: (client: OpenAI, productUrl: string, htmlContent?: string, userId?: string, metadata?: Record<string, string>, model?: string, trimToMaxToken?: number, timeoutSeconds?: number) => Promise<ProductMetadata>;