eval-ai-library 0.3.11__tar.gz → 0.3.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of eval-ai-library might be problematic. Click here for more details.
- {eval_ai_library-0.3.11/eval_ai_library.egg-info → eval_ai_library-0.3.12}/PKG-INFO +1 -1
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12/eval_ai_library.egg-info}/PKG-INFO +1 -1
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/__init__.py +1 -1
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/llm_client.py +32 -4
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/pyproject.toml +1 -1
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/LICENSE +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/MANIFEST.in +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/README.md +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_ai_library.egg-info/SOURCES.txt +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_ai_library.egg-info/dependency_links.txt +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_ai_library.egg-info/entry_points.txt +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_ai_library.egg-info/requires.txt +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_ai_library.egg-info/top_level.txt +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/agent_metrics/__init__.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/agent_metrics/knowledge_retention_metric/knowledge_retention.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/agent_metrics/role_adherence_metric/role_adherence.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/agent_metrics/task_success_metric/task_success_rate.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/agent_metrics/tools_correctness_metric/tool_correctness.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/cli.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/dashboard_server.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/datagenerator/datagenerator.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/datagenerator/document_loader.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/datagenerator/prompts.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/evaluate.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/evaluation_schema.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/html.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metric_pattern.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/__init__.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/answer_precision_metric/answer_precision.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/answer_relevancy_metric/answer_relevancy.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/bias_metric/bias.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/contextual_precision_metric/contextual_precision.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/contextual_recall_metric/contextual_recall.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/contextual_relevancy_metric/contextual_relevancy.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/custom_metric/custom_eval.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/faithfulness_metric/faithfulness.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/geval/geval.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/restricted_refusal_metric/restricted_refusal.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/toxicity_metric/toxicity.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/price.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/py.typed +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/testcases_schema.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/utils.py +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/setup.cfg +0 -0
- {eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/setup.py +0 -0
|
@@ -7,7 +7,7 @@ A powerful library for evaluating AI models with support for multiple LLM provid
|
|
|
7
7
|
and a wide range of evaluation metrics for RAG systems and AI agents.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
__version__ = "0.3.
|
|
10
|
+
__version__ = "0.3.12"
|
|
11
11
|
__author__ = "Aleksandr Meshkov"
|
|
12
12
|
|
|
13
13
|
# Core evaluation functions
|
|
@@ -47,6 +47,29 @@ class CustomLLMClient(ABC):
|
|
|
47
47
|
"""
|
|
48
48
|
pass
|
|
49
49
|
|
|
50
|
+
async def get_embeddings(
|
|
51
|
+
self,
|
|
52
|
+
texts: list[str],
|
|
53
|
+
model: str = "text-embedding-3-small"
|
|
54
|
+
) -> tuple[list[list[float]], Optional[float]]:
|
|
55
|
+
"""
|
|
56
|
+
Get embeddings for texts (optional implementation).
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
texts: List of texts to embed
|
|
60
|
+
model: Embedding model name
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
Tuple of (embeddings_list, cost_in_usd)
|
|
64
|
+
|
|
65
|
+
Raises:
|
|
66
|
+
NotImplementedError: If custom client doesn't support embeddings
|
|
67
|
+
"""
|
|
68
|
+
raise NotImplementedError(
|
|
69
|
+
f"{self.__class__.__name__} does not support embeddings. "
|
|
70
|
+
"Implement get_embeddings() method or use OpenAI for embeddings."
|
|
71
|
+
)
|
|
72
|
+
|
|
50
73
|
@abstractmethod
|
|
51
74
|
def get_model_name(self) -> str:
|
|
52
75
|
"""Return the model name for logging/tracking purposes."""
|
|
@@ -405,14 +428,14 @@ def _calculate_cost(llm: LLMDescriptor, usage) -> Optional[float]:
|
|
|
405
428
|
|
|
406
429
|
|
|
407
430
|
async def get_embeddings(
|
|
408
|
-
model: str | tuple[str, str] | LLMDescriptor,
|
|
431
|
+
model: str | tuple[str, str] | LLMDescriptor | CustomLLMClient,
|
|
409
432
|
texts: list[str],
|
|
410
433
|
) -> tuple[list[list[float]], Optional[float]]:
|
|
411
434
|
"""
|
|
412
|
-
Get embeddings for a list of texts
|
|
435
|
+
Get embeddings for a list of texts.
|
|
413
436
|
|
|
414
437
|
Args:
|
|
415
|
-
model: Model specification
|
|
438
|
+
model: Model specification or CustomLLMClient instance
|
|
416
439
|
texts: List of texts to embed
|
|
417
440
|
|
|
418
441
|
Returns:
|
|
@@ -420,8 +443,13 @@ async def get_embeddings(
|
|
|
420
443
|
|
|
421
444
|
Raises:
|
|
422
445
|
LLMConfigurationError: If required API keys are missing
|
|
423
|
-
ValueError: If
|
|
446
|
+
ValueError: If provider doesn't support embeddings
|
|
447
|
+
NotImplementedError: If CustomLLMClient doesn't implement get_embeddings
|
|
424
448
|
"""
|
|
449
|
+
# Handle custom LLM clients
|
|
450
|
+
if isinstance(model, CustomLLMClient):
|
|
451
|
+
return await model.get_embeddings(texts)
|
|
452
|
+
|
|
425
453
|
llm = LLMDescriptor.parse(model)
|
|
426
454
|
|
|
427
455
|
if llm.provider != Provider.OPENAI:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_ai_library.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/custom_metric/custom_eval.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_ai_library-0.3.11 → eval_ai_library-0.3.12}/eval_lib/metrics/toxicity_metric/toxicity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|