GeminiClient client

This notebook demonstrates how to instantiate the GeminiClient object. GeminiClient is a subclass of the BaseLLMClient Abstract class.

For more thorough look at GeminiClient’s structure, look to the GeminiClient or BaseLLMClient API reference.

Setting up the Client

To set up the Gemini Client there are 2 required parameters, your personal Google Gemini API Key, which can be set up through Google AI Studio and passing in a valid Gemini model.

[ ]:
from ai_sentinel import GeminiClient

# Initialize an Gemini LLM Client
client = GeminiClient(
    api_key="YOUR_API_KEY",
    model="gemini-2.0-flash",
)

Once the Client is set up, all further usage in the code will be with the ToxicityGuard

Environment variable names

The following is the recommended format to follow for key naming convention when working with Google Gemini

[ ]:
GEMINI_API_KEY='YOUR_API_KEY'