UNPKG

node-dalle2

Version:

Nodejs library for interacting with OpenAI's Dalle-2 AI

53 lines (52 loc) 1.11 kB
export interface RequestBody { task_type: string; prompt: { caption: string; batch_size: number; }; } export interface Task { object: string; id: string; created: number; task_type: string; status: string; status_information: {}; prompt_id: string; generations: ImageGenerations; prompt: { id: string; ojbect: string; created: number; prompt_type: string; prompt: { caption: string; }; parent_generation_id: string | null; }; } export interface IData { id: string; object: string; created: number; generation_type: string; generation: { image_path: string; }; task_id: string; prompt_id: string; is_public: boolean; } export declare type ImageData = IData[]; export interface ImageGenerations { object: string; data: ImageData; } export declare class Dalle { apiKey: string; url: string; constructor({ apiKey }: { apiKey: string; }); generate(prompt: string): Promise<ImageGenerations | null>; }