Skip to content

Commit 8d2eb5e

Browse files
authored
Groundedness Evaluator to not add tool result to tool call message (#43290)
* Groundededness Evalautor to not add tool result to tool call message * Fixing reformatting issues
1 parent 3ccc15e commit 8d2eb5e

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import inspect
66
from abc import ABC, abstractmethod
77
import json
8+
import copy
89
from typing import (
910
Any,
1011
Callable,
@@ -500,7 +501,7 @@ def _parse_tools_from_response(self, response):
500501
if message.get("role") == "assistant" and isinstance(message.get("content"), list):
501502
for content_item in message.get("content"):
502503
if isinstance(content_item, dict) and content_item.get("type") == "tool_call":
503-
tool_calls.append(content_item)
504+
tool_calls.append(copy.deepcopy(content_item))
504505

505506
# Extract tool results from tool messages
506507
elif message.get("role") == "tool" and message.get("tool_call_id"):

0 commit comments

Comments
 (0)