Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.egisai.co/llms.txt

Use this file to discover all available pages before exploring further.

The SDK transparently governs calls made through the official google-generativeai Python package. After egisai.init() runs, calls made through GenerativeModel are policy-checked, audited, and (where applicable) sanitized before reaching the provider.

Supported surface

MethodSyncAsyncStreaming
GenerativeModel.generate_content

Minimum version

google-generativeai>=0.8 is recommended.

Install

pip install "egisai[google]"

Use

import egisai
import google.generativeai as genai

egisai.init(app="gemini-bot", env="production")

genai.configure(api_key="AIza…")
model = genai.GenerativeModel("gemini-1.5-pro")

response = model.generate_content("Hello!")
print(response.text)

Streaming

response = model.generate_content("Tell me a story.", stream=True)
for chunk in response:
    if chunk.text:
        print(chunk.text, end="", flush=True)

System instructions

When you pass a system_instruction= to GenerativeModel(...), the SDK reads it for sub-agent fingerprinting. To override identity explicitly, use set_context().

When a call is blocked

By default a blocked call raises PermissionError. Switch modes at init if you’d rather receive a refusal-shaped response:
egisai.init(..., on_block="stub")

What’s next

OpenAI

Anthropic