
NOTICE: All information contained herein is, and remains
the property of TechnoCore.
The intellectual and technical concepts contained
herein are proprietary to TechnoCore and dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from TechnoCore.
The ObjAiMcpGoogle class provides an interface to Google's Gemini family of language models. It is part of the Multi-Cloud Provider (MCP) framework and inherits from the ObjAiMcpBase class.
The class is initialized with the following parameters:
def __init__(self, db=0, api_key: str = "", model: str = "gemini-pro"):
db: The database connection object.api_key: Your Google AI API key.model: The specific Gemini model to use (e.g., "gemini-pro", "gemini-pro-vision").promptSends a prompt to the specified Gemini model and returns the response.
def prompt(self, role: str = "", prompt: str = "", image_base64: str = "") -> str:
role: The system role for the AI (e.g., "You are a helpful assistant.").prompt: The user's prompt or question.image_base64: A base64-encoded image for multimodal prompts.To use the Google provider, you must first configure your API key in the config.yaml file under the ai_mcp_google section.
ai_mcp_google:
api_key: YOUR_GOOGLE_API_KEY
You can then instantiate and use the ObjAI class with the appropriate model string:
ai_obj = ObjAI(db=0, model="mcp:google:gemini-pro")
response = ai_obj.prompt("You are a helpful assistant.", "Who wrote the play Romeo and Juliet?")
print(response)