solace-agent-mesh 1.5.1__py3-none-any.whl → 1.6.0__py3-none-any.whl
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 solace-agent-mesh might be problematic. Click here for more details.
- solace_agent_mesh/agent/adk/callbacks.py +0 -5
- solace_agent_mesh/agent/adk/models/lite_llm.py +123 -8
- solace_agent_mesh/agent/adk/models/oauth2_token_manager.py +245 -0
- solace_agent_mesh/agent/protocol/event_handlers.py +40 -1
- solace_agent_mesh/agent/proxies/__init__.py +0 -0
- solace_agent_mesh/agent/proxies/a2a/__init__.py +3 -0
- solace_agent_mesh/agent/proxies/a2a/app.py +55 -0
- solace_agent_mesh/agent/proxies/a2a/component.py +1115 -0
- solace_agent_mesh/agent/proxies/a2a/config.py +140 -0
- solace_agent_mesh/agent/proxies/a2a/oauth_token_cache.py +104 -0
- solace_agent_mesh/agent/proxies/base/__init__.py +3 -0
- solace_agent_mesh/agent/proxies/base/app.py +99 -0
- solace_agent_mesh/agent/proxies/base/component.py +619 -0
- solace_agent_mesh/agent/proxies/base/config.py +85 -0
- solace_agent_mesh/agent/proxies/base/proxy_task_context.py +17 -0
- solace_agent_mesh/agent/sac/app.py +9 -3
- solace_agent_mesh/agent/sac/component.py +160 -8
- solace_agent_mesh/agent/tools/audio_tools.py +125 -8
- solace_agent_mesh/agent/tools/web_tools.py +10 -5
- solace_agent_mesh/agent/utils/artifact_helpers.py +141 -3
- solace_agent_mesh/assets/docs/404.html +3 -3
- solace_agent_mesh/assets/docs/assets/js/5c2bd65f.eda4bcb2.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/6ad8f0bd.f4b15f3b.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/71da7b71.38583438.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/77cf947d.48cb18a2.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/924ffdeb.8095e148.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/9e9d0a82.570c057b.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{ad71b5ed.60668e9e.js → ad71b5ed.af3ecfd1.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/ceb2a7a6.5d92d7d0.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{da0b5bad.9d369087.js → da0b5bad.d08a9466.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/db924877.e98d12a1.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/de915948.27d6b065.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/e6f9706b.e74a984d.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f284c35a.42f59cdd.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ff4d71f2.15b02f97.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{main.bd3c34f3.js → main.20feee82.js} +2 -2
- solace_agent_mesh/assets/docs/assets/js/runtime~main.0d198646.js +1 -0
- solace_agent_mesh/assets/docs/docs/documentation/components/agents/index.html +15 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/artifact-management/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/audio-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/data-analysis-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/embeds/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/cli/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/orchestrator/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/plugins/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/components/proxies/index.html +262 -0
- solace_agent_mesh/assets/docs/docs/documentation/deploying/debugging/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/deploying/deployment-options/index.html +31 -3
- solace_agent_mesh/assets/docs/docs/documentation/deploying/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/deploying/observability/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/developing/create-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/create-gateways/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/developing/creating-python-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/creating-service-providers/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/evaluations/index.html +135 -0
- solace_agent_mesh/assets/docs/docs/documentation/developing/index.html +6 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/structure/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/bedrock-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/custom-agent/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/event-mesh-gateway/index.html +5 -5
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mcp-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mongodb-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rag-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rest-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/slack-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/sql-database/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/installation/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/rbac-setup-guide/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/enterprise/single-sign-on/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/architecture/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/try-agent-mesh/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/configurations/index.html +6 -5
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/installation/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/large_language_models/index.html +100 -3
- solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/run-project/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-gateway-upgrade-to-0.3.0/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-technical-migration-map/index.html +3 -3
- solace_agent_mesh/assets/docs/lunr-index-1761165361160.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -1
- solace_agent_mesh/assets/docs/search-doc-1761165361160.json +1 -0
- solace_agent_mesh/assets/docs/search-doc.json +1 -1
- solace_agent_mesh/assets/docs/sitemap.xml +1 -1
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +2 -69
- solace_agent_mesh/cli/commands/eval_cmd.py +11 -49
- solace_agent_mesh/cli/commands/init_cmd/__init__.py +0 -5
- solace_agent_mesh/cli/commands/init_cmd/env_step.py +10 -12
- solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +9 -61
- solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +9 -49
- solace_agent_mesh/cli/commands/plugin_cmd/add_cmd.py +1 -2
- solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-DwrxZE0E.js → authCallback-BTf6dqwp.js} +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/{client-DarGQzyw.js → client-CaY59VuC.js} +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-BGTaW0uv.js +342 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-DHJKSW1S.css +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/{vendor-BKIeiHj_.js → vendor-BEmvJSYz.js} +1 -1
- solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
- solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
- solace_agent_mesh/common/a2a/__init__.py +24 -0
- solace_agent_mesh/common/a2a/artifact.py +39 -0
- solace_agent_mesh/common/a2a/events.py +29 -0
- solace_agent_mesh/common/a2a/message.py +68 -0
- solace_agent_mesh/common/a2a/protocol.py +73 -1
- solace_agent_mesh/common/agent_registry.py +83 -3
- solace_agent_mesh/common/constants.py +3 -1
- solace_agent_mesh/common/utils/pydantic_utils.py +12 -0
- solace_agent_mesh/config_portal/backend/common.py +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-ByU1X1HD.js +98 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/{manifest-44d62be6.js → manifest-61038fc6.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/index.html +1 -1
- solace_agent_mesh/evaluation/evaluator.py +128 -104
- solace_agent_mesh/evaluation/message_organizer.py +116 -110
- solace_agent_mesh/evaluation/report_data_processor.py +84 -86
- solace_agent_mesh/evaluation/report_generator.py +73 -79
- solace_agent_mesh/evaluation/run.py +421 -235
- solace_agent_mesh/evaluation/shared/__init__.py +92 -0
- solace_agent_mesh/evaluation/shared/constants.py +47 -0
- solace_agent_mesh/evaluation/shared/exceptions.py +50 -0
- solace_agent_mesh/evaluation/shared/helpers.py +35 -0
- solace_agent_mesh/evaluation/shared/test_case_loader.py +167 -0
- solace_agent_mesh/evaluation/shared/test_suite_loader.py +280 -0
- solace_agent_mesh/evaluation/subscriber.py +111 -232
- solace_agent_mesh/evaluation/summary_builder.py +227 -117
- solace_agent_mesh/gateway/base/app.py +1 -1
- solace_agent_mesh/gateway/base/component.py +8 -1
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251015_add_session_performance_indexes.py +70 -0
- solace_agent_mesh/gateway/http_sse/component.py +98 -2
- solace_agent_mesh/gateway/http_sse/dependencies.py +4 -4
- solace_agent_mesh/gateway/http_sse/main.py +2 -1
- solace_agent_mesh/gateway/http_sse/repository/chat_task_repository.py +12 -13
- solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +15 -18
- solace_agent_mesh/gateway/http_sse/repository/interfaces.py +25 -18
- solace_agent_mesh/gateway/http_sse/repository/session_repository.py +30 -26
- solace_agent_mesh/gateway/http_sse/repository/task_repository.py +35 -44
- solace_agent_mesh/gateway/http_sse/routers/agent_cards.py +4 -3
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +95 -203
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +4 -3
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +2 -2
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +33 -41
- solace_agent_mesh/gateway/http_sse/routers/visualization.py +17 -11
- solace_agent_mesh/gateway/http_sse/services/data_retention_service.py +4 -4
- solace_agent_mesh/gateway/http_sse/services/feedback_service.py +51 -43
- solace_agent_mesh/gateway/http_sse/services/session_service.py +20 -20
- solace_agent_mesh/gateway/http_sse/services/task_logger_service.py +8 -8
- solace_agent_mesh/gateway/http_sse/shared/base_repository.py +45 -71
- solace_agent_mesh/gateway/http_sse/shared/types.py +0 -18
- solace_agent_mesh/templates/gateway_config_template.yaml +0 -5
- solace_agent_mesh/templates/logging_config_template.ini +10 -6
- solace_agent_mesh/templates/plugin_gateway_config_template.yaml +0 -3
- solace_agent_mesh/templates/shared_config.yaml +40 -0
- {solace_agent_mesh-1.5.1.dist-info → solace_agent_mesh-1.6.0.dist-info}/METADATA +47 -21
- {solace_agent_mesh-1.5.1.dist-info → solace_agent_mesh-1.6.0.dist-info}/RECORD +162 -141
- solace_agent_mesh/assets/docs/assets/js/5c2bd65f.e49689dd.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/6ad8f0bd.39d5851d.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/71da7b71.804d6567.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/77cf947d.64c9bd6c.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/9e9d0a82.dd810042.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/db924877.cbc66f02.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/de915948.139b4b9c.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/e6f9706b.582a78ca.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/f284c35a.5766a13d.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/ff4d71f2.9c0297a6.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/runtime~main.18dc45dd.js +0 -1
- solace_agent_mesh/assets/docs/lunr-index-1760121512891.json +0 -1
- solace_agent_mesh/assets/docs/search-doc-1760121512891.json +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-2nd1gbaH.js +0 -339
- solace_agent_mesh/client/webui/frontend/static/assets/main-DoKXctCM.css +0 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-BNuqpWDc.js +0 -98
- solace_agent_mesh/evaluation/config_loader.py +0 -657
- solace_agent_mesh/evaluation/test_case_loader.py +0 -714
- /solace_agent_mesh/assets/docs/assets/js/{main.bd3c34f3.js.LICENSE.txt → main.20feee82.js.LICENSE.txt} +0 -0
- {solace_agent_mesh-1.5.1.dist-info → solace_agent_mesh-1.6.0.dist-info}/WHEEL +0 -0
- {solace_agent_mesh-1.5.1.dist-info → solace_agent_mesh-1.6.0.dist-info}/entry_points.txt +0 -0
- {solace_agent_mesh-1.5.1.dist-info → solace_agent_mesh-1.6.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,657 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Refactored configuration loader with comprehensive validation and error handling.
|
|
3
|
-
This module provides robust configuration loading with validation for every field.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
import json
|
|
7
|
-
import os
|
|
8
|
-
import sys
|
|
9
|
-
from dataclasses import dataclass, field
|
|
10
|
-
from typing import Dict, List, Optional, Any, Union
|
|
11
|
-
from enum import Enum
|
|
12
|
-
import logging
|
|
13
|
-
from pathlib import Path
|
|
14
|
-
|
|
15
|
-
logging.basicConfig(level=logging.INFO)
|
|
16
|
-
logger = logging.getLogger(__name__)
|
|
17
|
-
|
|
18
|
-
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class ValidationLevel(Enum):
|
|
22
|
-
"""Defines the validation level for configuration fields."""
|
|
23
|
-
|
|
24
|
-
REQUIRED = "required"
|
|
25
|
-
OPTIONAL = "optional"
|
|
26
|
-
CONDITIONAL = "conditional"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class ConfigurationError(Exception):
|
|
30
|
-
"""Base exception for configuration-related errors."""
|
|
31
|
-
|
|
32
|
-
pass
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class ConfigurationFileNotFoundError(ConfigurationError):
|
|
36
|
-
"""Raised when the configuration file is not found."""
|
|
37
|
-
|
|
38
|
-
pass
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class ConfigurationParseError(ConfigurationError):
|
|
42
|
-
"""Raised when the configuration file cannot be parsed."""
|
|
43
|
-
|
|
44
|
-
pass
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class ConfigurationValidationError(ConfigurationError):
|
|
48
|
-
"""Raised when configuration validation fails."""
|
|
49
|
-
|
|
50
|
-
pass
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class EnvironmentVariableError(ConfigurationError):
|
|
54
|
-
"""Raised when required environment variables are missing."""
|
|
55
|
-
|
|
56
|
-
pass
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@dataclass
|
|
60
|
-
class ValidationReport:
|
|
61
|
-
"""Detailed validation report with all errors and warnings."""
|
|
62
|
-
|
|
63
|
-
def __init__(self):
|
|
64
|
-
self.errors: List[str] = []
|
|
65
|
-
self.warnings: List[str] = []
|
|
66
|
-
|
|
67
|
-
def add_error(self, field: str, message: str):
|
|
68
|
-
"""Add a validation error."""
|
|
69
|
-
self.errors.append(f"Field '{field}': {message}")
|
|
70
|
-
|
|
71
|
-
def add_warning(self, field: str, message: str):
|
|
72
|
-
"""Add a validation warning."""
|
|
73
|
-
self.warnings.append(f"Field '{field}': {message}")
|
|
74
|
-
|
|
75
|
-
def has_errors(self) -> bool:
|
|
76
|
-
"""Check if there are any validation errors."""
|
|
77
|
-
return len(self.errors) > 0
|
|
78
|
-
|
|
79
|
-
def get_summary(self) -> str:
|
|
80
|
-
"""Get human-readable validation summary."""
|
|
81
|
-
summary = []
|
|
82
|
-
if self.errors:
|
|
83
|
-
summary.append("ERRORS:")
|
|
84
|
-
summary.extend([f" - {error}" for error in self.errors])
|
|
85
|
-
if self.warnings:
|
|
86
|
-
summary.append("WARNINGS:")
|
|
87
|
-
summary.extend([f" - {warning}" for warning in self.warnings])
|
|
88
|
-
return "\n".join(summary) if summary else "Configuration validation passed."
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
@dataclass
|
|
92
|
-
class FieldValidator:
|
|
93
|
-
"""Defines validation rules for a configuration field."""
|
|
94
|
-
|
|
95
|
-
name: str
|
|
96
|
-
validation_level: ValidationLevel
|
|
97
|
-
field_type: type
|
|
98
|
-
default_value: Any = None
|
|
99
|
-
min_length: Optional[int] = None
|
|
100
|
-
max_length: Optional[int] = None
|
|
101
|
-
allowed_values: Optional[List[Any]] = None
|
|
102
|
-
condition_field: Optional[str] = None
|
|
103
|
-
condition_value: Any = None
|
|
104
|
-
custom_validator: Optional[str] = None
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
@dataclass
|
|
108
|
-
class EnvironmentConfig:
|
|
109
|
-
"""Environment variable configuration with validation."""
|
|
110
|
-
|
|
111
|
-
variables: Dict[str, Optional[str]] = field(default_factory=dict)
|
|
112
|
-
|
|
113
|
-
def get(self, key: str, default: Optional[str] = None) -> Optional[str]:
|
|
114
|
-
"""Get environment variable value with default."""
|
|
115
|
-
return self.variables.get(key, default)
|
|
116
|
-
|
|
117
|
-
def is_complete(self, required_vars: List[str]) -> bool:
|
|
118
|
-
"""Check if all required environment variables are present."""
|
|
119
|
-
return all(self.variables.get(var) is not None for var in required_vars)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
@dataclass
|
|
123
|
-
class LLMModelConfig:
|
|
124
|
-
"""Individual LLM model configuration with validation."""
|
|
125
|
-
|
|
126
|
-
name: str
|
|
127
|
-
env: EnvironmentConfig
|
|
128
|
-
|
|
129
|
-
def __post_init__(self):
|
|
130
|
-
"""Validate the model configuration after initialization."""
|
|
131
|
-
if not self.name or not self.name.strip():
|
|
132
|
-
raise ConfigurationValidationError("LLM model name cannot be empty")
|
|
133
|
-
|
|
134
|
-
essential_vars = ["LLM_SERVICE_PLANNING_MODEL_NAME"]
|
|
135
|
-
if not any(var in self.env.variables for var in essential_vars):
|
|
136
|
-
raise ConfigurationValidationError(
|
|
137
|
-
f"LLM model '{self.name}' must have at least one of: {essential_vars}"
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
@dataclass
|
|
142
|
-
class EvaluationSettings:
|
|
143
|
-
"""Evaluation settings with comprehensive validation."""
|
|
144
|
-
|
|
145
|
-
tool_match_enabled: bool = True
|
|
146
|
-
response_match_enabled: bool = True
|
|
147
|
-
llm_evaluator_enabled: bool = False
|
|
148
|
-
llm_evaluator_env: Optional[EnvironmentConfig] = None
|
|
149
|
-
|
|
150
|
-
def __post_init__(self):
|
|
151
|
-
"""Validate evaluation settings after initialization."""
|
|
152
|
-
if self.llm_evaluator_enabled and not self.llm_evaluator_env:
|
|
153
|
-
raise ConfigurationValidationError(
|
|
154
|
-
"llm_evaluator.env is required when llm_evaluator.enabled is true"
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
if self.llm_evaluator_enabled and self.llm_evaluator_env:
|
|
158
|
-
required_vars = [
|
|
159
|
-
"LLM_SERVICE_PLANNING_MODEL_NAME",
|
|
160
|
-
"LLM_SERVICE_ENDPOINT",
|
|
161
|
-
"LLM_SERVICE_API_KEY",
|
|
162
|
-
]
|
|
163
|
-
if not self.llm_evaluator_env.is_complete(required_vars):
|
|
164
|
-
raise ConfigurationValidationError(
|
|
165
|
-
f"LLM evaluator requires environment variables: {required_vars}"
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
@dataclass
|
|
170
|
-
class EvaluationConfig:
|
|
171
|
-
"""Main configuration with full validation and defaults."""
|
|
172
|
-
|
|
173
|
-
agents: List[str]
|
|
174
|
-
llm_models: List[LLMModelConfig]
|
|
175
|
-
test_cases: List[str]
|
|
176
|
-
results_dir_name: str = "tests"
|
|
177
|
-
runs: int = 1
|
|
178
|
-
evaluation_settings: EvaluationSettings = field(default_factory=EvaluationSettings)
|
|
179
|
-
|
|
180
|
-
def __post_init__(self):
|
|
181
|
-
"""Validate the complete configuration after initialization."""
|
|
182
|
-
if not self.agents:
|
|
183
|
-
raise ConfigurationValidationError(
|
|
184
|
-
"At least one agent configuration is required"
|
|
185
|
-
)
|
|
186
|
-
|
|
187
|
-
if not self.llm_models:
|
|
188
|
-
raise ConfigurationValidationError("At least one LLM model is required")
|
|
189
|
-
|
|
190
|
-
if not self.test_cases:
|
|
191
|
-
raise ConfigurationValidationError("At least one test case is required")
|
|
192
|
-
|
|
193
|
-
if self.runs < 1:
|
|
194
|
-
raise ConfigurationValidationError("Number of runs must be at least 1")
|
|
195
|
-
|
|
196
|
-
if not self.results_dir_name or not self.results_dir_name.strip():
|
|
197
|
-
raise ConfigurationValidationError("Results directory name cannot be empty")
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
class EnvironmentVariableResolver:
|
|
201
|
-
"""Enhanced environment variable resolver with comprehensive validation."""
|
|
202
|
-
|
|
203
|
-
REQUIRED_LLM_VARS = [
|
|
204
|
-
"LLM_SERVICE_PLANNING_MODEL_NAME",
|
|
205
|
-
"LLM_SERVICE_ENDPOINT",
|
|
206
|
-
"LLM_SERVICE_API_KEY",
|
|
207
|
-
]
|
|
208
|
-
|
|
209
|
-
OPTIONAL_VARS = ["MAX_TOKENS"]
|
|
210
|
-
|
|
211
|
-
def resolve_environment_config(
|
|
212
|
-
self, env_config: Dict[str, str], context: str
|
|
213
|
-
) -> EnvironmentConfig:
|
|
214
|
-
"""Resolve environment variables with comprehensive validation."""
|
|
215
|
-
resolved = {}
|
|
216
|
-
missing_required = []
|
|
217
|
-
missing_optional = []
|
|
218
|
-
|
|
219
|
-
for key, value in env_config.items():
|
|
220
|
-
if key.endswith("_VAR"):
|
|
221
|
-
env_var_name = key[:-4] # Remove '_VAR' suffix
|
|
222
|
-
env_var_value = os.getenv(value)
|
|
223
|
-
|
|
224
|
-
if not env_var_value:
|
|
225
|
-
if value in self.REQUIRED_LLM_VARS:
|
|
226
|
-
missing_required.append(f"{value} (for {env_var_name})")
|
|
227
|
-
else:
|
|
228
|
-
missing_optional.append(f"{value} (for {env_var_name})")
|
|
229
|
-
logger.warning(
|
|
230
|
-
f"Optional environment variable '{value}' not set for {context}"
|
|
231
|
-
)
|
|
232
|
-
resolved[env_var_name] = None
|
|
233
|
-
else:
|
|
234
|
-
resolved[env_var_name] = env_var_value
|
|
235
|
-
else:
|
|
236
|
-
resolved[key] = value
|
|
237
|
-
|
|
238
|
-
if missing_required:
|
|
239
|
-
raise EnvironmentVariableError(
|
|
240
|
-
f"Required environment variables missing for {context}: {', '.join(missing_required)}"
|
|
241
|
-
)
|
|
242
|
-
|
|
243
|
-
if missing_optional:
|
|
244
|
-
logger.info(
|
|
245
|
-
f"Optional environment variables not set for {context}: {', '.join(missing_optional)}"
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
return EnvironmentConfig(variables=resolved)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
class ConfigurationValidator:
|
|
252
|
-
"""Comprehensive configuration validator with detailed error reporting."""
|
|
253
|
-
|
|
254
|
-
ROOT_LEVEL_RULES = {
|
|
255
|
-
"agents": FieldValidator(
|
|
256
|
-
name="agents",
|
|
257
|
-
validation_level=ValidationLevel.REQUIRED,
|
|
258
|
-
field_type=list,
|
|
259
|
-
min_length=1,
|
|
260
|
-
),
|
|
261
|
-
"llm_models": FieldValidator(
|
|
262
|
-
name="llm_models",
|
|
263
|
-
validation_level=ValidationLevel.REQUIRED,
|
|
264
|
-
field_type=list,
|
|
265
|
-
min_length=1,
|
|
266
|
-
),
|
|
267
|
-
"test_cases": FieldValidator(
|
|
268
|
-
name="test_cases",
|
|
269
|
-
validation_level=ValidationLevel.REQUIRED,
|
|
270
|
-
field_type=list,
|
|
271
|
-
min_length=1,
|
|
272
|
-
),
|
|
273
|
-
"results_dir_name": FieldValidator(
|
|
274
|
-
name="results_dir_name",
|
|
275
|
-
validation_level=ValidationLevel.OPTIONAL,
|
|
276
|
-
field_type=str,
|
|
277
|
-
default_value="tests",
|
|
278
|
-
),
|
|
279
|
-
"runs": FieldValidator(
|
|
280
|
-
name="runs",
|
|
281
|
-
validation_level=ValidationLevel.OPTIONAL,
|
|
282
|
-
field_type=int,
|
|
283
|
-
default_value=1,
|
|
284
|
-
),
|
|
285
|
-
"evaluation_settings": FieldValidator(
|
|
286
|
-
name="evaluation_settings",
|
|
287
|
-
validation_level=ValidationLevel.OPTIONAL,
|
|
288
|
-
field_type=dict,
|
|
289
|
-
default_value={},
|
|
290
|
-
),
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
LLM_MODEL_RULES = {
|
|
294
|
-
"name": FieldValidator(
|
|
295
|
-
name="name",
|
|
296
|
-
validation_level=ValidationLevel.REQUIRED,
|
|
297
|
-
field_type=str,
|
|
298
|
-
min_length=1,
|
|
299
|
-
),
|
|
300
|
-
"env": FieldValidator(
|
|
301
|
-
name="env",
|
|
302
|
-
validation_level=ValidationLevel.REQUIRED,
|
|
303
|
-
field_type=dict,
|
|
304
|
-
min_length=1,
|
|
305
|
-
),
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
def __init__(self, env_resolver: EnvironmentVariableResolver):
|
|
309
|
-
self.env_resolver = env_resolver
|
|
310
|
-
self.report = ValidationReport()
|
|
311
|
-
|
|
312
|
-
def validate_field(
|
|
313
|
-
self,
|
|
314
|
-
field_name: str,
|
|
315
|
-
value: Any,
|
|
316
|
-
rules: Dict[str, FieldValidator],
|
|
317
|
-
config: Dict[str, Any],
|
|
318
|
-
) -> Any:
|
|
319
|
-
"""Validate individual field with comprehensive checks."""
|
|
320
|
-
rule = rules.get(field_name)
|
|
321
|
-
if not rule:
|
|
322
|
-
self.report.add_warning(field_name, "Unknown field in configuration")
|
|
323
|
-
return value
|
|
324
|
-
|
|
325
|
-
if value is None:
|
|
326
|
-
if rule.validation_level == ValidationLevel.REQUIRED:
|
|
327
|
-
self.report.add_error(field_name, "Required field is missing")
|
|
328
|
-
return None
|
|
329
|
-
else:
|
|
330
|
-
return rule.default_value
|
|
331
|
-
|
|
332
|
-
if not isinstance(value, rule.field_type):
|
|
333
|
-
self.report.add_error(
|
|
334
|
-
field_name,
|
|
335
|
-
f"Expected {rule.field_type.__name__}, got {type(value).__name__}",
|
|
336
|
-
)
|
|
337
|
-
return rule.default_value
|
|
338
|
-
|
|
339
|
-
if rule.min_length is not None:
|
|
340
|
-
if hasattr(value, "__len__") and len(value) < rule.min_length:
|
|
341
|
-
self.report.add_error(
|
|
342
|
-
field_name, f"Minimum length is {rule.min_length}, got {len(value)}"
|
|
343
|
-
)
|
|
344
|
-
return rule.default_value
|
|
345
|
-
|
|
346
|
-
if rule.max_length is not None:
|
|
347
|
-
if hasattr(value, "__len__") and len(value) > rule.max_length:
|
|
348
|
-
self.report.add_error(
|
|
349
|
-
field_name, f"Maximum length is {rule.max_length}, got {len(value)}"
|
|
350
|
-
)
|
|
351
|
-
return value[: rule.max_length] # Truncate
|
|
352
|
-
|
|
353
|
-
if rule.allowed_values is not None and value not in rule.allowed_values:
|
|
354
|
-
self.report.add_error(
|
|
355
|
-
field_name, f"Value must be one of {rule.allowed_values}, got {value}"
|
|
356
|
-
)
|
|
357
|
-
return rule.default_value
|
|
358
|
-
|
|
359
|
-
if rule.condition_field and rule.condition_value:
|
|
360
|
-
condition_met = config.get(rule.condition_field) == rule.condition_value
|
|
361
|
-
if (
|
|
362
|
-
rule.validation_level == ValidationLevel.CONDITIONAL
|
|
363
|
-
and not condition_met
|
|
364
|
-
):
|
|
365
|
-
return rule.default_value
|
|
366
|
-
|
|
367
|
-
return value
|
|
368
|
-
|
|
369
|
-
def validate_llm_model(
|
|
370
|
-
self, model_data: Dict[str, Any], index: int
|
|
371
|
-
) -> Optional[LLMModelConfig]:
|
|
372
|
-
"""Validate LLM model configuration."""
|
|
373
|
-
context = f"llm_models[{index}]"
|
|
374
|
-
|
|
375
|
-
name = self.validate_field(
|
|
376
|
-
"name", model_data.get("name"), self.LLM_MODEL_RULES, model_data
|
|
377
|
-
)
|
|
378
|
-
env_data = self.validate_field(
|
|
379
|
-
"env", model_data.get("env"), self.LLM_MODEL_RULES, model_data
|
|
380
|
-
)
|
|
381
|
-
|
|
382
|
-
if not name or not env_data:
|
|
383
|
-
self.report.add_error(context, "Invalid model configuration")
|
|
384
|
-
return None
|
|
385
|
-
|
|
386
|
-
try:
|
|
387
|
-
env_config = self.env_resolver.resolve_environment_config(
|
|
388
|
-
env_data, f"model '{name}'"
|
|
389
|
-
)
|
|
390
|
-
return LLMModelConfig(name=name, env=env_config)
|
|
391
|
-
except (EnvironmentVariableError, ConfigurationValidationError) as e:
|
|
392
|
-
self.report.add_error(context, str(e))
|
|
393
|
-
return None
|
|
394
|
-
|
|
395
|
-
def validate_evaluation_settings(
|
|
396
|
-
self, settings_data: Dict[str, Any]
|
|
397
|
-
) -> EvaluationSettings:
|
|
398
|
-
"""Validate evaluation settings with conditional logic."""
|
|
399
|
-
tool_match = settings_data.get("tool_match", {})
|
|
400
|
-
tool_match_enabled = tool_match.get("enabled", True)
|
|
401
|
-
if not isinstance(tool_match_enabled, bool):
|
|
402
|
-
self.report.add_warning(
|
|
403
|
-
"evaluation_settings.tool_match.enabled",
|
|
404
|
-
"Expected boolean, using default True",
|
|
405
|
-
)
|
|
406
|
-
tool_match_enabled = True
|
|
407
|
-
|
|
408
|
-
response_match = settings_data.get("response_match", {})
|
|
409
|
-
response_match_enabled = response_match.get("enabled", True)
|
|
410
|
-
if not isinstance(response_match_enabled, bool):
|
|
411
|
-
self.report.add_warning(
|
|
412
|
-
"evaluation_settings.response_match.enabled",
|
|
413
|
-
"Expected boolean, using default True",
|
|
414
|
-
)
|
|
415
|
-
response_match_enabled = True
|
|
416
|
-
|
|
417
|
-
llm_evaluator = settings_data.get("llm_evaluator", {})
|
|
418
|
-
llm_evaluator_enabled = llm_evaluator.get("enabled", False)
|
|
419
|
-
if not isinstance(llm_evaluator_enabled, bool):
|
|
420
|
-
self.report.add_warning(
|
|
421
|
-
"evaluation_settings.llm_evaluator.enabled",
|
|
422
|
-
"Expected boolean, using default False",
|
|
423
|
-
)
|
|
424
|
-
llm_evaluator_enabled = False
|
|
425
|
-
|
|
426
|
-
llm_evaluator_env = None
|
|
427
|
-
if llm_evaluator_enabled:
|
|
428
|
-
env_data = llm_evaluator.get("env")
|
|
429
|
-
if not env_data:
|
|
430
|
-
self.report.add_error(
|
|
431
|
-
"evaluation_settings.llm_evaluator.env",
|
|
432
|
-
"Required when llm_evaluator is enabled",
|
|
433
|
-
)
|
|
434
|
-
else:
|
|
435
|
-
try:
|
|
436
|
-
llm_evaluator_env = self.env_resolver.resolve_environment_config(
|
|
437
|
-
env_data, "llm_evaluator"
|
|
438
|
-
)
|
|
439
|
-
except (EnvironmentVariableError, ConfigurationValidationError) as e:
|
|
440
|
-
self.report.add_error(
|
|
441
|
-
"evaluation_settings.llm_evaluator.env", str(e)
|
|
442
|
-
)
|
|
443
|
-
|
|
444
|
-
try:
|
|
445
|
-
return EvaluationSettings(
|
|
446
|
-
tool_match_enabled=tool_match_enabled,
|
|
447
|
-
response_match_enabled=response_match_enabled,
|
|
448
|
-
llm_evaluator_enabled=llm_evaluator_enabled,
|
|
449
|
-
llm_evaluator_env=llm_evaluator_env,
|
|
450
|
-
)
|
|
451
|
-
except ConfigurationValidationError as e:
|
|
452
|
-
self.report.add_error("evaluation_settings", str(e))
|
|
453
|
-
return EvaluationSettings()
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
class ConfigurationLoader:
|
|
457
|
-
"""Loads configuration files with error handling."""
|
|
458
|
-
|
|
459
|
-
def __init__(self, config_path: str):
|
|
460
|
-
self.config_path = config_path
|
|
461
|
-
|
|
462
|
-
def load_file(self) -> Dict[str, Any]:
|
|
463
|
-
"""Load configuration file with comprehensive error handling."""
|
|
464
|
-
try:
|
|
465
|
-
with open(self.config_path, "r") as f:
|
|
466
|
-
return json.load(f)
|
|
467
|
-
except FileNotFoundError:
|
|
468
|
-
raise ConfigurationFileNotFoundError(
|
|
469
|
-
f"Configuration file not found: {self.config_path}"
|
|
470
|
-
)
|
|
471
|
-
except json.JSONDecodeError as e:
|
|
472
|
-
raise ConfigurationParseError(f"Invalid JSON in configuration file: {e}")
|
|
473
|
-
except Exception as e:
|
|
474
|
-
raise ConfigurationError(f"Error reading configuration file: {e}")
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
class ConfigurationProcessor:
|
|
478
|
-
"""Main orchestrator for configuration processing."""
|
|
479
|
-
|
|
480
|
-
def __init__(self, config_path: str):
|
|
481
|
-
self.loader = ConfigurationLoader(config_path)
|
|
482
|
-
self.env_resolver = EnvironmentVariableResolver()
|
|
483
|
-
self.validator = ConfigurationValidator(self.env_resolver)
|
|
484
|
-
|
|
485
|
-
def load_and_process(self) -> Dict[str, Any]:
|
|
486
|
-
"""Load and process configuration, returning the same format as original."""
|
|
487
|
-
try:
|
|
488
|
-
raw_config = self.loader.load_file()
|
|
489
|
-
processed_config = self._process_configuration(raw_config)
|
|
490
|
-
if self.validator.report.has_errors():
|
|
491
|
-
error_summary = self.validator.report.get_summary()
|
|
492
|
-
print(f"Configuration validation failed:\n{error_summary}")
|
|
493
|
-
sys.exit(1)
|
|
494
|
-
|
|
495
|
-
if self.validator.report.warnings:
|
|
496
|
-
for warning in self.validator.report.warnings:
|
|
497
|
-
print(f"Warning: {warning}")
|
|
498
|
-
|
|
499
|
-
return processed_config
|
|
500
|
-
|
|
501
|
-
except ConfigurationFileNotFoundError:
|
|
502
|
-
print(
|
|
503
|
-
f"Error: test_suite_config.json not found at {self.loader.config_path}"
|
|
504
|
-
)
|
|
505
|
-
sys.exit(1)
|
|
506
|
-
except ConfigurationParseError as e:
|
|
507
|
-
print(f"Error: Could not decode JSON from {self.loader.config_path}: {e}")
|
|
508
|
-
sys.exit(1)
|
|
509
|
-
except Exception as e:
|
|
510
|
-
print(f"Error loading configuration: {e}")
|
|
511
|
-
sys.exit(1)
|
|
512
|
-
|
|
513
|
-
def _process_configuration(self, raw_config: Dict[str, Any]) -> Dict[str, Any]:
|
|
514
|
-
"""Process and validate the raw configuration."""
|
|
515
|
-
config_dir = Path(self.loader.config_path).parent.resolve()
|
|
516
|
-
|
|
517
|
-
agents_relative = self.validator.validate_field(
|
|
518
|
-
"agents",
|
|
519
|
-
raw_config.get("agents"),
|
|
520
|
-
self.validator.ROOT_LEVEL_RULES,
|
|
521
|
-
raw_config,
|
|
522
|
-
)
|
|
523
|
-
agents = (
|
|
524
|
-
[
|
|
525
|
-
str(config_dir / p) if not Path(p).is_absolute() else p
|
|
526
|
-
for p in agents_relative
|
|
527
|
-
]
|
|
528
|
-
if agents_relative
|
|
529
|
-
else []
|
|
530
|
-
)
|
|
531
|
-
|
|
532
|
-
test_cases_relative = self.validator.validate_field(
|
|
533
|
-
"test_cases",
|
|
534
|
-
raw_config.get("test_cases"),
|
|
535
|
-
self.validator.ROOT_LEVEL_RULES,
|
|
536
|
-
raw_config,
|
|
537
|
-
)
|
|
538
|
-
test_cases = (
|
|
539
|
-
[
|
|
540
|
-
str(config_dir / p) if not Path(p).is_absolute() else p
|
|
541
|
-
for p in test_cases_relative
|
|
542
|
-
]
|
|
543
|
-
if test_cases_relative
|
|
544
|
-
else []
|
|
545
|
-
)
|
|
546
|
-
results_dir_name = self.validator.validate_field(
|
|
547
|
-
"results_dir_name",
|
|
548
|
-
raw_config.get("results_dir_name"),
|
|
549
|
-
self.validator.ROOT_LEVEL_RULES,
|
|
550
|
-
raw_config,
|
|
551
|
-
)
|
|
552
|
-
runs = self.validator.validate_field(
|
|
553
|
-
"runs", raw_config.get("runs"), self.validator.ROOT_LEVEL_RULES, raw_config
|
|
554
|
-
)
|
|
555
|
-
|
|
556
|
-
llm_models_data = raw_config.get("llm_models", [])
|
|
557
|
-
processed_models = []
|
|
558
|
-
|
|
559
|
-
if not llm_models_data:
|
|
560
|
-
self.validator.report.add_error(
|
|
561
|
-
"llm_models", "At least one LLM model is required"
|
|
562
|
-
)
|
|
563
|
-
else:
|
|
564
|
-
for i, model_data in enumerate(llm_models_data):
|
|
565
|
-
model = self.validator.validate_llm_model(model_data, i)
|
|
566
|
-
if model:
|
|
567
|
-
processed_models.append(
|
|
568
|
-
{"name": model.name, "env": model.env.variables}
|
|
569
|
-
)
|
|
570
|
-
|
|
571
|
-
evaluation_settings_data = raw_config.get("evaluation_settings", {})
|
|
572
|
-
evaluation_settings = self.validator.validate_evaluation_settings(
|
|
573
|
-
evaluation_settings_data
|
|
574
|
-
)
|
|
575
|
-
|
|
576
|
-
processed_eval_settings = {
|
|
577
|
-
"tool_match": {"enabled": evaluation_settings.tool_match_enabled},
|
|
578
|
-
"response_match": {"enabled": evaluation_settings.response_match_enabled},
|
|
579
|
-
"llm_evaluator": {
|
|
580
|
-
"enabled": evaluation_settings.llm_evaluator_enabled,
|
|
581
|
-
"env": (
|
|
582
|
-
evaluation_settings.llm_evaluator_env.variables
|
|
583
|
-
if evaluation_settings.llm_evaluator_env
|
|
584
|
-
else {}
|
|
585
|
-
),
|
|
586
|
-
},
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
if agents and not any(Path(p).name == "eval_backend.yaml" for p in agents):
|
|
590
|
-
project_root = Path.cwd()
|
|
591
|
-
eval_backend_path = str(project_root / "configs" / "eval_backend.yaml")
|
|
592
|
-
agents.append(eval_backend_path)
|
|
593
|
-
|
|
594
|
-
return {
|
|
595
|
-
"agents": agents or [],
|
|
596
|
-
"llm_models": processed_models,
|
|
597
|
-
"test_cases": test_cases or [],
|
|
598
|
-
"results_dir_name": results_dir_name or "tests",
|
|
599
|
-
"runs": runs or 1,
|
|
600
|
-
"evaluation_settings": processed_eval_settings,
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
class ConfigLoader:
|
|
605
|
-
"""
|
|
606
|
-
Main configuration loader class that provides a clean interface for loading
|
|
607
|
-
and validating configuration data.
|
|
608
|
-
"""
|
|
609
|
-
|
|
610
|
-
def __init__(self, config_path: str):
|
|
611
|
-
"""
|
|
612
|
-
Initialize the ConfigLoader with a specific config path.
|
|
613
|
-
|
|
614
|
-
Args:
|
|
615
|
-
config_path: Path to the configuration file
|
|
616
|
-
"""
|
|
617
|
-
self.processor = ConfigurationProcessor(config_path)
|
|
618
|
-
|
|
619
|
-
def load_config(self) -> Dict[str, Any]:
|
|
620
|
-
"""
|
|
621
|
-
Load configuration from config.json with comprehensive validation.
|
|
622
|
-
Returns the validated configuration data.
|
|
623
|
-
"""
|
|
624
|
-
return self.processor.load_and_process()
|
|
625
|
-
|
|
626
|
-
def get_evaluation_settings(self) -> Dict[str, Any]:
|
|
627
|
-
"""
|
|
628
|
-
Load evaluation settings from the config file with validation.
|
|
629
|
-
Returns the evaluation settings configuration.
|
|
630
|
-
"""
|
|
631
|
-
config = self.load_config()
|
|
632
|
-
settings = config.get("evaluation_settings", {})
|
|
633
|
-
|
|
634
|
-
tool_match_enabled = settings.get("tool_match", {}).get("enabled", True)
|
|
635
|
-
response_match_enabled = settings.get("response_match", {}).get("enabled", True)
|
|
636
|
-
|
|
637
|
-
llm_evaluator_config = settings.get("llm_evaluator", {})
|
|
638
|
-
llm_evaluator_enabled = llm_evaluator_config.get("enabled", False)
|
|
639
|
-
|
|
640
|
-
if llm_evaluator_enabled and "env" in llm_evaluator_config:
|
|
641
|
-
env_vars = llm_evaluator_config["env"]
|
|
642
|
-
required_vars = [
|
|
643
|
-
"LLM_SERVICE_PLANNING_MODEL_NAME",
|
|
644
|
-
"LLM_SERVICE_API_KEY",
|
|
645
|
-
"LLM_SERVICE_ENDPOINT",
|
|
646
|
-
]
|
|
647
|
-
if not all(env_vars.get(var) for var in required_vars):
|
|
648
|
-
print(
|
|
649
|
-
"Warning: LLM evaluator is enabled, but one or more required environment variables are not set. Disabling LLM evaluator."
|
|
650
|
-
)
|
|
651
|
-
llm_evaluator_config["enabled"] = False
|
|
652
|
-
|
|
653
|
-
return {
|
|
654
|
-
"tool_match": {"enabled": tool_match_enabled},
|
|
655
|
-
"response_match": {"enabled": response_match_enabled},
|
|
656
|
-
"llm_evaluator": llm_evaluator_config,
|
|
657
|
-
}
|