Skip to content

Commit 7325d03

Browse files
committed
code review feedback
1 parent 728e798 commit 7325d03

File tree

10 files changed

+24
-331
lines changed

10 files changed

+24
-331
lines changed

sdk/ai/azure-ai-projects/.env.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ AZURE_AI_PROJECTS_TESTS_CONTAINER_PROJECT_ENDPOINT=
4444
AZURE_AI_PROJECTS_TESTS_CONTAINER_APP_RESOURCE_ID=
4545
AZURE_AI_PROJECTS_TESTS_CONTAINER_INGRESS_SUBDOMAIN_SUFFIX=
4646

47+
# Connection IDs and settings used in agent tool tests
48+
AZURE_AI_PROJECTS_TESTS_BING_PROJECT_CONNECTION_ID=
49+
AZURE_AI_PROJECTS_TESTS_AI_SEARCH_PROJECT_CONNECTION_ID=
50+
AZURE_AI_PROJECTS_TESTS_AI_SEARCH_INDEX_NAME=
51+
AZURE_AI_PROJECTS_TESTS_MCP_PROJECT_CONNECTION_ID=
52+
4753
# Used in tools
4854
BING_PROJECT_CONNECTION_ID=
4955
MCP_PROJECT_CONNECTION_ID=

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# [END tool_declaration]
6565

6666
agent = project_client.agents.create_version(
67-
agent_name="bing-grounding-agent",
67+
agent_name="MyAgent",
6868
definition=PromptAgentDefinition(
6969
model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
7070
instructions="You are a helpful assistant.",

sdk/ai/azure-ai-projects/tests/agents/tools/README.md

Lines changed: 0 additions & 307 deletions
This file was deleted.

sdk/ai/azure-ai-projects/tests/agents/tools/multitool/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
import os
1616
import pytest
17+
from io import BytesIO
1718
from test_base import TestBase, servicePreparer
1819
from devtools_testutils import is_live_and_not_recording
1920
from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool, CodeInterpreterTool, CodeInterpreterToolAuto
2021

21-
2222
class TestAgentFileSearchAndCodeInterpreter(TestBase):
2323
"""Tests for agents using File Search + Code Interpreter combination."""
2424

@@ -40,9 +40,7 @@ def test_find_and_analyze_data(self, **kwargs):
4040

4141
# Create data file
4242
txt_content = "Sample data: 10, 20, 30, 40, 50"
43-
vector_store = openai_client.vector_stores.create(name="DataStore")
44-
45-
from io import BytesIO
43+
vector_store = openai_client.vector_stores.create(name="DataStore")
4644

4745
txt_file = BytesIO(txt_content.encode("utf-8"))
4846
txt_file.name = "data.txt"

sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ def test_agent_ai_search_question_answering(self, **kwargs):
8585
openai_client = project_client.get_openai_client()
8686

8787
# Get AI Search connection and index from environment
88-
ai_search_connection_id = kwargs.get("azure_ai_projects_tests_ai_search_connection_id")
88+
ai_search_connection_id = kwargs.get("azure_ai_projects_tests_ai_search_project_connection_id")
8989
ai_search_index_name = kwargs.get("azure_ai_projects_tests_ai_search_index_name")
9090

9191
if not ai_search_connection_id:
92-
pytest.skip("AI_SEARCH_PROJECT_CONNECTION_ID environment variable not set")
92+
pytest.skip("AZURE_AI_PROJECTS_TESTS_AI_SEARCH_PROJECT_CONNECTION_ID environment variable not set")
9393

9494
if not ai_search_index_name:
95-
pytest.skip("AI_SEARCH_INDEX_NAME environment variable not set")
95+
pytest.skip("AZURE_AI_PROJECTS_TESTS_AI_SEARCH_INDEX_NAME environment variable not set")
9696

9797
assert isinstance(ai_search_connection_id, str), "ai_search_connection_id must be a string"
9898
assert isinstance(ai_search_index_name, str), "ai_search_index_name must be a string"

sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,17 @@ async def test_agent_ai_search_question_answering_async_parallel(self, **kwargs)
151151
project_client = self.create_async_client(operation_group="agents", **kwargs)
152152

153153
async with project_client:
154-
openai_client = await project_client.get_openai_client()
154+
openai_client = project_client.get_openai_client()
155155

156156
# Get AI Search connection and index from environment
157-
ai_search_connection_id = kwargs.get("azure_ai_projects_tests_ai_search_connection_id")
157+
ai_search_connection_id = kwargs.get("azure_ai_projects_tests_ai_search_project_connection_id")
158158
ai_search_index_name = kwargs.get("azure_ai_projects_tests_ai_search_index_name")
159159

160160
if not ai_search_connection_id:
161-
pytest.skip("AI_SEARCH_PROJECT_CONNECTION_ID environment variable not set")
161+
pytest.skip("AZURE_AI_PROJECTS_TESTS_AI_SEARCH_PROJECT_CONNECTION_ID environment variable not set")
162162

163163
if not ai_search_index_name:
164-
pytest.skip("AI_SEARCH_INDEX_NAME environment variable not set")
164+
pytest.skip("AZURE_AI_PROJECTS_TESTS_AI_SEARCH_INDEX_NAME environment variable not set")
165165

166166
assert isinstance(ai_search_connection_id, str), "ai_search_connection_id must be a string"
167167
assert isinstance(ai_search_index_name, str), "ai_search_index_name must be a string"

0 commit comments

Comments
 (0)