Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/lightspeed_evaluation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
__version__ = "0.1.0"

# Core components
from .core.api import APIClient
from .core.llm import LLMManager
from .core.models import (
from lightspeed_evaluation.core.api import APIClient
from lightspeed_evaluation.core.llm import LLMManager
from lightspeed_evaluation.core.models import (
APIConfig,
EvaluationData,
EvaluationResult,
Expand All @@ -23,20 +23,20 @@
)

# Output handling
from .core.output import GraphGenerator, OutputHandler
from .core.script import ScriptExecutionManager
from lightspeed_evaluation.core.output import GraphGenerator, OutputHandler
from lightspeed_evaluation.core.script import ScriptExecutionManager

# System config
from .core.system import ConfigLoader, DataValidator, SystemConfig
from .core.system.exceptions import (
from lightspeed_evaluation.core.system import ConfigLoader, DataValidator, SystemConfig
from lightspeed_evaluation.core.system.exceptions import (
APIError,
DataValidationError,
EvaluationError,
ScriptExecutionError,
)

# Main pipeline
from .pipeline.evaluation import EvaluationPipeline
from lightspeed_evaluation.pipeline.evaluation import EvaluationPipeline

__all__ = [
"EvaluationPipeline",
Expand Down
11 changes: 8 additions & 3 deletions src/lightspeed_evaluation/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
"""Core functionality - Components for evaluation."""

from .llm import LLMManager
from .models import EvaluationData, EvaluationResult, LLMConfig, TurnData
from .system import ConfigLoader, DataValidator, SystemConfig
from lightspeed_evaluation.core.llm import LLMManager
from lightspeed_evaluation.core.models import (
EvaluationData,
EvaluationResult,
LLMConfig,
TurnData,
)
from lightspeed_evaluation.core.system import ConfigLoader, DataValidator, SystemConfig

__all__ = [
# Configuration & data
Expand Down
2 changes: 1 addition & 1 deletion src/lightspeed_evaluation/core/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""API client module for actual data generation."""

from .client import APIClient
from lightspeed_evaluation.core.api.client import APIClient

__all__ = ["APIClient"]
8 changes: 4 additions & 4 deletions src/lightspeed_evaluation/core/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

import httpx

from ..constants import (
from lightspeed_evaluation.core.api.streaming_parser import parse_streaming_response
from lightspeed_evaluation.core.constants import (
DEFAULT_API_TIMEOUT,
DEFAULT_ENDPOINT_TYPE,
SUPPORTED_ENDPOINT_TYPES,
)
from ..models import APIRequest, APIResponse
from ..system.exceptions import APIError
from .streaming_parser import parse_streaming_response
from lightspeed_evaluation.core.models import APIRequest, APIResponse
from lightspeed_evaluation.core.system.exceptions import APIError

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions src/lightspeed_evaluation/core/embedding/manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Embedding Manager - Generic embedding configuration, validation, and parameter provider."""

from ..models import EmbeddingConfig, SystemConfig
from ..system.env_validator import validate_provider_env
from lightspeed_evaluation.core.models import EmbeddingConfig, SystemConfig
from lightspeed_evaluation.core.system.env_validator import validate_provider_env


class EmbeddingError(Exception):
Expand Down
2 changes: 1 addition & 1 deletion src/lightspeed_evaluation/core/embedding/ragas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from langchain_openai import OpenAIEmbeddings
from ragas.embeddings import LangchainEmbeddingsWrapper

from ..embedding.manager import EmbeddingManager
from lightspeed_evaluation.core.embedding.manager import EmbeddingManager


class RagasEmbeddingManager: # pylint: disable=too-few-public-methods
Expand Down
12 changes: 6 additions & 6 deletions src/lightspeed_evaluation/core/llm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""LLM management for Evaluation Framework."""

from ..models import LLMConfig
from ..system.env_validator import validate_provider_env
from ..system.exceptions import LLMError
from .deepeval import DeepEvalLLMManager
from .manager import LLMManager
from .ragas import RagasLLMManager
from lightspeed_evaluation.core.llm.deepeval import DeepEvalLLMManager
from lightspeed_evaluation.core.llm.manager import LLMManager
from lightspeed_evaluation.core.llm.ragas import RagasLLMManager
from lightspeed_evaluation.core.models import LLMConfig
from lightspeed_evaluation.core.system.env_validator import validate_provider_env
from lightspeed_evaluation.core.system.exceptions import LLMError

__all__ = [
"LLMConfig",
Expand Down
4 changes: 2 additions & 2 deletions src/lightspeed_evaluation/core/llm/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
from typing import Any

from ..models import LLMConfig, SystemConfig
from ..system.env_validator import validate_provider_env
from lightspeed_evaluation.core.models import LLMConfig, SystemConfig
from lightspeed_evaluation.core.system.env_validator import validate_provider_env


class LLMManager:
Expand Down
6 changes: 3 additions & 3 deletions src/lightspeed_evaluation/core/metrics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Metrics module for evaluation framework."""

from .custom import CustomMetrics
from .deepeval import DeepEvalMetrics
from .ragas import RagasMetrics
from lightspeed_evaluation.core.metrics.custom import CustomMetrics
from lightspeed_evaluation.core.metrics.deepeval import DeepEvalMetrics
from lightspeed_evaluation.core.metrics.ragas import RagasMetrics

__all__ = ["RagasMetrics", "DeepEvalMetrics", "CustomMetrics"]
6 changes: 3 additions & 3 deletions src/lightspeed_evaluation/core/metrics/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import litellm
from pydantic import BaseModel, Field

from ..llm.manager import LLMManager
from ..models import EvaluationScope, TurnData
from .tool_eval import evaluate_tool_calls
from lightspeed_evaluation.core.llm.manager import LLMManager
from lightspeed_evaluation.core.metrics.tool_eval import evaluate_tool_calls
from lightspeed_evaluation.core.models import EvaluationScope, TurnData


class EvaluationPromptParams(BaseModel):
Expand Down
6 changes: 3 additions & 3 deletions src/lightspeed_evaluation/core/metrics/deepeval.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from deepeval.test_case import ConversationalTestCase
from deepeval.test_case import Turn as DeepEvalTurn

from ..llm.deepeval import DeepEvalLLMManager
from ..llm.manager import LLMManager
from ..models import EvaluationScope, TurnData
from lightspeed_evaluation.core.llm.deepeval import DeepEvalLLMManager
from lightspeed_evaluation.core.llm.manager import LLMManager
from lightspeed_evaluation.core.models import EvaluationScope, TurnData


class DeepEvalMetrics: # pylint: disable=too-few-public-methods
Expand Down
4 changes: 2 additions & 2 deletions src/lightspeed_evaluation/core/metrics/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from enum import Enum
from typing import Any, Optional

from ..models.data import EvaluationData, TurnData
from ..models.system import SystemConfig
from lightspeed_evaluation.core.models.data import EvaluationData, TurnData
from lightspeed_evaluation.core.models.system import SystemConfig


class MetricLevel(Enum):
Expand Down
10 changes: 5 additions & 5 deletions src/lightspeed_evaluation/core/metrics/ragas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
ResponseRelevancy,
)

from ..embedding.manager import EmbeddingManager
from ..embedding.ragas import RagasEmbeddingManager
from ..llm.manager import LLMManager
from ..llm.ragas import RagasLLMManager
from ..models import EvaluationScope, TurnData
from lightspeed_evaluation.core.embedding.manager import EmbeddingManager
from lightspeed_evaluation.core.embedding.ragas import RagasEmbeddingManager
from lightspeed_evaluation.core.llm.manager import LLMManager
from lightspeed_evaluation.core.llm.ragas import RagasLLMManager
from lightspeed_evaluation.core.models import EvaluationScope, TurnData


# Decide if Dataset will be used or not ?
Expand Down
7 changes: 5 additions & 2 deletions src/lightspeed_evaluation/core/metrics/script_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
from pathlib import Path
from typing import Any, Optional, Union

from ..models import EvaluationScope
from ..script import ScriptExecutionError, ScriptExecutionManager
from lightspeed_evaluation.core.models import EvaluationScope
from lightspeed_evaluation.core.script import (
ScriptExecutionError,
ScriptExecutionManager,
)

logger = logging.getLogger(__name__)

Expand Down
10 changes: 7 additions & 3 deletions src/lightspeed_evaluation/core/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
"""Data models for the evaluation framework."""

from .api import APIRequest, APIResponse, AttachmentData
from .data import (
from lightspeed_evaluation.core.models.api import (
APIRequest,
APIResponse,
AttachmentData,
)
from lightspeed_evaluation.core.models.data import (
EvaluationData,
EvaluationRequest,
EvaluationResult,
EvaluationScope,
TurnData,
)
from .system import (
from lightspeed_evaluation.core.models.system import (
APIConfig,
EmbeddingConfig,
LLMConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/lightspeed_evaluation/core/models/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import BaseModel, ConfigDict, Field, field_validator

from ..constants import SUPPORTED_RESULT_STATUSES
from lightspeed_evaluation.core.constants import SUPPORTED_RESULT_STATUSES

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/lightspeed_evaluation/core/models/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pydantic import BaseModel, ConfigDict, Field, field_validator

from ..constants import (
from lightspeed_evaluation.core.constants import (
DEFAULT_API_BASE,
DEFAULT_API_TIMEOUT,
DEFAULT_BASE_FILENAME,
Expand Down
6 changes: 3 additions & 3 deletions src/lightspeed_evaluation/core/output/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Output handling - Reports and visualization."""

from .data_persistence import save_evaluation_data
from .generator import OutputHandler
from .visualization import GraphGenerator
from lightspeed_evaluation.core.output.data_persistence import save_evaluation_data
from lightspeed_evaluation.core.output.generator import OutputHandler
from lightspeed_evaluation.core.output.visualization import GraphGenerator

__all__ = ["OutputHandler", "GraphGenerator", "save_evaluation_data"]
4 changes: 2 additions & 2 deletions src/lightspeed_evaluation/core/output/data_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import yaml

from ..constants import DEFAULT_OUTPUT_DIR
from ..models import EvaluationData
from lightspeed_evaluation.core.constants import DEFAULT_OUTPUT_DIR
from lightspeed_evaluation.core.models import EvaluationData


# Use caching
Expand Down
11 changes: 7 additions & 4 deletions src/lightspeed_evaluation/core/output/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
from pathlib import Path
from typing import Any, Optional

from ..constants import (
from lightspeed_evaluation.core.constants import (
DEFAULT_OUTPUT_DIR,
SUPPORTED_CSV_COLUMNS,
SUPPORTED_GRAPH_TYPES,
SUPPORTED_OUTPUT_TYPES,
)
from ..models import EvaluationResult
from .statistics import calculate_basic_stats, calculate_detailed_stats
from .visualization import GraphGenerator
from lightspeed_evaluation.core.models import EvaluationResult
from lightspeed_evaluation.core.output.statistics import (
calculate_basic_stats,
calculate_detailed_stats,
)
from lightspeed_evaluation.core.output.visualization import GraphGenerator


class OutputHandler:
Expand Down
2 changes: 1 addition & 1 deletion src/lightspeed_evaluation/core/output/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import statistics
from typing import Any

from ..models import EvaluationResult
from lightspeed_evaluation.core.models import EvaluationResult


def calculate_basic_stats(results: list[EvaluationResult]) -> dict[str, Any]:
Expand Down
12 changes: 9 additions & 3 deletions src/lightspeed_evaluation/core/output/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
import seaborn as sns
from matplotlib.colors import BASE_COLORS

from ..constants import DEFAULT_OUTPUT_DIR, SUPPORTED_GRAPH_TYPES
from ..models import EvaluationResult
from .statistics import calculate_basic_stats, calculate_detailed_stats
from lightspeed_evaluation.core.constants import (
DEFAULT_OUTPUT_DIR,
SUPPORTED_GRAPH_TYPES,
)
from lightspeed_evaluation.core.models import EvaluationResult
from lightspeed_evaluation.core.output.statistics import (
calculate_basic_stats,
calculate_detailed_stats,
)

CHART_COLORS = {
"PASS": "#28a745", # Green
Expand Down
4 changes: 2 additions & 2 deletions src/lightspeed_evaluation/core/script/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Script execution module for evaluation framework."""

from ..system.exceptions import ScriptExecutionError
from .manager import ScriptExecutionManager
from lightspeed_evaluation.core.script.manager import ScriptExecutionManager
from lightspeed_evaluation.core.system.exceptions import ScriptExecutionError

__all__ = [
"ScriptExecutionManager",
Expand Down
2 changes: 1 addition & 1 deletion src/lightspeed_evaluation/core/script/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pathlib import Path
from typing import Union

from ..system.exceptions import ScriptExecutionError
from lightspeed_evaluation.core.system.exceptions import ScriptExecutionError

logger = logging.getLogger(__name__)

Expand Down
15 changes: 9 additions & 6 deletions src/lightspeed_evaluation/core/system/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""System configuration, validation, and utilities."""

# Constants & Config
from ..constants import (
from lightspeed_evaluation.core.constants import (
DEFAULT_API_BASE,
DEFAULT_API_TIMEOUT,
DEFAULT_BASE_FILENAME,
Expand All @@ -21,18 +21,21 @@
SUPPORTED_ENDPOINT_TYPES,
SUPPORTED_RESULT_STATUSES,
)
from ..models import SystemConfig
from .exceptions import (
from lightspeed_evaluation.core.models import SystemConfig
from lightspeed_evaluation.core.system.exceptions import (
APIError,
ConfigurationError,
DataValidationError,
EvaluationError,
LLMError,
MetricError,
)
from .loader import ConfigLoader
from .setup import setup_environment_variables, setup_logging
from .validator import DataValidator
from lightspeed_evaluation.core.system.loader import ConfigLoader
from lightspeed_evaluation.core.system.setup import (
setup_environment_variables,
setup_logging,
)
from lightspeed_evaluation.core.system.validator import DataValidator

__all__ = [
# Configuration
Expand Down
2 changes: 1 addition & 1 deletion src/lightspeed_evaluation/core/system/env_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

from .exceptions import LLMError
from lightspeed_evaluation.core.system.exceptions import LLMError


def validate_hosted_vllm_env() -> None:
Expand Down
Loading