Skip to content

Conversation

@w-javed
Copy link
Contributor

@w-javed w-javed commented Dec 16, 2025

related to
#44431

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes sample code issues reported in GitHub Issue 44431 by standardizing environment variable naming and correcting data mapping for agent evaluations.

Key Changes:

  • Updated environment variable from AGENT_NAME to AZURE_AI_AGENT_NAME for consistency with Azure SDK naming conventions
  • Fixed data mapping in agent evaluation from {{item.response}} to {{sample.output_text}} to correctly reference dynamically generated agent responses
  • Commented out cleanup code (evaluation and agent deletion) in the evaluation sample

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py Fixed data mapping to use sample.output_text for agent responses; commented out cleanup code
sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py Updated environment variable reference to AZURE_AI_AGENT_NAME
sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py Updated environment variable reference to AZURE_AI_AGENT_NAME
sdk/ai/azure-ai-projects/.env.template Updated environment variable template to AZURE_AI_AGENT_NAME
Comments suppressed due to low confidence (2)

sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py:130

  • The agent deletion code is commented out, but the print statement still says "Agent deleted". This will mislead users into thinking the agent was actually deleted when it wasn't. Either uncomment the deletion code or update the print statement to reflect that the deletion was skipped (e.g., "# print('Agent deleted')" or "print('Skipping agent deletion')").
    project_client.agents.delete(agent_name=agent.name)
    print("Agent deleted")

sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py:127

  • The deletion code is commented out, but the print statement still says "Evaluation deleted". This will mislead users into thinking the evaluation was actually deleted when it wasn't. Either uncomment the deletion code or update the print statement to reflect that the deletion was skipped (e.g., "# print('Evaluation deleted')" or "print('Skipping evaluation deletion')").
    openai_client.evals.delete(eval_id=eval_object.id)
    print("Evaluation deleted")

@dargilco
Copy link
Member

To fix the pipeline error, run this two times, and commit the updated README.md file:

python ......\eng\tools\azure-sdk-tools\ci_tools\snippet_update\python_snippet_updater.py .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants