Skip to content

Commit

Permalink
Provide Default Evaluator Info Dict (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
vowelparrot authored Jun 7, 2023
1 parent 0996dda commit 6bc55cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions python/langchainplus_sdk/evaluation/evaluator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from abc import abstractmethod
from typing import Dict, Optional, Union

from pydantic import BaseModel
from pydantic import BaseModel, Field

from langchainplus_sdk.schemas import SCORE_TYPE, VALUE_TYPE, Example, Run

Expand All @@ -10,11 +10,17 @@ class EvaluationResult(BaseModel):
"""Evaluation result."""

key: str
"""The aspect, metric name, or label for this evaluation."""
score: SCORE_TYPE = None
"""The numeric score for this evaluation."""
value: VALUE_TYPE = None
"""The value for this evaluation, if not numeric."""
comment: Optional[str] = None
"""An explanation regarding the evaluation."""
correction: Optional[Union[Dict, str]] = None
evaluator_info: Optional[Dict] = None
"""What the correct value should be, if applicable."""
evaluator_info: Dict = Field(default_factory=dict)
"""Additional information about the evaluator."""

class Config:
"""Pydantic model configuration."""
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langchainplus-sdk"
version = "0.0.5"
version = "0.0.6"
description = "Client library to connect to the LangChainPlus LLM Tracing and Evaluation Platform."
authors = ["LangChain"]
license = "MIT"
Expand Down

0 comments on commit 6bc55cd

Please sign in to comment.