azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

azure.ai.evaluation SDK cannot handle `conversation` input from a csv file.

Open Wix97 opened this issue 5 months ago • 3 comments

  • Package Name: azure.ai.evaluation
  • Package Version: 1.8.0
  • Operating System: Windows 11
  • Python Version: 3.12.9

Describe the bug In a csv file,

To Reproduce Steps to reproduce the behavior:

pip install azure.ai.evaluation==1.8.0 Setup file data.csv:

conversation
"{""messages"": [{""role"": ""user"", ""content"": ""Hello""}, {""role"": ""assistant"", ""content"": ""Hello""}]}"

Setup file main.py

from pathlib import Path
from azure.ai.evaluation import (
    evaluate,
    CoherenceEvaluator,
    AzureOpenAIModelConfiguration,
)

dataset_path = Path("data.csv").resolve()

model_config = AzureOpenAIModelConfiguration(
    azure_deployment="xxx",
    azure_endpoint="xxx",
)


ret = evaluate(
    data=dataset_path,
    evaluators={"coherence": CoherenceEvaluator(model_config=model_config)},
    evaluator_config={"default": {"conversation": "${data.conversation}"}},
)

Expected behavior It should output coherence score

Additional context In line 346 of the code https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_common/_base_eval.py

Looks like the input conversation is a string, instead of a Dict, the previous check not in doesn't take effect, because the stringified conversation json does contain the substring 'message'.

Wix97 avatar Jun 18 '25 08:06 Wix97

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @luigiw @needuv @singankit.

github-actions[bot] avatar Jun 18 '25 08:06 github-actions[bot]

This is the expected behavior so far. csv files as input only support query/responese format.

luigiw avatar Jun 19 '25 21:06 luigiw

This is really strange behavior. I only discovered this after looking at the code indicated by the exception message, maybe it would be better to add some notification in the function signature or documentation.

Do you have plan to further support conversation input in csv file in the future?

ghost avatar Jun 20 '25 10:06 ghost