Skip to content

Add sample for running a Prompt Agent with WebIQ preview tool - #48935

Open
Howie Leung (howieleung) wants to merge 3 commits into
mainfrom
howie/webiq
Open

Add sample for running a Prompt Agent with WebIQ preview tool#48935
Howie Leung (howieleung) wants to merge 3 commits into
mainfrom
howie/webiq

Conversation

@howieleung

Copy link
Copy Markdown
Member

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new sample is auto-discovered by existing sample tests but introduces new required env vars (and an interactive input() fallback) that are not currently provisioned by the test harness, so CI sample execution is likely to fail/hang.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new azure-ai-projects sample demonstrating how to run a Prompt Agent using the WebIQ preview tool via the synchronous client APIs.

Changes:

  • Introduces a new agent sample sample_agent_web_iq.py under samples/agents/tools/ showing WebIQPreviewTool usage.
  • Uses AIProjectClient(..., allow_preview=True) and get_openai_client(...).responses.create(...) to execute the agent with the WebIQ tool enabled.
File summaries
File Description
sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_iq.py New sample demonstrating Prompt Agent + WebIQ preview tool execution with a sync client
Review details

Suppressed comments (1)

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_iq.py:62

  • Using input() as a fallback can hang automated executions (including sample test runs) when WEB_IQ_USER_INPUT isn't set; prefer a deterministic default prompt instead of interactive input.
    user_input = os.environ.get("WEB_IQ_USER_INPUT") or input("Enter your question:\n")
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
[Pilot] PR Pipeline Failure Analysis

What failed

Azure Pipeline build 6800209 (public, result: failed).

Test failure consistent across every platform/artifact reported (macos311, ubuntu2404_310, ubuntu2404_310_coverage, Ubuntu2404_313, Ubuntu2404_314; both sdist and whl):

sdk.ai.azure-ai-projects.tests.samples.test_samples.TestSamples.test_agent_tools_samples[sample_agent_web_iq]

Relevant pipeline output
azure.core.exceptions.HttpResponseError: {"Message":"Recording file path /mnt/vss/_work/1/s/.assets_distributed/.../tests/recordings/samples/test_samples.pyTestSamplestest_agent_tools_samples[sample_agent_web_iq].json does not exist.","Status":"NotFound"}

...devtools_testutils/proxy_testcase.py:310: in record_wrap
    recording_id, variables = start_record_or_playback(test_id)
...
    if result.status != 200:
>       raise HttpResponseError(message=result.data)
E   azure.core.exceptions.HttpResponseError: ... "Status":"NotFound"

This PR adds a new sample (sample_agent_web_iq.py, demonstrating a Prompt Agent using the WebIQ preview tool) and its corresponding test_agent_tools_samples[sample_agent_web_iq] playback test, but no test-proxy recording JSON file was committed for the new test case. The playback server returns a 404 because it cannot find the expected recording, so the test fails before any assertions run. This is a single root cause reproduced identically across all platforms — it is not an environment/infrastructure flake.

Recommended next steps

  • Record the test locally against a live Azure AI Projects resource (with AZURE_TEST_RUN_LIVE=true / proxy recording mode) to generate tests/recordings/samples/test_samples.pyTestSamplestest_agent_tools_samples[sample_agent_web_iq].json, then commit the recording (and update assets.json / push to the assets repo per Azure SDK test-proxy conventions).
  • Confirm the new sample's required environment variables (e.g. a2a_project_connection_id, a2a_user_input, ai_search_index_name, etc.) are present in the test environment config used for recording.
  • See https://aka.ms/ci-fix

Copilot detected the failing pipeline and generated the analysis above. To have it attempt a fix automatically, reply with @copilot please fix the failing pipeline on this PR.

Generated by Pipeline Analysis Next Steps · auto · 25.4 AIC · ⌖ 1.82 AIC · ⊞ 9.6K ·

Copilot AI review requested due to automatic review settings September 8, 2026 21:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are additive, consistent with existing sample patterns, and appear correctly integrated with the existing sample test env-var mapping.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 8, 2026 21:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The new sample matches existing sample/test patterns in the package, and the supporting env/test/version/changelog updates are consistent and complete.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

2 participants