Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/ai/azure-ai-projects/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ WORK_IQ_PROJECT_CONNECTION_ID=
WORK_IQ_USER_INPUT=
FABRIC_IQ_PROJECT_CONNECTION_ID=
FABRIC_IQ_USER_INPUT=
WEB_IQ_PROJECT_CONNECTION_ID=
WEB_IQ_USER_INPUT=
AI_SEARCH_CONNECTION_NAME=
INDEX_NAME=
INDEX_VERSION=
Expand Down
6 changes: 6 additions & 0 deletions sdk/ai/azure-ai-projects/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 2.7.0 (Unreleased)

### Sample updates

* Added `sample_agent_web_iq.py` under `samples/agents/tools/`, demonstrating a Prompt Agent using the `WebIQPreviewTool`.

## 2.6.0 (2026-09-04)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-projects/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/ai/azure-ai-projects",
"Tag": "python/ai/azure-ai-projects_80e35fe70b"
"Tag": "python/ai/azure-ai-projects_81db4bd08f"
}
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-projects/azure/ai/projects/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "2.6.0"
VERSION = "2.7.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# pylint: disable=line-too-long,useless-suppression
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------

"""
DESCRIPTION:
This sample demonstrates how to run a Prompt Agent that uses the
WebIQ preview tool with a synchronous client.

USAGE:
python sample_agent_web_iq.py

Before running the sample:

pip install "azure-ai-projects>=2.6.0" python-dotenv

Set these environment variables with your own values:
1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview
page of your Microsoft Foundry portal.
2) FOUNDRY_MODEL_NAME - The deployment name of the AI model, as found under the "Name" column in
the "Models + endpoints" tab in your Microsoft Foundry project.
3) FOUNDRY_AGENT_NAME - Optional. The name of the AI agent. If not set, defaults to "MyAgent".
4) WEB_IQ_PROJECT_CONNECTION_ID - The fully-qualified resource ID of the WebIQ project connection.
5) WEB_IQ_USER_INPUT - Optional. The natural-language question to send to the agent.
"""

import os

from dotenv import load_dotenv
from util import create_version_with_endpoint

from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import PromptAgentDefinition, WebIQPreviewTool
from azure.identity import DefaultAzureCredential

load_dotenv()

endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"]
agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent"

web_iq_tool = WebIQPreviewTool(
project_connection_id=os.environ["WEB_IQ_PROJECT_CONNECTION_ID"],
require_approval="never",
)
Comment thread
howieleung marked this conversation as resolved.

with (
DefaultAzureCredential() as credential,
AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client,
create_version_with_endpoint(
project_client=project_client,
agent_name=agent_name,
definition=PromptAgentDefinition(
model=os.environ["FOUNDRY_MODEL_NAME"],
instructions="Use the available WebIQ tool to answer the user's question.",
tools=[web_iq_tool],
),
),
project_client.get_openai_client(agent_name=agent_name) as openai_client,
):
user_input = os.environ.get("WEB_IQ_USER_INPUT") or input("Enter your question:\n")

response = openai_client.responses.create(input=user_input)

print(f"Agent response: {response.output_text}")
2 changes: 2 additions & 0 deletions sdk/ai/azure-ai-projects/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
sharepoint_project_connection_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sanitized-resource-group/providers/Microsoft.CognitiveServices/accounts/sanitized-account/projects/sanitized-project/connections/sanitized-sharepoint-connection",
fabric_iq_project_connection_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sanitized-resource-group/providers/Microsoft.CognitiveServices/accounts/sanitized-account/projects/sanitized-project/connections/sanitized-fabric-iq-connection",
work_iq_project_connection_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sanitized-resource-group/providers/Microsoft.CognitiveServices/accounts/sanitized-account/projects/sanitized-project/connections/sanitized-work-iq-connection",
web_iq_project_connection_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sanitized-resource-group/providers/Microsoft.CognitiveServices/accounts/sanitized-account/projects/sanitized-project/connections/sanitized-web-iq-connection",
bing_custom_search_instance_name="sanitized-bing-custom-search-instance",
completed_oai_model_sft_fine_tuning_job_id="sanitized-ftjob-id",
completed_oai_model_rft_fine_tuning_job_id="sanitized-ftjob-id",
Expand All @@ -73,6 +74,7 @@
bing_custom_user_input="Tell me more about foundry agent service",
fabric_iq_user_input="Tell me weather history in London, Ohio",
work_iq_user_input="What is the Work IQ?",
web_iq_user_input="What is Microsoft Foundry?",
memory_store_chat_model_deployment_name="sanitized-model-deployment-name",
memory_store_embedding_model_deployment_name="text-embedding-ada-002",
foundry_agent_container_image="sanitizedregistry.azurecr.io/sanitized/sessions-agent:latest",
Expand Down