diff --git a/foundry-samples.sln b/foundry-samples.sln new file mode 100644 index 00000000..e84fb391 --- /dev/null +++ b/foundry-samples.sln @@ -0,0 +1,41 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{5D20AA90-6969-D8BD-9DCD-8634F4692FDA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "agent-catalog", "agent-catalog", "{16876C7D-E0C1-D2DF-BFEC-64162D0AD55C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "msft-agent-samples", "msft-agent-samples", "{D3494D53-BD9A-965C-E68F-9DD538442676}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "foundry-agent-service-sdk", "foundry-agent-service-sdk", "{5B086002-1269-14D2-55B4-387D0035AC7C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "a2a-agent", "a2a-agent", "{FA2213FC-CB04-AF3C-BD53-1AA87ADD42FC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "a2a", "samples\agent-catalog\msft-agent-samples\foundry-agent-service-sdk\a2a-agent\a2a.csproj", "{BC6566E7-A157-761A-F78C-00369AB21694}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BC6566E7-A157-761A-F78C-00369AB21694}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC6566E7-A157-761A-F78C-00369AB21694}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC6566E7-A157-761A-F78C-00369AB21694}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC6566E7-A157-761A-F78C-00369AB21694}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {16876C7D-E0C1-D2DF-BFEC-64162D0AD55C} = {5D20AA90-6969-D8BD-9DCD-8634F4692FDA} + {D3494D53-BD9A-965C-E68F-9DD538442676} = {16876C7D-E0C1-D2DF-BFEC-64162D0AD55C} + {5B086002-1269-14D2-55B4-387D0035AC7C} = {D3494D53-BD9A-965C-E68F-9DD538442676} + {FA2213FC-CB04-AF3C-BD53-1AA87ADD42FC} = {5B086002-1269-14D2-55B4-387D0035AC7C} + {BC6566E7-A157-761A-F78C-00369AB21694} = {FA2213FC-CB04-AF3C-BD53-1AA87ADD42FC} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D7409907-4201-4979-AAB5-254C753A2EC4} + EndGlobalSection +EndGlobal diff --git a/samples/python/hosted-agents/agent-framework/invocations/01-basic/main.py b/samples/python/hosted-agents/agent-framework/invocations/01-basic/main.py index f143b138..031ab42f 100644 --- a/samples/python/hosted-agents/agent-framework/invocations/01-basic/main.py +++ b/samples/python/hosted-agents/agent-framework/invocations/01-basic/main.py @@ -6,6 +6,7 @@ from agent_framework import Agent, AgentSession from agent_framework.foundry import FoundryChatClient from azure.ai.agentserver.invocations import InvocationAgentServerHost +from agent_framework.observability import enable_instrumentation from azure.identity import DefaultAzureCredential from dotenv import load_dotenv from starlette.requests import Request @@ -14,6 +15,9 @@ # Load environment variables from .env file load_dotenv() +# Enable instrumentation for observability +enable_instrumentation(enable_sensitive_data=True) + # In-memory session store — keyed by session ID. # WARNING: This is lost on restart. Use durable storage in production. diff --git a/samples/python/hosted-agents/agent-framework/responses/01-basic/main.py b/samples/python/hosted-agents/agent-framework/responses/01-basic/main.py index 010b1fc4..06f30c8a 100644 --- a/samples/python/hosted-agents/agent-framework/responses/01-basic/main.py +++ b/samples/python/hosted-agents/agent-framework/responses/01-basic/main.py @@ -5,12 +5,16 @@ from agent_framework import Agent from agent_framework.foundry import FoundryChatClient from agent_framework_foundry_hosting import ResponsesHostServer +from agent_framework.observability import enable_instrumentation from azure.identity import DefaultAzureCredential from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() +# Enable instrumentation for observability +enable_instrumentation(enable_sensitive_data=True) + def main(): client = FoundryChatClient( diff --git a/samples/python/hosted-agents/agent-framework/responses/02-tools/main.py b/samples/python/hosted-agents/agent-framework/responses/02-tools/main.py index e1247be2..689ece44 100644 --- a/samples/python/hosted-agents/agent-framework/responses/02-tools/main.py +++ b/samples/python/hosted-agents/agent-framework/responses/02-tools/main.py @@ -6,6 +6,7 @@ from agent_framework import Agent, tool from agent_framework.foundry import FoundryChatClient from agent_framework_foundry_hosting import ResponsesHostServer +from agent_framework.observability import enable_instrumentation from azure.identity import DefaultAzureCredential from dotenv import load_dotenv from pydantic import Field @@ -14,6 +15,9 @@ # Load environment variables from .env file load_dotenv() +# Enable instrumentation for observability +enable_instrumentation(enable_sensitive_data=True) + @tool(approval_mode="never_require") def get_weather( diff --git a/samples/python/hosted-agents/agent-framework/responses/03-mcp/main.py b/samples/python/hosted-agents/agent-framework/responses/03-mcp/main.py index ba02b759..0aac6f9e 100644 --- a/samples/python/hosted-agents/agent-framework/responses/03-mcp/main.py +++ b/samples/python/hosted-agents/agent-framework/responses/03-mcp/main.py @@ -6,12 +6,16 @@ from agent_framework import Agent from agent_framework.foundry import FoundryChatClient from agent_framework_foundry_hosting import ResponsesHostServer +from agent_framework.observability import enable_instrumentation from azure.identity import DefaultAzureCredential from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() +# Enable instrumentation for observability +enable_instrumentation(enable_sensitive_data=True) + logger = logging.getLogger(__name__) diff --git a/samples/python/hosted-agents/agent-framework/responses/04-foundry-toolbox/main.py b/samples/python/hosted-agents/agent-framework/responses/04-foundry-toolbox/main.py index 283d0340..edc87270 100644 --- a/samples/python/hosted-agents/agent-framework/responses/04-foundry-toolbox/main.py +++ b/samples/python/hosted-agents/agent-framework/responses/04-foundry-toolbox/main.py @@ -7,12 +7,16 @@ from agent_framework import Agent, MCPStreamableHTTPTool from agent_framework.foundry import FoundryChatClient from agent_framework_foundry_hosting import ResponsesHostServer +from agent_framework.observability import enable_instrumentation from azure.identity import DefaultAzureCredential, get_bearer_token_provider from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() +# Enable instrumentation for observability +enable_instrumentation(enable_sensitive_data=True) + def resolve_toolbox_endpoint() -> str: """Resolve the toolbox MCP endpoint URL.""" project_endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"].rstrip("/") diff --git a/samples/python/hosted-agents/agent-framework/responses/05-workflows/main.py b/samples/python/hosted-agents/agent-framework/responses/05-workflows/main.py index d70edbc7..b0a28a6c 100644 --- a/samples/python/hosted-agents/agent-framework/responses/05-workflows/main.py +++ b/samples/python/hosted-agents/agent-framework/responses/05-workflows/main.py @@ -5,12 +5,16 @@ from agent_framework import Agent, AgentExecutor, WorkflowBuilder from agent_framework.foundry import FoundryChatClient from agent_framework_foundry_hosting import ResponsesHostServer +from agent_framework.observability import enable_instrumentation from azure.identity import DefaultAzureCredential from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() +# Enable instrumentation for observability +enable_instrumentation(enable_sensitive_data=True) + def main(): client = FoundryChatClient( diff --git a/samples/python/hosted-agents/agent-framework/responses/09-declarative-customer-support/main.py b/samples/python/hosted-agents/agent-framework/responses/09-declarative-customer-support/main.py index 84f59a45..53d61049 100644 --- a/samples/python/hosted-agents/agent-framework/responses/09-declarative-customer-support/main.py +++ b/samples/python/hosted-agents/agent-framework/responses/09-declarative-customer-support/main.py @@ -8,6 +8,7 @@ from agent_framework.foundry import FoundryChatClient from agent_framework_declarative import WorkflowFactory from agent_framework_foundry_hosting import ResponsesHostServer +from agent_framework.observability import enable_instrumentation from azure.identity import DefaultAzureCredential from dotenv import load_dotenv from pydantic import BaseModel, Field @@ -15,6 +16,9 @@ # Load environment variables from .env file load_dotenv() +# Enable instrumentation for observability +enable_instrumentation(enable_sensitive_data=True) + # --- Structured triage response --------------------------------------------------