-
[OPIK-2228] [P SDK] LLM-a-a-J metrics improvements batch (#3157)
发布于
2025-09-05 12:17:11 +00:00 -
[OPIK-2228] Updated
LiteLLMChatModelinstantiation to replacenameandbase_urlwithmodel_namein custom metrics documentation. -
[OPIK-2228] Enhanced documentation for custom metrics usage in evaluation.
- Improved
BaseMetricinheritance structure in examples (e.g.,super().__init__()usage). - Updated
scoremethod signatures to include return typeScoreResultorList[ScoreResult]. - Added an example for implementing a custom metric with usage in
evaluatefunction. - Refactored code examples for better clarity and adherence to best practices.
- [OPIK-2228] Improved G-Eval documentation and fixed minor grammar issue in metric docstring.
- Updated G-Eval documentation to clarify score normalization and evaluation process.
- Fixed a minor grammar issue in
metric.pydocstring for parent span/trace explanation.
- [OPIK-2228] Added a temperature parameter to G-Eval metrics for model initialization.
- Introduced a
temperatureparameter with default value0.0to G-Eval metric initialization. - Updated
_init_modelmethod to accept and apply temperature for model configuration. - Improved docstrings to reflect the new parameter.
- [OPIK-2228] Added
temperatureparameter to evaluation metrics.
- Introduced a
temperatureparameter (default1e-8) for model initialization across Conversational Coherence, User Frustration, and Session Completeness metrics. - Updated
_init_modelmethod to support temperature configuration. - Enhanced docstrings to include the new parameter.
- [OPIK-2228] Updated
model_nametomodelfor OpenAI Chat model initialization and adjusted test cases.
- Replaced
model_nameparameter withmodelinChatOpenAIinstantiation across test and parser files. - Updated test input outputs to align with the parameter change.
- Fixed
logprobsdictionary access inparser.pyfor accurate result parsing.
- [OPIK-2228] Refactored score parsing logic in G-Eval parser.
- Introduced
_extract_score_from_text_contentfunction for cleaner text-based score extraction. - Enhanced
log_probshandling with fallback logic for non-dictchoices. - Improved robustness of score token extraction and response type checks.
下载附件
-