
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 ObjAiMcpAnthropic class provides an interface to Anthropic's language models, such as the Claude family. 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 = "claude-opus-4-6"):
db: The database connection object.api_key: Your Anthropic API key.model: The specific Claude model to use (e.g., "claude-opus-4-6", "claude-3-sonnet-20240229").promptSends a prompt to the specified Claude 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 Anthropic provider, you must first configure your API key in the config.yaml file under the ai_mcp_anthropic section.
ai_mcp_anthropic:
api_key: YOUR_ANTHROPIC_API_KEY
You can then instantiate and use the ObjAI class with the appropriate model string:
ai_obj = ObjAI(db=0, model="mcp:anthropic:claude-opus-4-6")
response = ai_obj.prompt("You are a helpful assistant.", "What is the largest planet in our solar system?")
print(response)