Message
class represents a single message in a conversation.
role
(str
): The role of the message sender. Typically one of:
"user"
: Message from the user"assistant"
: Message from the assistant"system"
: System message providing context/instructionscontent
(str
): The text content of the message.
name
(Optional[str]
): Optional name of the sender (for named system messages).
tool_call_id
(Optional[str]
): Optional ID for a tool call (used in tool calling).
tool_calls
(Optional[List[Dict[str, Any]]]
): Optional list of tool calls in the message.
function_call
(Optional[Dict[str, Any]]
): Optional function call information (legacy format).
Message
class is compatible with OpenAI’s ChatCompletionMessageParam
interface, allowing for easy integration with OpenAI-compatible APIs.
EvaluateResult
class represents the complete result of an evaluator with multiple metrics.
score
(float
): The overall evaluation score, typically between 0.0 and 1.0.
reason
(Optional[str]
): Optional explanation for the overall score.
metrics
(Dict[str, MetricResult]
): Dictionary of component metrics.
error
(Optional[str]
): Optional error message if the evaluation encountered a problem.
MetricResult
class represents a single metric in an evaluation.
score
(float
): The score for this specific metric, typically between 0.0 and 1.0.
reason
(str
): Explanation for why this score was assigned.
success
(bool
): Indicates whether the metric condition was met (e.g., pass/fail).