{ "cells": [ { "cell_type": "markdown", "id": "8b538d3a", "metadata": {}, "source": [ "# `GeminiClient` client\n", "\n", "This notebook demonstrates how to instantiate the GeminiClient object. GeminiClient is a subclass of the BaseLLMClient Abstract class.\n", "\n", "For more thorough look at GeminiClient's structure, look to the [GeminiClient](../../../docs/build/html/_autosummary/ai_sentinel.llm.GeminiClient.html) or [BaseLLMClient](../../../docs/build/html/_autosummary/ai_sentinel.llm.BaseLLMClient.html) API reference. " ] }, { "cell_type": "markdown", "id": "e499f68b", "metadata": {}, "source": [ "### Setting up the Client\n", "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](https://aistudio.google.com/apikey) and passing in a valid Gemini model." ] }, { "cell_type": "code", "execution_count": null, "id": "dd16785c", "metadata": {}, "outputs": [], "source": [ "from ai_sentinel import GeminiClient\n", "\n", "# Initialize an Gemini LLM Client\n", "client = GeminiClient(\n", " api_key=\"YOUR_API_KEY\",\n", " model=\"gemini-2.0-flash\",\n", ")" ] }, { "cell_type": "markdown", "id": "aeb68e29", "metadata": {}, "source": [ "Once the Client is set up, all further usage in the code will be with the [ToxicityGuard](example_notebooks/api_examples/guards/basic_usage.ipynb)" ] }, { "cell_type": "markdown", "id": "b918e04e", "metadata": {}, "source": [ "## Environment variable names\n", "The following is the recommended format to follow for key naming convention when working with Google Gemini" ] }, { "cell_type": "code", "execution_count": null, "id": "5a42cd56", "metadata": {}, "outputs": [], "source": [ "GEMINI_API_KEY='YOUR_API_KEY'" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 5 }