This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Optional | |
from cohere import Client | |
from deepeval.models.base_model import DeepEvalBaseLLM | |
class CohereModel(DeepEvalBaseLLM): | |
def __init__( | |
self, | |
cohere_api_key: str, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
from typing import Optional | |
def get_git_revision_hash() -> str: | |
return subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip() | |
def get_git_revision_short_hash() -> str: | |
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import paho.mqtt.client as mqtt | |
def test_connection(ip, port, _user, _pass, clientid, topic, test_mess="test") -> (bool, str): | |
""" | |
Tests a MQTT connection with a test message | |
@param ip: Hostname | |
@param port: Port |