/** * Internal dependencies */ import ChatSession from './chat-session'; import type { ModelMetadata, ModelParams, Content, Part, Candidates, AsyncCandidatesGenerator } from '../types'; type ModelData = { serviceSlug: string; metadata: ModelMetadata; }; /** * Model class. * * @since 0.3.0 */ export default class GenerativeAiModel { serviceSlug: string; metadata: ModelMetadata; modelParams: ModelParams; /** * Constructor. * * @since 0.3.0 * * @param model - Model object. * @param modelParams - Model parameters passed. At a minimum this must include the unique "feature" identifier. */ constructor(model: ModelData, modelParams: ModelParams); /** * Gets the model slug. * * @since 0.3.0 * * @returns Model slug. */ getModelSlug(): string; /** * Gets the model metadata. * * @since 0.7.0 * * @returns Model metadata. */ getModelMetadata(): ModelMetadata; /** * Generates text content using the model. * * @since 0.3.0 * * @param content - Content data to pass to the model, including the prompt and optional history. * @returns Model response candidates with the generated text content. */ generateText(content: string | Part[] | Content | Content[]): Promise; /** * Generates text content using the model, streaming the response. * * @since 0.3.0 * * @param content - Content data to pass to the model, including the prompt and optional history. * @returns The generator that yields chunks of response candidates with the generated text content. */ streamGenerateText(content: string | Part[] | Content | Content[]): Promise; /** * Starts a multi-turn chat session using the model. * * @since 0.3.0 * * @param history - Chat history. * @returns Chat session. */ startChat(history: Content[]): ChatSession; /** * Generates an image using the model. * * @since 0.5.0 * * @param content - Content data to pass to the model, including the prompt and optional history. * @returns Model response candidates with the generated image. */ generateImage(content: string | Part[] | Content | Content[]): Promise; /** * Transforms text to speech using the model. * * @since 0.7.0 * * @param content - The content to transform to speech. * @returns Model response candidates with the generated speech. */ textToSpeech(content: string | Part[] | Content | Content[]): Promise; } export {}; //# sourceMappingURL=generative-ai-model.d.ts.map