diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_memory.py b/sdk/ai/azure-ai-projects/samples/agents/memory/sample_agent_memory.py similarity index 71% rename from sdk/ai/azure-ai-projects/samples/agents/sample_agent_memory.py rename to sdk/ai/azure-ai-projects/samples/agents/memory/sample_agent_memory.py index 010d12ec9014..b4a8aac91674 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_memory.py +++ b/sdk/ai/azure-ai-projects/samples/agents/memory/sample_agent_memory.py @@ -1,30 +1,32 @@ -# # ------------------------------------ -# # Copyright (c) Microsoft Corporation. -# # Licensed under the MIT License. -# # ------------------------------------ - -# """ -# DESCRIPTION: -# This sample demonstrates how to integrate memory into a prompt agent. -# USAGE: -# python sample_agent_memory.py - -# Before running the sample: -# pip install python-dotenv azure-identity azure-ai-projects>=2.0.0b1 - -# Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). -# Once you have deployed models, set the deployment name in the variables below. - -# Set these environment variables with your own values: -# 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview -# page of your Azure AI Foundry portal. -# 2) AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model for the agent, as found under the "Name" column in -# the "Models + endpoints" tab in your Azure AI Foundry project. -# 3) AZURE_AI_CHAT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model for memory, as found under the "Name" column in -# the "Models + endpoints" tab in your Azure AI Foundry project. -# 4) AZURE_AI_EMBEDDING_MODEL_DEPLOYMENT_NAME - The deployment name of the embedding model for memory, as found under the -# "Name" column in the "Models + endpoints" tab in your Azure AI Foundry project. -# """ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates how to integrate memory into a prompt agent. + +USAGE: + python sample_agent_memory.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0b1" azure-identity python-dotenv + + Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). + Once you have deployed models, set the deployment name in the variables below. + + Set these environment variables with your own values: + 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Azure AI Foundry portal. + 2) AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model for the agent, as found under the "Name" column in + the "Models + endpoints" tab in your Azure AI Foundry project. + 3) AZURE_AI_CHAT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model for memory, as found under the "Name" column in + the "Models + endpoints" tab in your Azure AI Foundry project. + 4) AZURE_AI_EMBEDDING_MODEL_DEPLOYMENT_NAME - The deployment name of the embedding model for memory, as found under the + "Name" column in the "Models + endpoints" tab in your Azure AI Foundry project. +""" # import os # from dotenv import load_dotenv diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_memory_advanced.py b/sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_advanced.py similarity index 81% rename from sdk/ai/azure-ai-projects/samples/agents/sample_memory_advanced.py rename to sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_advanced.py index e8129343476a..bad2e24a9be3 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_memory_advanced.py +++ b/sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_advanced.py @@ -1,28 +1,30 @@ -# # ------------------------------------ -# # Copyright (c) Microsoft Corporation. -# # Licensed under the MIT License. -# # ------------------------------------ - -# """ -# DESCRIPTION: -# This sample demonstrates how to interact with the memory store to add and retrieve memory. -# USAGE: -# python sample_memory_advanced.py - -# Before running the sample: -# pip install python-dotenv azure-identity azure-ai-projects>=2.0.0b1 - -# Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). -# Once you have deployed models, set the deployment name in the variables below. - -# Set these environment variables with your own values: -# 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview -# page of your Azure AI Foundry portal. -# 2) AZURE_AI_CHAT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model, as found under the "Name" column in -# the "Models + endpoints" tab in your Azure AI Foundry project. -# 3) AZURE_AI_EMBEDDING_MODEL_DEPLOYMENT_NAME - The deployment name of the embedding model, as found under the -# "Name" column in the "Models + endpoints" tab in your Azure AI Foundry project. -# """ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates how to interact with the memory store to add and retrieve memory. + +USAGE: + python sample_memory_advanced.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0b1" azure-identity python-dotenv + + Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). + Once you have deployed models, set the deployment name in the variables below. + + Set these environment variables with your own values: + 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Azure AI Foundry portal. + 2) AZURE_AI_CHAT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model, as found under the "Name" column in + the "Models + endpoints" tab in your Azure AI Foundry project. + 3) AZURE_AI_EMBEDDING_MODEL_DEPLOYMENT_NAME - The deployment name of the embedding model, as found under the + "Name" column in the "Models + endpoints" tab in your Azure AI Foundry project. +""" # import os # from dotenv import load_dotenv diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_memory_basic.py b/sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_basic.py similarity index 71% rename from sdk/ai/azure-ai-projects/samples/agents/sample_memory_basic.py rename to sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_basic.py index bb15f1d113af..cb1c2e1b0c5a 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_memory_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_basic.py @@ -1,28 +1,30 @@ -# # ------------------------------------ -# # Copyright (c) Microsoft Corporation. -# # Licensed under the MIT License. -# # ------------------------------------ - -# """ -# DESCRIPTION: -# This sample demonstrates how to interact with the memory store to add and retrieve memory. -# USAGE: -# python sample_memory_basic.py - -# Before running the sample: -# pip install python-dotenv azure-identity azure-ai-projects>=2.0.0b1 - -# Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). -# Once you have deployed models, set the deployment name in the variables below. - -# Set these environment variables with your own values: -# 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview -# page of your Azure AI Foundry portal. -# 2) AZURE_AI_CHAT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model, as found under the "Name" column in -# the "Models + endpoints" tab in your Azure AI Foundry project. -# 3) AZURE_AI_EMBEDDING_MODEL_DEPLOYMENT_NAME - The deployment name of the embedding model, as found under the -# "Name" column in the "Models + endpoints" tab in your Azure AI Foundry project. -# """ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates how to interact with the memory store to add and retrieve memory. + +USAGE: + python sample_memory_basic.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0b1" azure-identity python-dotenv + + Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). + Once you have deployed models, set the deployment name in the variables below. + + Set these environment variables with your own values: + 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Azure AI Foundry portal. + 2) AZURE_AI_CHAT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model, as found under the "Name" column in + the "Models + endpoints" tab in your Azure AI Foundry project. + 3) AZURE_AI_EMBEDDING_MODEL_DEPLOYMENT_NAME - The deployment name of the embedding model, as found under the + "Name" column in the "Models + endpoints" tab in your Azure AI Foundry project. +""" # import os # from dotenv import load_dotenv diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_memory_crud.py b/sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_crud.py similarity index 61% rename from sdk/ai/azure-ai-projects/samples/agents/sample_memory_crud.py rename to sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_crud.py index 58a92e25cd1b..437f11a1c1b6 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_memory_crud.py +++ b/sdk/ai/azure-ai-projects/samples/agents/memory/sample_memory_crud.py @@ -1,25 +1,27 @@ -# # ------------------------------------ -# # Copyright (c) Microsoft Corporation. -# # Licensed under the MIT License. -# # ------------------------------------ - -# """ -# DESCRIPTION: -# This sample demonstrates how to perform CRUD operations on a memory store using the Azure AI Projects SDK. -# USAGE: -# python sample_memory_crud.py - -# Before running the sample: -# pip install python-dotenv azure-identity azure-ai-projects>=2.0.0b1 - -# Set these environment variables with your own values: -# 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview -# page of your Azure AI Foundry portal. -# 2) AZURE_AI_CHAT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model, as found under the "Name" column in -# the "Models + endpoints" tab in your Azure AI Foundry project. -# 3) AZURE_AI_EMBEDDING_MODEL_DEPLOYMENT_NAME - The deployment name of the embedding model, as found under the -# "Name" column in the "Models + endpoints" tab in your Azure AI Foundry project. -# """ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates how to perform CRUD operations on a memory store using the Azure AI Projects SDK. + +USAGE: + python sample_memory_crud.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0b1" azure-identity python-dotenv + + Set these environment variables with your own values: + 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Azure AI Foundry portal. + 2) AZURE_AI_CHAT_MODEL_DEPLOYMENT_NAME - The deployment name of the chat model, as found under the "Name" column in + the "Models + endpoints" tab in your Azure AI Foundry project. + 3) AZURE_AI_EMBEDDING_MODEL_DEPLOYMENT_NAME - The deployment name of the embedding model, as found under the + "Name" column in the "Models + endpoints" tab in your Azure AI Foundry project. +""" # import os # from dotenv import load_dotenv diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_mcp_tool.py b/sdk/ai/azure-ai-projects/samples/agents/sample_mcp_tool_async_.py similarity index 89% rename from sdk/ai/azure-ai-projects/samples/agents/sample_mcp_tool.py rename to sdk/ai/azure-ai-projects/samples/agents/sample_mcp_tool_async_.py index b1ee504fce4e..c0154f7830ec 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_mcp_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_mcp_tool_async_.py @@ -6,17 +6,19 @@ """ DESCRIPTION: This sample demonstrates how to interact with the Foundry Project MCP tool. + USAGE: - python sample_mcp_tool.py + python sample_mcp_tool_async.py Before running the sample: - pip install python-dotenv azure-identity azure-ai-projects>=2.0.0b1 mcp - Set these environment variables with your own values: - 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview - page of your Azure AI Foundry portal. - 2) IMAGE_GEN_DEPLOYMENT_NAME - The deployment name of the image generation model, as found under the "Name" column in - the "Models + endpoints" tab in your Azure AI Foundry project. + pip install "azure-ai-projects>=2.0.0b1" azure-identity python-dotenv mcp + + Set these environment variables with your own values: + 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Azure AI Foundry portal. + 2) IMAGE_GEN_DEPLOYMENT_NAME - The deployment name of the image generation model, as found under the "Name" column in + the "Models + endpoints" tab in your Azure AI Foundry project. """ import asyncio