
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 ObjAiMcpMistral class provides an interface to Mistral AI's 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 = "mistral-large-latest"):
db: The database connection object.api_key: Your Mistral AI API key.model: The specific Mistral AI model to use (e.g., "mistral-large-latest", "mistral-small").promptSends a prompt to the specified Mistral AI 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: Not currently supported by this implementation.To use the Mistral AI provider, you must first configure your API key in the config.yaml file under the ai_mcp_mistral section.
ai_mcp_mistral:
api_key: YOUR_MISTRAL_AI_KEY
You can then instantiate and use the ObjAI class with the appropriate model string:
ai_obj = ObjAI(db=0, model="mcp:mistral:mistral-large-latest")
response = ai_obj.prompt("You are a helpful assistant.", "Who wrote the book 'The Hobbit'?")
print(response)