langchain/callbacks/arize_callback.py/ArizeCallbackHandler/__init__
class ArizeCallbackHandler:    def __init__(
        self,
        model_id: Optional[str] = None,
        model_version: Optional[str] = None,
        SPACE_KEY: Optional[str] = None,
        API_KEY: Optional[str] = None,
    ) -> None:
        """Initialize callback handler."""

        super().__init__()

        # Set the model_id and model_version for the Arize monitoring.
        self.model_id = model_id
        self.model_version = model_version

        # Set the SPACE_KEY and API_KEY for the Arize client.
        self.space_key = SPACE_KEY
        self.api_key = API_KEY

        # Initialize empty lists to store the prompt/response pairs
        # and other necessary data.
        self.prompt_records: List = []
        self.response_records: List = []
        self.prediction_ids: List = []
        self.pred_timestamps: List = []
        self.response_embeddings: List = []
        self.prompt_embeddings: List = []
        self.prompt_tokens = 0
        self.completion_tokens = 0
        self.total_tokens = 0

        from arize.api import Client
        from arize.pandas.embeddings import EmbeddingGenerator, UseCases

        # Create an embedding generator for generating embeddings
        # from prompts and responses.
        self.generator = EmbeddingGenerator.from_use_case(
            use_case=UseCases.NLP.SEQUENCE_CLASSIFICATION,
            model_name="distilbert-base-uncased",
            tokenizer_max_length=512,
            batch_size=256,
        )

        # Create an Arize client and check if the SPACE_KEY and API_KEY
        # are not set to the default values.
        self.arize_client = Client(space_key=SPACE_KEY, api_key=API_KEY)
        if SPACE_KEY == "SPACE_KEY" or API_KEY == "API_KEY":
            raise ValueError("❌ CHANGE SPACE AND API KEYS")
        else:
            print("✅ Arize client setup done! Now you can start using Arize!")