@@ -67,6 +67,7 @@ def evaluate(
6767 topic_scoping_multi_turn_mode : bool = False ,
6868 topic_scoping_target : PolicyTarget = PolicyTarget .BOTH ,
6969 allowed_topics : Optional [List [str ]] = None ,
70+ metadata : Optional [Dict [str , str ]] = None ,
7071 ) -> Union [EvaluationResponse , None ]:
7172 """
7273 Evaluates the given input and output pairs.
@@ -113,6 +114,7 @@ def evaluate(
113114 :param topic_scoping_multi_turn_mode: Enable multi-turn mode for topic scoping check.
114115 :param topic_scoping_target: Target topic for topic scoping check.
115116 :param allowed_topics: List of allowed topics for topic scoping check.
117+ :param metadata: Optional dictionary of string key-value pairs to attach to the evaluation invocation.
116118
117119 :return: An EvaluationResponse object containing the evaluation results.
118120 :raises Exception: If an error occurs during the evaluation.
@@ -236,6 +238,7 @@ def evaluate(
236238 topic_scoping_multi_turn_mode = topic_scoping_multi_turn_mode ,
237239 topic_scoping_target = topic_scoping_target ,
238240 allowed_topics = allowed_topics ,
241+ metadata = metadata ,
239242 )
240243
241244 response = requests .post (
@@ -264,6 +267,7 @@ def invoke_evaluation(
264267 Optional [List [Dict [str , Any ]]],
265268 ] = None ,
266269 available_tools : Optional [List [LLMToolDefinition ]] = None ,
270+ metadata : Optional [Dict [str , str ]] = None ,
267271 ) -> EvaluationResponse :
268272 url = f"{ self ._base_url } /api/evaluation/invoke/"
269273
@@ -279,6 +283,7 @@ def invoke_evaluation(
279283 output = output ,
280284 messages = messages , # type: ignore
281285 available_tools = available_tools ,
286+ metadata = metadata ,
282287 )
283288
284289 response = requests .request (
0 commit comments