Skip to content

Commit 0fa0e94

Browse files
authored
Merge branch 'main' into main
2 parents 077dc48 + 2bbc1da commit 0fa0e94

File tree

92 files changed

+2350
-1756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2350
-1756
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
## Agent Catalog - 3P Agent Samples
22

3-
WARNING: <disclaimer here>
3+
This folder contains Third-Party Agent code samples.
4+
5+
**IMPORTANT NOTE:** Starter templates, instructions, code samples and resources in this 3P-agent-samples file (“samples”) are designed to assist in accelerating development of agents for specific scenarios. It is important that you review all provided resources and carefully test Agent behavior in the context of your use case: ([Learn more](https://learn.microsoft.com/en-us/legal/cognitive-services/agents/transparency-note?context=%2Fazure%2Fai-services%2Fagents%2Fcontext%2Fcontext)).
6+
7+
Certain Agent offerings may be subject to legal and regulatory requirements, may require licenses, or may not be suitable for all industries, scenarios, or use cases. By using any sample, you are acknowledging that Agents or other output created using that sample are solely your responsibility, and that you will comply with all applicable laws, regulations, and relevant safety standards, terms of service, and codes of conduct.
8+
9+
**WARNING:** The samples in this 3P-agent-samples folder were created by third parties, not Microsoft, and have not been tested or verified by Microsoft. Your use is subject to the terms provided by the relevant third party. By using any third-party sample in this file, you are acknowledging that Microsoft has no responsibility to you or others with respect to these samples.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Agent Catalog - 3P Agent Samples for Azure AI Foundry Agent Service SDK
2+
3+
This folder contains Third-Party Agent code samples for Azure Ai Foundry Service SDK.
4+
5+
**IMPORTANT NOTE:** Starter templates, instructions, code samples and resources in this 3P-agent-samples file (“samples”) are designed to assist in accelerating development of agents for specific scenarios. It is important that you review all provided resources and carefully test Agent behavior in the context of your use case: ([Learn more](https://learn.microsoft.com/en-us/legal/cognitive-services/agents/transparency-note?context=%2Fazure%2Fai-services%2Fagents%2Fcontext%2Fcontext)).
6+
7+
Certain Agent offerings may be subject to legal and regulatory requirements, may require licenses, or may not be suitable for all industries, scenarios, or use cases. By using any sample, you are acknowledging that Agents or other output created using that sample are solely your responsibility, and that you will comply with all applicable laws, regulations, and relevant safety standards, terms of service, and codes of conduct.
8+
9+
**WARNING:** The samples in this 3P-agent-samples folder were created by third parties, not Microsoft, and have not been tested or verified by Microsoft. Your use is subject to the terms provided by the relevant third party. By using any third-party sample in this file, you are acknowledging that Microsoft has no responsibility to you or others with respect to these samples.

samples/agent-catalog/3p-agent-samples/foundry-agent-service-sdk/auquan/README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
**IMPORTANT NOTE FROM MICROSOFT:** The sample below was created by a third party, not Microsoft, and has not been tested or verified by Microsoft. Your use is subject to the terms provided by the relevant third party. By using the third-party sample in this file, you are acknowledging that Microsoft has no responsibility to you or others with respect to this sample.
2+
3+
4+
------
5+
16
# Auquan Due Diligence Risk Analyst Agent
27

38
This code sample for the Due Diligence Risk Analyst enables building an expert system designed to provide comprehensive risk analysis and timeline tracking for companies. It specializes in analyzing company risks across multiple dimensions including operational, financial, regulatory, and sustainability metrics. The agent processes structured risk data from Auquan's API, generates detailed timelines, and provides actionable insights through well-formatted reports with visual risk indicators.
@@ -99,17 +104,17 @@ template.py
99104
---
100105
## 💬 Example Agent Interactions
101106

102-
- "Do a risk analysis for Microsoft"
107+
- "Do a risk analysis for Darktrace"
103108

104-
- "What are the critical risks identified for Microsoft?"
109+
- "What are the critical risks identified for Openai"
105110

106-
- "Generate a sustainability analysis for Microsoft"
111+
- "Generate a sustainability analysis for ClimatePartner"
107112

108-
- "Create a table indicating risks for Microsoft showing all categories and severity"
113+
- "What is the overall risk range of Zoom?"
109114

110-
- "What is the overall risk range of Microsoft?"
115+
- "What are the recent themes around Coursera and what are their impacts?"
111116

112-
- "What are the recent themes around Microsoft and what are their impacts?"
117+
- "What are the recent risks for Autodesk ?"
113118

114119

115120
## 🛠 Customization Tips
@@ -122,3 +127,7 @@ template.py
122127
123128
- **Connect with local files**
124129
Add your local files to include your data in risk-analysis
130+
131+
132+
## Note :
133+
If you encounter a "rate limit exceeded" error, navigate to the "Models + Endpoints" tab in the Foundry Portal and increase the TPM (tokens per minute) limit for your model. We recommend setting it to around 100,000 to start with.

samples/agent-catalog/3p-agent-samples/foundry-agent-service-sdk/marqueeinsights-news-agent/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
**IMPORTANT NOTE FROM MICROSOFT:** The sample below was created by a third party, not Microsoft, and has not been tested or verified by Microsoft. Your use is subject to the terms provided by the relevant third party. By using the third-party sample in this file, you are acknowledging that Microsoft has no responsibility to you or others with respect to this sample.
2+
3+
4+
------
5+
16
# AI News Agent
27

38
This code sample enables creating an intelligent information summarization agent designed to help executives and decision-makers stay on top of the rapidly evolving world of artificial intelligence. By continuously scanning credible news sources, it identifies and summarizes the most impactful AI developments—especially those relevant to the Microsoft ecosystem, healthcare, and legal industries.
49

510
The agent reduces information overload by prioritizing high-value updates and presenting them in a clear, digestible Markdown table format. Each summary includes a headline, date, key insight, strategic implications, and a verified source link.
611

7-
**AI News is not a replacement for human analysis or legal due diligence. Instead, it augments executive awareness by surfacing credible developments that may require further attention or discussion. All strategic decisions and compliance assessments remain the responsibility of the end user.**
12+
**WARNING:** AI News is not a replacement for human analysis or legal due diligence. Instead, it augments executive awareness by surfacing credible developments that may require further attention or discussion. All strategic decisions and compliance assessments remain the responsibility of the end user.
813

914

1015
## 🎯 Use Cases

samples/agent-catalog/3p-agent-samples/foundry-agent-service-sdk/mihcm-hr-assist-agent/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
**IMPORTANT NOTE FROM MICROSOFT:** The sample below was created by a third party, not Microsoft, and has not been tested or verified by Microsoft. Your use is subject to the terms provided by the relevant third party. By using the third-party sample in this file, you are acknowledging that Microsoft has no responsibility to you or others with respect to this sample.
2+
3+
4+
------
5+
6+
17
# HR Assist Agent
28

39
This repository provides a template for deploying and managing an Azure AI Agent for MiHCM. The project leverages Azure Bicep for infrastructure deployment and Python for interacting with Azure AI services and APIs.
410

11+
512
## Features
613

714
- **Azure AI Agent Deployment**: Automates the deployment of Azure AI resources, including AI Hubs, AI Projects, and dependent resources.
@@ -73,4 +80,4 @@ Ocp-Apim-Subscription-Key: <your key>
7380
## Support
7481
Have a question or need assistance? Get in touch with our team:
7582
76-
- Info on how to setup an account with MiHCM: https://mihcm.com/contact-us/
83+
- Info on how to setup an account with MiHCM: https://mihcm.com/contact-us/

samples/agent-catalog/3p-agent-samples/foundry-agent-service-sdk/mihcm-hr-assist-agent/template.py

Lines changed: 58 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import os
22
import jsonref
3-
from azure.ai.projects import AIProjectClient
4-
from azure.identity import DefaultAzureCredential
5-
from azure.ai.projects.models import OpenApiTool,OpenApiConnectionAuthDetails, OpenApiConnectionSecurityScheme
6-
from dotenv import load_dotenv
7-
from datetime import datetime
8-
import requests
93
import json
4+
from datetime import datetime
5+
from dotenv import load_dotenv
6+
from azure.identity import DefaultAzureCredential
7+
from azure.ai.agents import AgentsClient
8+
from azure.ai.agents.models import (
9+
ListSortOrder,
10+
OpenApiTool,
11+
OpenApiConnectionAuthDetails,
12+
OpenApiConnectionSecurityScheme,
13+
)
1014

1115

1216
"""
@@ -40,6 +44,13 @@
4044
# Set the employee code for the user
4145
employeeCode = 1
4246

47+
# Read config
48+
config = {
49+
"project_endpoint": os.environ["PROJECT_ENDPOINT"],
50+
"connection_id": os.environ["PROJECT_OPENAPI_CONNECTION_ID"],
51+
"model_name": "gpt-4o"
52+
}
53+
4354
#sample reuqests to test the agent
4455

4556
# sample_requests = [
@@ -51,17 +62,14 @@
5162
# "list all my work items for today and yesterday"
5263
# ]
5364

54-
# Create an Azure AI Client from a connection string, copied from your Azure AI Foundry project.
55-
project_client = AIProjectClient.from_connection_string(
65+
# Create agent client
66+
agents_client = AgentsClient(
67+
endpoint=config["project_endpoint"],
5668
credential=DefaultAzureCredential(),
57-
conn_str=os.environ["PROJECT_CONNECTION_STRING"],
69+
api_version="2025-05-15-preview"
5870
)
5971

60-
# create a connection object for the openapi tool's API key
61-
connection_name = os.environ["PROJECT_OPENAPI_CONNECTION_NAME"]
62-
connection = project_client.connections.get(connection_name=connection_name)
63-
64-
# use with local openapi.json file
72+
# Load OpenAPI spec
6573
with open('./mihcmExternalAPI.json', 'r') as f:
6674
openapi_spec = jsonref.loads(f.read())
6775

@@ -70,11 +78,18 @@
7078
# response.raise_for_status() # makes sure it raises an error if something goes wrong
7179
# openapi_spec = jsonref.loads(response.text)
7280

73-
# Create Auth object for the OpenApiTool
74-
auth = OpenApiConnectionAuthDetails(security_scheme=OpenApiConnectionSecurityScheme(connection_id=connection.id))
81+
# Set up the OpenAPI connection auth
82+
auth = OpenApiConnectionAuthDetails(
83+
security_scheme=OpenApiConnectionSecurityScheme(connection_id=config["connection_id"])
84+
)
7585

76-
# Initialize agent OpenAPI tool using the read in OpenAPI spec
77-
openapi = OpenApiTool(name="MiHCMAgent", spec=openapi_spec, description="Lets communicate with MiHCM agent to execute different tasks", auth=auth)
86+
# Define OpenAPI tool
87+
mihcm_tool = OpenApiTool(
88+
name="MiHCMAgent",
89+
spec=openapi_spec,
90+
description="Lets communicate with MiHCM agent to execute different tasks",
91+
auth=auth
92+
)
7893

7994
#Agent instructions
8095
instructions = f"""You are a helpful assistant.
@@ -92,40 +107,45 @@
92107

93108
agent_request = "list all my work items for today and yesterday"
94109

95-
# Create agent with OpenAPI tool and process assistant run
96-
with project_client:
97-
agent = project_client.agents.create_agent(
98-
model="gpt-4o-mini",
110+
# Run the interaction with the agent
111+
with agents_client:
112+
# Create agent
113+
agent = agents_client.create_agent(
114+
model=config["model_name"],
99115
name="mi-agent",
100116
instructions=instructions,
101-
tools=openapi.definitions
117+
tools=mihcm_tool.definitions
102118
)
103119
print(f"Created agent, ID: {agent.id}")
104120

105-
# Create thread for communication
106-
thread = project_client.agents.create_thread()
121+
# Create thread
122+
thread = agents_client.threads.create()
107123
print(f"Created thread, ID: {thread.id}")
108-
# Create message to thread
109-
message = project_client.agents.create_message(
124+
125+
# Create message
126+
message = agents_client.messages.create(
110127
thread_id=thread.id,
111128
role="user",
112-
content=agent_request,
129+
content=agent_request
113130
)
114-
print(f"Created message, ID: {message.id}")
131+
print(f"Created message: {message['id']}")
115132

116-
# Create and process agent run in thread with tools
117-
run = project_client.agents.create_and_process_run(thread_id=thread.id, agent_id=agent.id)
133+
# Run agent
134+
run = agents_client.runs.create_and_process(thread_id=thread.id, agent_id=agent.id)
118135
print(f"Run finished with status: {run.status}")
119136

120137
if run.status == "failed":
121138
print(f"Run failed: {run.last_error}")
122139

123-
# Delete the assistant when done
124-
project_client.agents.delete_agent(agent.id)
125-
print("Deleted agent")
140+
# Read response
141+
messages = agents_client.messages.list(thread_id=thread.id, order=ListSortOrder.ASCENDING)
142+
for msg in messages:
143+
if msg.text_messages:
144+
last_text = msg.text_messages[-1]
145+
print(f"{msg.role}: {last_text.text.value}")
126146

127-
# Fetch and log all messages
128-
messages = project_client.agents.list_messages(thread_id=thread.id,after=message.id,order="asc")
129-
print(f"Messages: {messages.data[0].content[0].text.value}")
147+
# Cleanup
148+
agents_client.delete_agent(agent.id)
149+
print("Deleted agent")
130150

131-
151+

samples/agent-catalog/3p-agent-samples/foundry-agent-service-sdk/saifr-comm-compliance-agent/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1+
**IMPORTANT NOTE FROM MICROSOFT:** The sample below was created by a third party, not Microsoft, and has not been tested or verified by Microsoft. Your use is subject to the terms provided by the relevant third party. By using the third-party sample in this file, you are acknowledging that Microsoft has no responsibility to you or others with respect to this sample.
2+
3+
4+
------
5+
6+
17
# Saifr Communication Compliance Agent
28

39
## Description
410

511
This code sample helps create the Saifr Communication Compliance Agent that converts potentially noncompliant text to a more compliant, fair, and balanced version, helping end users better adhere to relevant regulatory guidelines.
612

713

8-
_Saifr Agent is not intended to replace the end user’s legal, compliance, business, or other functions,
14+
**WARNING:** Saifr Agent is not intended to replace the end user’s legal, compliance, business, or other functions,
915
or to satisfy any legal or regulatory obligations.  Note that all compliance responsibilities remain solely
1016
those of the end user and that certain communications may require review and approval by properly licensed
1117
individuals.  Saifr is not responsible for determining compliance with rules and will not be liable for
12-
actions taken or not taken based on Agent use._
18+
actions taken or not taken based on Agent use.
19+
1320

1421
### Architecture Overview
1522
The Saifr Communication Compliance Agent uses gpt-40-mini (version:2024-07-18) as the agent orchestrator LLM. We chose

samples/agent-catalog/3p-agent-samples/foundry-agent-service-sdk/sightmachine-filler-optimization-agent/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
**IMPORTANT NOTE FROM MICROSOFT:** The sample below was created by a third party, not Microsoft, and has not been tested or verified by Microsoft. Your use is subject to the terms provided by the relevant third party. By using the third-party sample in this file, you are acknowledging that Microsoft has no responsibility to you or others with respect to this sample.
2+
3+
4+
------
5+
16
<h1>
27
<span style="display: flex; align-items: center;">
38
<picture>
@@ -11,7 +16,8 @@
1116

1217
This repository provides templates for deploying and running the Sight Machine Filler Agent. Sight Machine is a data and analytics platform for manufacturing. We model data, provide basic visualization and analytics tools, and provide advanced AI analytics for manufacturing plant floor users. For more information, see www.sightmachine.com.
1318

14-
**IMPORTANT**: Full functionality of this agent, including advanced features, requires a subscription to Sight Machine. However, basic example data allows users to test and explore the core functionality of the agent.
19+
**WARNING**: Full functionality of this agent, including advanced features, requires a subscription to Sight Machine. However, basic example data allows users to test and explore the core functionality of the agent.
20+
1521

1622
## Use Cases
1723

@@ -89,4 +95,4 @@ Finally, create the `local.settings.json` in the `python` folder.
8995
## Support
9096

9197
- Technical support: email `[email protected]`
92-
- Setting up an account: Fill out our [contact form](https://sightmachine.com/contact/)
98+
- Setting up an account: Fill out our [contact form](https://sightmachine.com/contact/)

samples/agent-catalog/CONTRIBUTING.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,31 @@ Optional (as appropriate)
3838

3939
```text
4040
/<agent-name>/
41+
4142
├── README.md
42-
├── template.py
43-
├── deploy.bicep (optional)
44-
├── sample_data/ (optional)
45-
│ ├── example_input.json
46-
│ └── example_output.json
43+
├── python/ # Python-specific implementation
44+
│ ├── template.py
45+
│ ├── deploy.bicep (optional)
46+
│ ├── src/
47+
│ │ └── custom_logic.py
48+
│ ├── tests/ (optional)
49+
│ │ └── test_agent.py
50+
│ └── sample_data/
51+
│ ├── example_input.json
52+
│ └── example_output.json
53+
├── csharp/ # C# implementation
54+
│ ├── template.csproj
55+
│ ├── deploy.bicep (optional)
56+
│ ├── src/
57+
│ │ └── AgentLogic.cs
58+
│ │ └── Tools/
59+
│ │ └── CustomTool.cs
60+
│ ├── tests/ (optional)
61+
│ │ └── AgentTests.cs
4762
├── assets/ (optional)
48-
│ └── architecture.png
63+
│ ├── architecture.png
64+
│ ├── knowledge_example.json
65+
│ └── logo.svg (required if not Microsoft-authored)
4966
└── LICENSE
5067
5168
```
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
## Agent Catalog - Microsoft-authored Agent Samples
22

3-
WARNING: <disclaimer here>
3+
This folder contains Microsoft-authored Agent code samples for the Azure AI Agent Service SDK and the Semantic Kernel SDK.
4+
5+
**IMPORTANT NOTE:** Starter templates, instructions, code samples and resources in this msft-agent-samples file (“samples”) are designed to assist in accelerating development of agents for specific scenarios. It is important that you review all provided resources and carefully test Agent behavior in the context of your use case: ([Learn More](https://learn.microsoft.com/en-us/legal/cognitive-services/agents/transparency-note?context=%2Fazure%2Fai-services%2Fagents%2Fcontext%2Fcontext)).
6+
7+
Certain Agent offerings may be subject to legal and regulatory requirements, may require licenses, or may not be suitable for all industries, scenarios, or use cases. By using any sample, you are acknowledging that Agents or other output created using that sample are solely your responsibility, and that you will comply with all applicable laws, regulations, and relevant safety standards, terms of service, and codes of conduct.

0 commit comments

Comments
 (0)