import { PromptFunctions, PromptMemory, PromptSection, Tokenizer } from "promptrix"; import { PromptCompletionModel, PromptResponse } from "./types"; import { RequestOptions } from "@google/generative-ai"; /** * Options to configure a `GoogleGenerativeModel`. */ export interface GoogleGenerativeModelOptions { /** * API key to use when calling the model. */ apiKey: string; /** * Name of the model to use when completing prompts. */ model: string; /** * Optional. Maximum number of tokens to let the prompt use when rendering. * @remarks * Defaults to `1024`. * * If the rendered prompt exceeds this limit, most `PromptCompletionClient` classes will return * a `response.status == 'too_long'`. */ maxInputTokens?: number; /** * Optional. What sampling temperature to use, between `0` and `2`. * @remarks * Higher values like `0.8` will make the output more random, while lower values like `0.2` will * make it more focused and deterministic. * * It's generally recommended to use this or `top_p` but not both. */ temperature?: number; /** * Optional. The maximum cumulative probability of tokens to consider when sampling. */ topP?: number; /** * Optional. The maximum number of tokens to consider when sampling. */ topK?: number; /** * Optional. The maximum number of tokens to generate for a completion. * @remarks * This value plus the `max_input_tokens` value cannot exceed the maximum number of tokens for * the models context window. */ maxOuptputTokens?: number; /** * Optional. Up to 5 sequences where the API will stop generating further tokens. * @remarks * The returned text will not contain the stop sequence. */ stopSequences?: Array | string; /** * Optional. Additional options for each model request. */ requestOptions?: RequestOptions; /** * Optional. Whether to log requests to the console. * @remarks * This is useful for debugging prompts and defaults to `false`. */ logRequests?: boolean; } /** * A `PromptCompletionModel` for calling Google Generative AI models. * @remarks */ export declare class GoogleGenerativeModel implements PromptCompletionModel { private readonly _client; /** * Creates a new `GoogleGenerativeModel` instance. * @param options Options to configure the model with. */ constructor(options: GoogleGenerativeModelOptions); /** * Options the model was configured with. */ readonly options: GoogleGenerativeModelOptions; /** * Completes a prompt. * @param memory Memory to use when rendering the prompt. * @param functions Functions to use when rendering the prompt. * @param tokenizer Tokenizer to use when rendering the prompt. * @param prompt Prompt to complete. * @returns A `PromptResponse` with the status and message. */ completePrompt(memory: PromptMemory, functions: PromptFunctions, tokenizer: Tokenizer, prompt: PromptSection): Promise; } //# sourceMappingURL=GoogleGenerativeModel.d.ts.map