Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Google Gemini provides embedding models through the Gemini API with simple API key authentication.
Quick Start
from praisonaiagents import embedding
result = embedding(
input="Hello world",
model="gemini/text-embedding-004"
)
print(f"Dimensions: {len(result.embeddings[0])}")
CLI Usage
praisonai embed "Hello world" --model gemini/text-embedding-004
Setup
export GEMINI_API_KEY="your-gemini-api-key"
# or
export GOOGLE_API_KEY="your-google-api-key"
Available Models
| Model | Dimensions | Use Case |
|---|
gemini/text-embedding-004 | 768 | Latest, recommended |
gemini/embedding-001 | 768 | Legacy model |
Batch Embeddings
from praisonaiagents import embedding
texts = ["Document 1", "Document 2", "Document 3"]
result = embedding(
input=texts,
model="gemini/text-embedding-004"
)
print(f"Generated {len(result.embeddings)} embeddings")
Task Types
from praisonaiagents import embedding
# For retrieval queries
result = embedding(
input="What is machine learning?",
model="gemini/text-embedding-004",
task_type="RETRIEVAL_QUERY"
)
# For documents
result = embedding(
input="Machine learning is...",
model="gemini/text-embedding-004",
task_type="RETRIEVAL_DOCUMENT"
)