from typing import Dict, Any, List, Optional from oci.addons.adk import Toolkit, tool import oci from get_config import get_config config = get_config() generative_ai_client = oci.generative_ai.GenerativeAiClient(config) class models(Toolkit): @tool def list_models_response(self, compartment_id: str, name: str) -> Optional[str]: """ Get model id Args: compartment_id: The OCID of the tenancy that contains the models to list. name: The name of the model. Returns: The OCID of the model if found, None otherwise. """ response = generative_ai_client.list_models(compartment_id=compartment_id) for model in response.data.items: if model.display_name == name and set(model.capabilities) == {"CHAT"}: return model.id