generative-ts

Interface GoogleGeminiOptions

interface GoogleGeminiOptions {
    $prompt: string;
    $tools?: ToolDescriptor<{
        [key: string]: unknown;
    }, unknown>[];
    contents?: GoogleGeminiContentItem | GoogleGeminiContentItem[];
    examplePairs?: {
        assistant: string;
        user: string;
    }[];
    generation_config?: {
        candidate_count?: number;
        frequency_penalty?: number;
        max_output_tokens?: number;
        presence_penalty?: number;
        response_mime_type?: "text/plain" | "application/json";
        stop_sequences?: string[];
        temperature?: number;
        top_k?: number;
        top_p?: number;
    };
    modelId: string;
    safety_settings?: {
        category?: string;
        max_influential_terms?: number;
        method?: string;
        threshold?: string;
    };
    system?: string;
    system_instruction?: GoogleGeminiContentItem;
    tools?: {
        function_declarations: {
            description?: string;
            name: string;
            parameters?: GoogleGeminiSchema;
            response?: GoogleGeminiSchema;
        }[];
    }[];
    tools_config?: {
        allowed_function_names?: string[];
        mode?: "NONE" | "AUTO" | "ANY";
    };
}

Hierarchy

  • ModelRequestOptions
  • FewShotRequestOptions
  • ToolUseRequestOptions
  • GoogleGeminiToolsOptions
    • GoogleGeminiOptions

Properties

$prompt: string
$tools?: ToolDescriptor<{
    [key: string]: unknown;
}, unknown>[]
contents?: GoogleGeminiContentItem | GoogleGeminiContentItem[]
examplePairs?: {
    assistant: string;
    user: string;
}[]

Type declaration

  • assistant: string
  • user: string
generation_config?: {
    candidate_count?: number;
    frequency_penalty?: number;
    max_output_tokens?: number;
    presence_penalty?: number;
    response_mime_type?: "text/plain" | "application/json";
    stop_sequences?: string[];
    temperature?: number;
    top_k?: number;
    top_p?: number;
}

Type declaration

  • Optional candidate_count?: number
  • Optional frequency_penalty?: number
  • Optional max_output_tokens?: number
  • Optional presence_penalty?: number
  • Optional response_mime_type?: "text/plain" | "application/json"
  • Optional stop_sequences?: string[]
  • Optional temperature?: number
  • Optional top_k?: number
  • Optional top_p?: number
modelId: string
safety_settings?: {
    category?: string;
    max_influential_terms?: number;
    method?: string;
    threshold?: string;
}

Type declaration

  • Optional category?: string
  • Optional max_influential_terms?: number
  • Optional method?: string
  • Optional threshold?: string
system?: string
system_instruction?: GoogleGeminiContentItem
tools?: {
    function_declarations: {
        description?: string;
        name: string;
        parameters?: GoogleGeminiSchema;
        response?: GoogleGeminiSchema;
    }[];
}[]

Type declaration

  • function_declarations: {
        description?: string;
        name: string;
        parameters?: GoogleGeminiSchema;
        response?: GoogleGeminiSchema;
    }[]
tools_config?: {
    allowed_function_names?: string[];
    mode?: "NONE" | "AUTO" | "ANY";
}

Type declaration

  • Optional allowed_function_names?: string[]
  • Optional mode?: "NONE" | "AUTO" | "ANY"