batch_embed_contents | Compute embedding vectors for up to 100 texts in a single request. Arguments: model (string, e.g. “gemini-embedding-001”); texts (array of strings, max 100). Returns: embeddings (array of objects each with values: array of floats). |
embed_content | Compute an embedding vector for a single text. Arguments: model (string, e.g. “gemini-embedding-001”); text (string); task_type (optional string — RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, QUESTION_ANSWERING, FACT_VERIFICATION); output_dimensionality (optional integer, reduced embedding dimension). Returns: embedding.values (array of floats). |
generate_content | Generate a model reply for a text prompt (non-streaming). Arguments: model (string, e.g. “gemini-2.5-flash”); prompt (string, the user message); system_instruction (optional string, developer instructions); history (optional array of objects {role: “user”|“model”, text: string} for multi-turn conversations); temperature (number 0–2); max_output_tokens (integer ≥ 1); response_mime_type (“text/plain” or “application/json”); response_schema (optional object, JSON Schema for structured output). Returns: candidates[0].content.parts[0].text and usageMetadata (prompt_token_count, candidates_token_count, total_token_count). |