notdiamond.metrics

notdiamond.metrics.metric

class notdiamond.metrics.metric.Metric(metric: str | None = 'accuracy')[source]

Bases: object

Parameters:

metric (str | None)

feedback(session_id: str, llm_config: LLMConfig, value: int, notdiamond_api_key: str | None = None, _user_agent: str | None = None)[source]
Parameters:
  • session_id (str)

  • llm_config (LLMConfig)

  • value (int)

  • notdiamond_api_key (str | None)

  • _user_agent (str | None)

request_payload(value: int)[source]
Parameters:

value (int)

notdiamond.metrics.request

notdiamond.metrics.request.feedback_request(session_id: str, llm_config: LLMConfig, feedback_payload: Dict[str, int], notdiamond_api_key: str, nd_api_url: str = 'https://not-diamond-server.onrender.com', _user_agent: str = 'Python-SDK/0.3.12') bool[source]
Parameters:
  • session_id (str)

  • llm_config (LLMConfig)

  • feedback_payload (Dict[str, int])

  • notdiamond_api_key (str)

  • nd_api_url (str)

  • _user_agent (str)

Return type:

bool