diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props
index 14e1035939c0..abab3dee8db4 100644
--- a/eng/Packages.Data.props
+++ b/eng/Packages.Data.props
@@ -208,6 +208,7 @@
+
@@ -501,4 +502,4 @@
1.0.0-alpha.20251203.1
1.0.0-alpha.20251125.3
-
\ No newline at end of file
+
diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/README.md b/sdk/ai/Azure.AI.Projects.OpenAI/README.md
index 669849f05000..e787c8c288ec 100644
--- a/sdk/ai/Azure.AI.Projects.OpenAI/README.md
+++ b/sdk/ai/Azure.AI.Projects.OpenAI/README.md
@@ -37,6 +37,7 @@ Develop Agents using the Azure AI Foundry platform, leveraging an extensive ecos
- [MCP tool with project connection](#mcp-tool-with-project-connection)
- [OpenAPI tool](#openapi-tool)
- [OpenAPI tool with project connection](#openapi-tool-project-connection)
+ - [SharePoint tool](#sharepoint-tool)
- [Tracing](#tracing)
- [Tracing to Azure Monitor](#tracing-to-azure-monitor)
- [Tracing to Console](#tracing-to-console)
@@ -1092,6 +1093,68 @@ OpenAIResponse response = await responseClient.CreateResponseAsync(
Console.WriteLine(response.GetOutputText());
```
+## SharePoint tool
+`SharepointAgentTool` allows Agent to access SharePoint pages to get the data context. Use the SharePoint connection name as it is shown in the connections section of Microsoft Foundry to get the connection. Get the connection ID to initialize the `SharePointGroundingToolOptions`, which will be used to create `SharepointAgentTool`.
+
+```C# Snippet:Sample_CreateAgent_Sharepoint_Async
+AIProjectConnection sharepointConnection = await projectClient.Connections.GetConnectionAsync(sharepointConnectionName);
+SharePointGroundingToolOptions sharepointToolOption = new()
+{
+ ProjectConnections = { new ToolProjectConnection(projectConnectionId: sharepointConnection.Id) }
+};
+PromptAgentDefinition agentDefinition = new(model: modelDeploymentName)
+{
+ Instructions = "You are a helpful assistant.",
+ Tools = { new SharepointAgentTool(sharepointToolOption), }
+};
+AgentVersion agentVersion = await projectClient.Agents.CreateAgentVersionAsync(
+ agentName: "myAgent",
+ options: new(agentDefinition));
+```
+
+Create the response and make sure we are always using tool.
+
+```C# Snippet:Sample_CreateResponse_Sharepoint_Async
+ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForAgent(agentVersion.Name);
+ResponseCreationOptions responseOptions = new()
+{
+ ToolChoice = ResponseToolChoice.CreateRequiredChoice()
+};
+OpenAIResponse response = await responseClient.CreateResponseAsync("What is Contoso whistleblower policy", options: responseOptions);
+```
+
+SharePoint tool can create the reference to the page, grounding the data. We will create the `GetFormattedAnnotation` method to get the URI annotation.
+
+```C# Snippet:Sample_FormatReference_Sharepoint
+private static string GetFormattedAnnotation(OpenAIResponse response)
+{
+ foreach (ResponseItem item in response.OutputItems)
+ {
+ if (item is MessageResponseItem messageItem)
+ {
+ foreach (ResponseContentPart content in messageItem.Content)
+ {
+ foreach (ResponseMessageAnnotation annotation in content.OutputTextAnnotations)
+ {
+ if (annotation is UriCitationMessageAnnotation uriAnnotation)
+ {
+ return $" [{uriAnnotation.Title}]({uriAnnotation.Uri})";
+ }
+ }
+ }
+ }
+ }
+ return "";
+}
+```
+
+Print the Agent output and add the annotation at the end.
+
+```C# Snippet:Sample_WaitForResponse_Sharepoint
+Assert.That(response.Status, Is.EqualTo(ResponseStatus.Completed));
+Console.WriteLine($"{response.GetOutputText()}{GetFormattedAnnotation(response)}");
+```
+
## Tracing
**Note:** The tracing functionality is currently in preview with limited scope. Only agent creation operations generate dedicated gen_ai traces currently. As a preview feature, the trace structure including spans, attributes, and events may change in future releases.
@@ -1131,6 +1194,7 @@ var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddAzureMonitorTraceExporter().Build();
```
+
### Tracing to Console
For tracing to console from your application, install the OpenTelemetry.Exporter.Console with [NuGet](https://www.nuget.org/ ):
diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample19_MCP_Connection.md b/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample20_MCP_Connection.md
similarity index 100%
rename from sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample19_MCP_Connection.md
rename to sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample20_MCP_Connection.md
diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample20_OpenAPI.md b/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample21_OpenAPI.md
similarity index 100%
rename from sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample20_OpenAPI.md
rename to sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample21_OpenAPI.md
diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample21_OpenAPI_Connection.md b/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample22_OpenAPI_Connection.md
similarity index 100%
rename from sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample21_OpenAPI_Connection.md
rename to sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample22_OpenAPI_Connection.md
diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample24_Sharepoint.md b/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample24_Sharepoint.md
new file mode 100644
index 000000000000..9f54c19b7055
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample24_Sharepoint.md
@@ -0,0 +1,115 @@
+# Sample for use of an Agent with SharePoint in Azure.AI.Projets.OpenAI.
+
+To enable your Agent to access SharePoint, use `SharepointAgentTool`.
+
+1. First, create an agent client and read the environment variables, which will be used in the next steps.
+
+```C# Snippet:Sample_CreateAgentClient_Sharepoint
+var projectEndpoint = System.Environment.GetEnvironmentVariable("PROJECT_ENDPOINT");
+var modelDeploymentName = System.Environment.GetEnvironmentVariable("MODEL_DEPLOYMENT_NAME");
+var sharepointConnectionName = System.Environment.GetEnvironmentVariable("SHAREPOINT_CONNECTION_NAME");
+AIProjectClient projectClient = new(endpoint: new Uri(projectEndpoint), tokenProvider: new DefaultAzureCredential());
+```
+
+2. Use the SharePoint connection name as it is shown in the connections section of Microsoft Foundry to get the connection. Get the connection ID to initialize the `SharePointGroundingToolOptions`, which will be used to create `SharepointAgentTool`. We will use this tool to create an Agent.
+
+Synchronous sample:
+```C# Snippet:Sample_CreateAgent_Sharepoint_Sync
+AIProjectConnection sharepointConnection = projectClient.Connections.GetConnection(sharepointConnectionName);
+SharePointGroundingToolOptions sharepointToolOption = new()
+{
+ ProjectConnections = { new ToolProjectConnection(projectConnectionId: sharepointConnection.Id) }
+};
+PromptAgentDefinition agentDefinition = new(model: modelDeploymentName)
+{
+ Instructions = "You are a helpful assistant.",
+ Tools = { new SharepointAgentTool(sharepointToolOption), }
+};
+AgentVersion agentVersion = projectClient.Agents.CreateAgentVersion(
+ agentName: "myAgent",
+ options: new(agentDefinition));
+```
+
+Asynchronous sample:
+```C# Snippet:Sample_CreateAgent_Sharepoint_Async
+AIProjectConnection sharepointConnection = await projectClient.Connections.GetConnectionAsync(sharepointConnectionName);
+SharePointGroundingToolOptions sharepointToolOption = new()
+{
+ ProjectConnections = { new ToolProjectConnection(projectConnectionId: sharepointConnection.Id) }
+};
+PromptAgentDefinition agentDefinition = new(model: modelDeploymentName)
+{
+ Instructions = "You are a helpful assistant.",
+ Tools = { new SharepointAgentTool(sharepointToolOption), }
+};
+AgentVersion agentVersion = await projectClient.Agents.CreateAgentVersionAsync(
+ agentName: "myAgent",
+ options: new(agentDefinition));
+```
+
+3. Create the response and make sure we are always using tool.
+
+Synchronous sample:
+```C# Snippet:Sample_CreateResponse_Sharepoint_Sync
+ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForAgent(agentVersion.Name);
+ResponseCreationOptions responseOptions = new()
+{
+ ToolChoice = ResponseToolChoice.CreateRequiredChoice()
+};
+OpenAIResponse response = responseClient.CreateResponse("What is Contoso whistleblower policy", options: responseOptions);
+```
+
+Asynchronous sample:
+```C# Snippet:Sample_CreateResponse_Sharepoint_Async
+ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForAgent(agentVersion.Name);
+ResponseCreationOptions responseOptions = new()
+{
+ ToolChoice = ResponseToolChoice.CreateRequiredChoice()
+};
+OpenAIResponse response = await responseClient.CreateResponseAsync("What is Contoso whistleblower policy", options: responseOptions);
+```
+
+4. SharePoint tool can create the reference to the page, grounding the data. We will create the `GetFormattedAnnotation` method to get the URI annotation.
+
+```C# Snippet:Sample_FormatReference_Sharepoint
+private static string GetFormattedAnnotation(OpenAIResponse response)
+{
+ foreach (ResponseItem item in response.OutputItems)
+ {
+ if (item is MessageResponseItem messageItem)
+ {
+ foreach (ResponseContentPart content in messageItem.Content)
+ {
+ foreach (ResponseMessageAnnotation annotation in content.OutputTextAnnotations)
+ {
+ if (annotation is UriCitationMessageAnnotation uriAnnotation)
+ {
+ return $" [{uriAnnotation.Title}]({uriAnnotation.Uri})";
+ }
+ }
+ }
+ }
+ }
+ return "";
+}
+```
+
+5. Print the Agent output and add the annotation at the end.
+
+```C# Snippet:Sample_WaitForResponse_Sharepoint
+Assert.That(response.Status, Is.EqualTo(ResponseStatus.Completed));
+Console.WriteLine($"{response.GetOutputText()}{GetFormattedAnnotation(response)}");
+```
+
+
+6. Clean up resources by deleting thread and agent.
+
+Synchronous sample:
+```C# Snippet:Sample_Cleanup_Sharepoint_Sync
+projectClient.Agents.DeleteAgentVersion(agentName: agentVersion.Name, agentVersion: agentVersion.Version);
+```
+
+Asynchronous sample:
+```C# Snippet:Sample_Cleanup_Sharepoint_Async
+await projectClient.Agents.DeleteAgentVersionAsync(agentName: agentVersion.Name, agentVersion: agentVersion.Version);
+```
diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/tests/ProjectsOpenAITestEnvironment.cs b/sdk/ai/Azure.AI.Projects.OpenAI/tests/ProjectsOpenAITestEnvironment.cs
index d2e75d298c48..0235e981960f 100644
--- a/sdk/ai/Azure.AI.Projects.OpenAI/tests/ProjectsOpenAITestEnvironment.cs
+++ b/sdk/ai/Azure.AI.Projects.OpenAI/tests/ProjectsOpenAITestEnvironment.cs
@@ -29,6 +29,7 @@ public class ProjectsOpenAITestEnvironment : TestEnvironment
public string CUSTOM_BING_CONNECTION_NAME => GetRecordedVariable("CUSTOM_BING_CONNECTION_NAME");
public string BING_CUSTOM_SEARCH_INSTANCE_NAME => GetRecordedVariable("BING_CUSTOM_SEARCH_INSTANCE_NAME");
public string MCP_PROJECT_CONNECTION_NAME => GetRecordedOptionalVariable("MCP_PROJECT_CONNECTION_NAME");
+ public string SHAREPOINT_CONNECTION_NAME => GetRecordedOptionalVariable("SHAREPOINT_CONNECTION_NAME");
public string WrappedGetRecordedVariable(string key, bool isSecret = true)
{
try
diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/tests/Samples/Sample_Sharepoint.cs b/sdk/ai/Azure.AI.Projects.OpenAI/tests/Samples/Sample_Sharepoint.cs
new file mode 100644
index 000000000000..3048756d8133
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OpenAI/tests/Samples/Sample_Sharepoint.cs
@@ -0,0 +1,139 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.Threading.Tasks;
+using Azure.Identity;
+using Microsoft.ClientModel.TestFramework;
+using NUnit.Framework;
+using OpenAI.Responses;
+
+namespace Azure.AI.Projects.OpenAI.Tests.Samples;
+
+public class Sample_Sharepoint : ProjectsOpenAITestBase
+{
+ [Test]
+ [AsyncOnly]
+ public async Task SharepointAsync()
+ {
+ IgnoreSampleMayBe();
+ #region Snippet:Sample_CreateAgentClient_Sharepoint
+#if SNIPPET
+ var projectEndpoint = System.Environment.GetEnvironmentVariable("PROJECT_ENDPOINT");
+ var modelDeploymentName = System.Environment.GetEnvironmentVariable("MODEL_DEPLOYMENT_NAME");
+ var sharepointConnectionName = System.Environment.GetEnvironmentVariable("SHAREPOINT_CONNECTION_NAME");
+#else
+ var projectEndpoint = TestEnvironment.PROJECT_ENDPOINT;
+ var modelDeploymentName = TestEnvironment.MODELDEPLOYMENTNAME;
+ var sharepointConnectionName = TestEnvironment.SHAREPOINT_CONNECTION_NAME;
+#endif
+ AIProjectClient projectClient = new(endpoint: new Uri(projectEndpoint), tokenProvider: new DefaultAzureCredential());
+
+ #endregion
+ #region Snippet:Sample_CreateAgent_Sharepoint_Async
+ AIProjectConnection sharepointConnection = await projectClient.Connections.GetConnectionAsync(sharepointConnectionName);
+ SharePointGroundingToolOptions sharepointToolOption = new()
+ {
+ ProjectConnections = { new ToolProjectConnection(projectConnectionId: sharepointConnection.Id) }
+ };
+ PromptAgentDefinition agentDefinition = new(model: modelDeploymentName)
+ {
+ Instructions = "You are a helpful assistant.",
+ Tools = { new SharepointAgentTool(sharepointToolOption), }
+ };
+ AgentVersion agentVersion = await projectClient.Agents.CreateAgentVersionAsync(
+ agentName: "myAgent",
+ options: new(agentDefinition));
+ #endregion
+ #region Snippet:Sample_CreateResponse_Sharepoint_Async
+ ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForAgent(agentVersion.Name);
+ ResponseCreationOptions responseOptions = new()
+ {
+ ToolChoice = ResponseToolChoice.CreateRequiredChoice()
+ };
+ OpenAIResponse response = await responseClient.CreateResponseAsync("What is Contoso whistleblower policy", options: responseOptions);
+ #endregion
+
+ #region Snippet:Sample_WaitForResponse_Sharepoint
+ Assert.That(response.Status, Is.EqualTo(ResponseStatus.Completed));
+ Console.WriteLine($"{response.GetOutputText()}{GetFormattedAnnotation(response)}");
+ #endregion
+
+ #region Snippet:Sample_Cleanup_Sharepoint_Async
+ await projectClient.Agents.DeleteAgentVersionAsync(agentName: agentVersion.Name, agentVersion: agentVersion.Version);
+ #endregion
+ }
+
+ [Test]
+ [SyncOnly]
+ public void Sharepoint()
+ {
+ IgnoreSampleMayBe();
+#if SNIPPET
+ var projectEndpoint = System.Environment.GetEnvironmentVariable("PROJECT_ENDPOINT");
+ var modelDeploymentName = System.Environment.GetEnvironmentVariable("MODEL_DEPLOYMENT_NAME");
+ var sharepointConnectionName = System.Environment.GetEnvironmentVariable("SHAREPOINT_CONNECTION_NAME");
+#else
+ var projectEndpoint = TestEnvironment.PROJECT_ENDPOINT;
+ var modelDeploymentName = TestEnvironment.MODELDEPLOYMENTNAME;
+ var sharepointConnectionName = TestEnvironment.SHAREPOINT_CONNECTION_NAME;
+#endif
+ AIProjectClient projectClient = new(endpoint: new Uri(projectEndpoint), tokenProvider: new DefaultAzureCredential());
+
+ #region Snippet:Sample_CreateAgent_Sharepoint_Sync
+ AIProjectConnection sharepointConnection = projectClient.Connections.GetConnection(sharepointConnectionName);
+ SharePointGroundingToolOptions sharepointToolOption = new()
+ {
+ ProjectConnections = { new ToolProjectConnection(projectConnectionId: sharepointConnection.Id) }
+ };
+ PromptAgentDefinition agentDefinition = new(model: modelDeploymentName)
+ {
+ Instructions = "You are a helpful assistant.",
+ Tools = { new SharepointAgentTool(sharepointToolOption), }
+ };
+ AgentVersion agentVersion = projectClient.Agents.CreateAgentVersion(
+ agentName: "myAgent",
+ options: new(agentDefinition));
+ #endregion
+ #region Snippet:Sample_CreateResponse_Sharepoint_Sync
+ ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForAgent(agentVersion.Name);
+ ResponseCreationOptions responseOptions = new()
+ {
+ ToolChoice = ResponseToolChoice.CreateRequiredChoice()
+ };
+ OpenAIResponse response = responseClient.CreateResponse("What is Contoso whistleblower policy", options: responseOptions);
+ #endregion
+
+ Assert.That(response.Status, Is.EqualTo(ResponseStatus.Completed));
+ Console.WriteLine($"{response.GetOutputText()}{GetFormattedAnnotation(response)}");
+
+ #region Snippet:Sample_Cleanup_Sharepoint_Sync
+ projectClient.Agents.DeleteAgentVersion(agentName: agentVersion.Name, agentVersion: agentVersion.Version);
+ #endregion
+ }
+
+ #region Snippet:Sample_FormatReference_Sharepoint
+ private static string GetFormattedAnnotation(OpenAIResponse response)
+ {
+ foreach (ResponseItem item in response.OutputItems)
+ {
+ if (item is MessageResponseItem messageItem)
+ {
+ foreach (ResponseContentPart content in messageItem.Content)
+ {
+ foreach (ResponseMessageAnnotation annotation in content.OutputTextAnnotations)
+ {
+ if (annotation is UriCitationMessageAnnotation uriAnnotation)
+ {
+ return $" [{uriAnnotation.Title}]({uriAnnotation.Uri})";
+ }
+ }
+ }
+ }
+ }
+ return "";
+ }
+ #endregion
+ public Sample_Sharepoint(bool isAsync) : base(isAsync)
+ { }
+}
diff --git a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs
index 8b46b943ec72..0f55d4820392 100644
--- a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs
+++ b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs
@@ -340,12 +340,12 @@ protected AIProjectConnectionsOperations() { }
public System.ClientModel.Primitives.ClientPipeline Pipeline { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnection(string connectionName, bool includeCredentials, CancellationToken cancellationToken) instead.")]
- public Azure.AI.Projects.AIProjectConnection GetConnection(string connectionName, bool includeCredentials, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
- public Azure.AI.Projects.AIProjectConnection GetConnection(string connectionName, bool includeCredentials = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.AI.Projects.AIProjectConnection GetConnection(string connectionName, bool includeCredentials, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
+ public virtual Azure.AI.Projects.AIProjectConnection GetConnection(string connectionName, bool includeCredentials = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnectionAsync(string connectionName, bool includeCredentials, CancellationToken cancellationToken) instead.")]
- public System.Threading.Tasks.Task> GetConnectionAsync(string connectionName, bool includeCredentials, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
- public System.Threading.Tasks.Task> GetConnectionAsync(string connectionName, bool includeCredentials = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> GetConnectionAsync(string connectionName, bool includeCredentials, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
+ public virtual System.Threading.Tasks.Task> GetConnectionAsync(string connectionName, bool includeCredentials = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnections(ConnectionType? connectionType, bool? defaultConnection, CancellationToken cancellationToken) instead.")]
public virtual System.ClientModel.CollectionResult GetConnections(Azure.AI.Projects.ConnectionType? connectionType, bool? defaultConnection, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
@@ -362,8 +362,8 @@ protected AIProjectConnectionsOperations() { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnectionsAsync(string connectionType, bool? defaultConnection, RequestOptions options) instead.")]
public virtual System.ClientModel.Primitives.AsyncCollectionResult GetConnectionsAsync(string connectionType, bool? defaultConnection, string clientRequestId, System.ClientModel.Primitives.RequestOptions options) { throw null; }
- public Azure.AI.Projects.AIProjectConnection GetDefaultConnection(Azure.AI.Projects.ConnectionType? connectionType = default(Azure.AI.Projects.ConnectionType?), bool includeCredentials = false) { throw null; }
- public System.Threading.Tasks.Task GetDefaultConnectionAsync(Azure.AI.Projects.ConnectionType? connectionType = default(Azure.AI.Projects.ConnectionType?), bool includeCredentials = false) { throw null; }
+ public virtual Azure.AI.Projects.AIProjectConnection GetDefaultConnection(Azure.AI.Projects.ConnectionType? connectionType = default(Azure.AI.Projects.ConnectionType?), bool includeCredentials = false) { throw null; }
+ public virtual System.Threading.Tasks.Task GetDefaultConnectionAsync(Azure.AI.Projects.ConnectionType? connectionType = default(Azure.AI.Projects.ConnectionType?), bool includeCredentials = false) { throw null; }
}
public partial class AIProjectCosmosDBIndex : Azure.AI.Projects.AIProjectIndex, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel
{
@@ -611,8 +611,8 @@ protected AIProjectMemoryStoresOperations() { }
public virtual System.ClientModel.ClientResult UpdateMemoryStore(string name, string description = null, System.Collections.Generic.IDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task UpdateMemoryStoreAsync(string name, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; }
public virtual System.Threading.Tasks.Task> UpdateMemoryStoreAsync(string name, string description = null, System.Collections.Generic.IDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public Azure.AI.Projects.MemoryUpdateResult WaitForMemoriesUpdate(string memoryStoreName, int pollingInterval, Azure.AI.Projects.MemoryUpdateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public System.Threading.Tasks.Task WaitForMemoriesUpdateAsync(string memoryStoreName, int pollingInterval, Azure.AI.Projects.MemoryUpdateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.AI.Projects.MemoryUpdateResult WaitForMemoriesUpdate(string memoryStoreName, int pollingInterval, Azure.AI.Projects.MemoryUpdateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task WaitForMemoriesUpdateAsync(string memoryStoreName, int pollingInterval, Azure.AI.Projects.MemoryUpdateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class AIProjectTelemetry
{
diff --git a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs
index 8b46b943ec72..0f55d4820392 100644
--- a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs
+++ b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs
@@ -340,12 +340,12 @@ protected AIProjectConnectionsOperations() { }
public System.ClientModel.Primitives.ClientPipeline Pipeline { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnection(string connectionName, bool includeCredentials, CancellationToken cancellationToken) instead.")]
- public Azure.AI.Projects.AIProjectConnection GetConnection(string connectionName, bool includeCredentials, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
- public Azure.AI.Projects.AIProjectConnection GetConnection(string connectionName, bool includeCredentials = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.AI.Projects.AIProjectConnection GetConnection(string connectionName, bool includeCredentials, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
+ public virtual Azure.AI.Projects.AIProjectConnection GetConnection(string connectionName, bool includeCredentials = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnectionAsync(string connectionName, bool includeCredentials, CancellationToken cancellationToken) instead.")]
- public System.Threading.Tasks.Task> GetConnectionAsync(string connectionName, bool includeCredentials, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
- public System.Threading.Tasks.Task> GetConnectionAsync(string connectionName, bool includeCredentials = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> GetConnectionAsync(string connectionName, bool includeCredentials, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
+ public virtual System.Threading.Tasks.Task> GetConnectionAsync(string connectionName, bool includeCredentials = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnections(ConnectionType? connectionType, bool? defaultConnection, CancellationToken cancellationToken) instead.")]
public virtual System.ClientModel.CollectionResult GetConnections(Azure.AI.Projects.ConnectionType? connectionType, bool? defaultConnection, string clientRequestId, System.Threading.CancellationToken cancellationToken) { throw null; }
@@ -362,8 +362,8 @@ protected AIProjectConnectionsOperations() { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnectionsAsync(string connectionType, bool? defaultConnection, RequestOptions options) instead.")]
public virtual System.ClientModel.Primitives.AsyncCollectionResult GetConnectionsAsync(string connectionType, bool? defaultConnection, string clientRequestId, System.ClientModel.Primitives.RequestOptions options) { throw null; }
- public Azure.AI.Projects.AIProjectConnection GetDefaultConnection(Azure.AI.Projects.ConnectionType? connectionType = default(Azure.AI.Projects.ConnectionType?), bool includeCredentials = false) { throw null; }
- public System.Threading.Tasks.Task GetDefaultConnectionAsync(Azure.AI.Projects.ConnectionType? connectionType = default(Azure.AI.Projects.ConnectionType?), bool includeCredentials = false) { throw null; }
+ public virtual Azure.AI.Projects.AIProjectConnection GetDefaultConnection(Azure.AI.Projects.ConnectionType? connectionType = default(Azure.AI.Projects.ConnectionType?), bool includeCredentials = false) { throw null; }
+ public virtual System.Threading.Tasks.Task GetDefaultConnectionAsync(Azure.AI.Projects.ConnectionType? connectionType = default(Azure.AI.Projects.ConnectionType?), bool includeCredentials = false) { throw null; }
}
public partial class AIProjectCosmosDBIndex : Azure.AI.Projects.AIProjectIndex, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel
{
@@ -611,8 +611,8 @@ protected AIProjectMemoryStoresOperations() { }
public virtual System.ClientModel.ClientResult UpdateMemoryStore(string name, string description = null, System.Collections.Generic.IDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task UpdateMemoryStoreAsync(string name, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; }
public virtual System.Threading.Tasks.Task> UpdateMemoryStoreAsync(string name, string description = null, System.Collections.Generic.IDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public Azure.AI.Projects.MemoryUpdateResult WaitForMemoriesUpdate(string memoryStoreName, int pollingInterval, Azure.AI.Projects.MemoryUpdateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public System.Threading.Tasks.Task WaitForMemoriesUpdateAsync(string memoryStoreName, int pollingInterval, Azure.AI.Projects.MemoryUpdateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.AI.Projects.MemoryUpdateResult WaitForMemoriesUpdate(string memoryStoreName, int pollingInterval, Azure.AI.Projects.MemoryUpdateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task WaitForMemoriesUpdateAsync(string memoryStoreName, int pollingInterval, Azure.AI.Projects.MemoryUpdateOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class AIProjectTelemetry
{
diff --git a/sdk/ai/Azure.AI.Projects/assets.json b/sdk/ai/Azure.AI.Projects/assets.json
index b840f986d6c5..4c29bcb29de2 100644
--- a/sdk/ai/Azure.AI.Projects/assets.json
+++ b/sdk/ai/Azure.AI.Projects/assets.json
@@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/ai/Azure.AI.Projects",
- "Tag": "net/ai/Azure.AI.Projects_b43d4fcc87"
+ "Tag": "net/ai/Azure.AI.Projects_ad41ac9a20"
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Connections/AIProjectConnectionsOperations.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Connections/AIProjectConnectionsOperations.cs
index 660f45318fde..ea89fd053551 100644
--- a/sdk/ai/Azure.AI.Projects/src/Custom/Connections/AIProjectConnectionsOperations.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Custom/Connections/AIProjectConnectionsOperations.cs
@@ -20,7 +20,7 @@ public partial class AIProjectConnectionsOperations
/// Thrown when the request fails.
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnection(string connectionName, bool includeCredentials, CancellationToken cancellationToken) instead.")]
- public AIProjectConnection GetConnection(string connectionName, bool includeCredentials, string clientRequestId, CancellationToken cancellationToken)
+ public virtual AIProjectConnection GetConnection(string connectionName, bool includeCredentials, string clientRequestId, CancellationToken cancellationToken)
{
return GetConnection(connectionName, includeCredentials, cancellationToken);
}
@@ -36,7 +36,7 @@ public AIProjectConnection GetConnection(string connectionName, bool includeCred
/// Thrown when the request fails.
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is obsolete as the clientRequestId parameter is not used. Please use GetConnectionAsync(string connectionName, bool includeCredentials, CancellationToken cancellationToken) instead.")]
- public async Task> GetConnectionAsync(string connectionName, bool includeCredentials, string clientRequestId, CancellationToken cancellationToken)
+ public async virtual Task> GetConnectionAsync(string connectionName, bool includeCredentials, string clientRequestId, CancellationToken cancellationToken)
{
return await GetConnectionAsync(connectionName, includeCredentials, cancellationToken).ConfigureAwait(false);
}
@@ -49,7 +49,7 @@ public async Task> GetConnectionAsync(string c
/// The cancellation token that can be used to cancel the operation.
/// A object.
/// Thrown when the request fails.
- public AIProjectConnection GetConnection(string connectionName, bool includeCredentials = false, CancellationToken cancellationToken = default)
+ public virtual AIProjectConnection GetConnection(string connectionName, bool includeCredentials = false, CancellationToken cancellationToken = default)
{
if (string.IsNullOrWhiteSpace(connectionName))
{
@@ -73,7 +73,7 @@ public AIProjectConnection GetConnection(string connectionName, bool includeCred
/// The cancellation token that can be used to cancel the operation.
/// A object.
/// Thrown when the request fails.
- public async Task> GetConnectionAsync(string connectionName, bool includeCredentials = false, CancellationToken cancellationToken = default)
+ public async virtual Task> GetConnectionAsync(string connectionName, bool includeCredentials = false, CancellationToken cancellationToken = default)
{
if (string.IsNullOrWhiteSpace(connectionName))
{
@@ -96,7 +96,7 @@ public async Task> GetConnectionAsync(string c
/// Whether to include credentials in the response. Default is false.
/// A object.
/// Thrown when the request fails.
- public AIProjectConnection GetDefaultConnection(ConnectionType? connectionType = null, bool includeCredentials = false)
+ public virtual AIProjectConnection GetDefaultConnection(ConnectionType? connectionType = null, bool includeCredentials = false)
{
foreach (var connection in GetConnections(connectionType))
{
@@ -115,7 +115,7 @@ public AIProjectConnection GetDefaultConnection(ConnectionType? connectionType =
/// Whether to include credentials in the response. Default is false.
/// A object.
/// Thrown when the request fails.
- public async Task GetDefaultConnectionAsync(ConnectionType? connectionType = null, bool includeCredentials = false)
+ public async virtual Task GetDefaultConnectionAsync(ConnectionType? connectionType = null, bool includeCredentials = false)
{
await foreach (var connection in GetConnectionsAsync(connectionType).ConfigureAwait(false))
{
diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/MemoryStores/AIProjectMemoryStoresOperations.cs b/sdk/ai/Azure.AI.Projects/src/Custom/MemoryStores/AIProjectMemoryStoresOperations.cs
index 5ddc12ffd4ea..e0561a23619b 100644
--- a/sdk/ai/Azure.AI.Projects/src/Custom/MemoryStores/AIProjectMemoryStoresOperations.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Custom/MemoryStores/AIProjectMemoryStoresOperations.cs
@@ -146,7 +146,7 @@ public virtual ClientResult UpdateMemories(string memoryStor
/// Wait for memories to update.
///
/// The MemoryUpdateResult in final state
- public async Task WaitForMemoriesUpdateAsync(string memoryStoreName, int pollingInterval, MemoryUpdateOptions options, CancellationToken cancellationToken = default)
+ public async virtual Task WaitForMemoriesUpdateAsync(string memoryStoreName, int pollingInterval, MemoryUpdateOptions options, CancellationToken cancellationToken = default)
{
MemoryUpdateResult updateResult = await UpdateMemoriesAsync(memoryStoreName: memoryStoreName, options: options, cancellationToken: cancellationToken).ConfigureAwait(false);
while (updateResult.Status != MemoryStoreUpdateStatus.Failed && updateResult.Status != MemoryStoreUpdateStatus.Completed)
@@ -161,7 +161,7 @@ public async Task WaitForMemoriesUpdateAsync(string memorySt
/// Wait for memories to update.
///
/// The MemoryUpdateResult in final state
- public MemoryUpdateResult WaitForMemoriesUpdate(string memoryStoreName, int pollingInterval, MemoryUpdateOptions options, CancellationToken cancellationToken = default)
+ public virtual MemoryUpdateResult WaitForMemoriesUpdate(string memoryStoreName, int pollingInterval, MemoryUpdateOptions options, CancellationToken cancellationToken = default)
{
MemoryUpdateResult updateResult = UpdateMemories(memoryStoreName: memoryStoreName, options: options, cancellationToken: cancellationToken);
while (updateResult.Status != MemoryStoreUpdateStatus.Failed && updateResult.Status != MemoryStoreUpdateStatus.Completed)
diff --git a/sdk/ai/Azure.AI.Projects/tests/Azure.AI.Projects.Tests.csproj b/sdk/ai/Azure.AI.Projects/tests/Azure.AI.Projects.Tests.csproj
index fcfabd9a2cc8..87b99ab88262 100644
--- a/sdk/ai/Azure.AI.Projects/tests/Azure.AI.Projects.Tests.csproj
+++ b/sdk/ai/Azure.AI.Projects/tests/Azure.AI.Projects.Tests.csproj
@@ -33,7 +33,7 @@
-
+
diff --git a/sdk/ai/Azure.AI.Projects/tests_agents/AIAgentsTestEnvironment.cs b/sdk/ai/Azure.AI.Projects/tests_agents/AIAgentsTestEnvironment.cs
index 810f91ec5d1c..6cddf43ead86 100644
--- a/sdk/ai/Azure.AI.Projects/tests_agents/AIAgentsTestEnvironment.cs
+++ b/sdk/ai/Azure.AI.Projects/tests_agents/AIAgentsTestEnvironment.cs
@@ -39,10 +39,11 @@ public override Task WaitForEnvironmentAsync()
public string COMPUTER_SCREENSHOTS => GetRecordedVariable("COMPUTER_SCREENSHOTS");
public string IMAGE_GENERATION_DEPLOYMENT_NAME => GetRecordedVariable("IMAGE_GENERATION_DEPLOYMENT_NAME");
public string AI_SEARCH_CONNECTION_NAME => GetRecordedVariable("AI_SEARCH_CONNECTION_NAME");
- public string BING_CONNECTION_NAME => GetRecordedVariable("BING_CONNECTION_NAME");
- public string CUSTOM_BING_CONNECTION_NAME => GetRecordedVariable("CUSTOM_BING_CONNECTION_NAME");
+ public string BING_CONNECTION_ID => GetRecordedVariable("BING_CONNECTION_ID");
+ public string CUSTOM_BING_CONNECTION_ID => GetRecordedVariable("CUSTOM_BING_CONNECTION_ID");
public string BING_CUSTOM_SEARCH_INSTANCE_NAME => GetRecordedVariable("BING_CUSTOM_SEARCH_INSTANCE_NAME");
public string MCP_PROJECT_CONNECTION_NAME => GetRecordedOptionalVariable("MCP_PROJECT_CONNECTION_NAME");
- public string OPENAPI_PROJECT_CONNECTION_NAME => GetRecordedOptionalVariable("OPENAPI_PROJECT_CONNECTION_NAME");
+ public string OPENAPI_PROJECT_CONNECTION_ID => GetRecordedOptionalVariable("OPENAPI_PROJECT_CONNECTION_ID");
+ public string SHAREPOINT_CONNECTION_ID => GetRecordedOptionalVariable("SHAREPOINT_CONNECTION_ID");
}
}
diff --git a/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTestBase.cs b/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTestBase.cs
index 3117de1197a0..fba8ac44d44c 100644
--- a/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTestBase.cs
+++ b/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTestBase.cs
@@ -21,6 +21,7 @@
using OpenAI.Responses;
using OpenAI.VectorStores;
using Azure.AI.Projects.Tests.Utils;
+using System.Reflection.Metadata.Ecma335;
namespace Azure.AI.Projects.Tests;
#pragma warning disable OPENAICUA001
@@ -81,7 +82,7 @@ public enum ToolType
"At the top of the resulting page you will see a default chart of Microsoft stock price." +
"Click on 'YTD' at the top of that chart, and report the percent value that shows up just below it."},
{ToolType.MicrosoftFabric, "What are top 3 weather events with largest revenue loss?"},
- {ToolType.Sharepoint, "Hello, summarize the key points of the first document in the list."},
+ {ToolType.Sharepoint, "What is Contoso whistleblower policy?"},
{ToolType.CodeInterpreter, "Can you give me the documented codes for 'banana' and 'orange'?"},
{ToolType.MCP, "Please summarize the Azure REST API specifications Readme"},
{ToolType.MCPConnection, "How many follower on github do I have?"},
@@ -130,6 +131,7 @@ public enum ToolType
{ToolType.AzureAISearch, "product_info_7.md"},
{ToolType.BingGrounding, "Wikipedia"},
{ToolType.BingGroundingCustom, "Wikipedia"},
+ {ToolType.Sharepoint, "sharepoint"}
};
public Dictionary ExpectedUpdateTypes = new()
@@ -155,7 +157,8 @@ public enum ToolType
{ToolType.ImageGeneration, "image_generation_call"},
{ToolType.CodeInterpreter, "code_interpreter_call"},
{ToolType.OpenAPI, "openapi_call"},
- {ToolType.OpenAPIConnection, "openapi_call"}
+ {ToolType.OpenAPIConnection, "openapi_call"},
+ {ToolType.Sharepoint, "sharepoint_grounding_preview_call"},
};
#endregion
@@ -377,15 +380,14 @@ private McpTool GetProjectConnectedMCPTool()
return tool;
}
- private async Task GetOpenAPITool(AIProjectClient projectClient, bool withConnection)
+ private OpenAPIAgentTool GetOpenAPITool(AIProjectClient projectClient, bool withConnection)
{
OpenAPIAuthenticationDetails auth;
string filePath;
if (withConnection)
{
- AIProjectConnection tripadvisorConnection = await projectClient.Connections.GetConnectionAsync("tripadvisor");
auth = new OpenAPIProjectConnectionAuthenticationDetails(new OpenAPIProjectConnectionSecurityScheme(
- projectConnectionId: tripadvisorConnection.Id
+ projectConnectionId: TestEnvironment.OPENAPI_PROJECT_CONNECTION_ID
));
filePath = GetTestFile(fileName: "tripadvisor_openapi.json");
}
@@ -403,6 +405,15 @@ private async Task GetOpenAPITool(AIProjectClient projectClien
return new(functionDefinition);
}
+ private SharepointAgentTool GetSharepointTool(AIProjectClient projectClient)
+ {
+ SharePointGroundingToolOptions sharepointToolOption = new()
+ {
+ ProjectConnections = { new ToolProjectConnection(projectConnectionId: TestEnvironment.SHAREPOINT_CONNECTION_ID) }
+ };
+ return new SharepointAgentTool(sharepointToolOption);
+ }
+
///
/// Get the AgentDefinition, containing tool of a certain type.
///
@@ -461,10 +472,10 @@ protected async Task GetAgentToolDefinition(ToolType toolType,
ToolType.Memory => new MemorySearchTool(memoryStoreName: (await CreateMemoryStore(projectClient)).Name, scope: MEMORY_STORE_SCOPE),
ToolType.AzureAISearch => new AzureAISearchAgentTool(new AzureAISearchToolOptions(indexes: [GetAISearchIndex()])),
ToolType.BingGrounding => new BingGroundingAgentTool(new BingGroundingSearchToolOptions(
- searchConfigurations: [new BingGroundingSearchConfiguration(projectConnectionId: projectClient.Connections.GetConnection(connectionName: TestEnvironment.BING_CONNECTION_NAME).Id)]
+ searchConfigurations: [new BingGroundingSearchConfiguration(projectConnectionId: TestEnvironment.BING_CONNECTION_ID)]
)),
ToolType.BingGroundingCustom => new BingCustomSearchAgentTool(new BingCustomSearchToolParameters(
- searchConfigurations: [new BingCustomSearchConfiguration(projectConnectionId: projectClient.Connections.GetConnection(connectionName: TestEnvironment.CUSTOM_BING_CONNECTION_NAME).Id, instanceName: TestEnvironment.BING_CUSTOM_SEARCH_INSTANCE_NAME)]
+ searchConfigurations: [new BingCustomSearchConfiguration(projectConnectionId: TestEnvironment.CUSTOM_BING_CONNECTION_ID, instanceName: TestEnvironment.BING_CUSTOM_SEARCH_INSTANCE_NAME)]
)),
ToolType.MCP => ResponseTool.CreateMcpTool(
serverLabel: "api-specs",
@@ -472,8 +483,9 @@ protected async Task GetAgentToolDefinition(ToolType toolType,
toolCallApprovalPolicy: new McpToolCallApprovalPolicy(GlobalMcpToolCallApprovalPolicy.AlwaysRequireApproval
)),
ToolType.MCPConnection => GetProjectConnectedMCPTool(),
- ToolType.OpenAPI => await GetOpenAPITool(projectClient, false),
- ToolType.OpenAPIConnection => await GetOpenAPITool(projectClient, true),
+ ToolType.OpenAPI => GetOpenAPITool(projectClient, false),
+ ToolType.OpenAPIConnection => GetOpenAPITool(projectClient, true),
+ ToolType.Sharepoint => GetSharepointTool(projectClient),
_ => throw new InvalidOperationException($"Unknown tool type {toolType}")
};
return new PromptAgentDefinition(model ?? TestEnvironment.MODELDEPLOYMENTNAME)
diff --git a/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTests.cs b/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTests.cs
index 8a7cb98a4bf8..07a5ad362d2b 100644
--- a/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTests.cs
+++ b/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTests.cs
@@ -603,6 +603,7 @@ public async Task TestMemorySearch()
[TestCase(ToolType.BingGroundingCustom)]
[TestCase(ToolType.OpenAPI)]
[TestCase(ToolType.OpenAPIConnection)]
+ [TestCase(ToolType.Sharepoint)]
public async Task TestTool(ToolType toolType)
{
Dictionary headers = [];
@@ -658,7 +659,7 @@ public async Task TestTool(ToolType toolType)
Assert.That(Regex.Match(response.GetOutputText().ToLower(), expectedResponse.ToLower()).Success, Is.True, $"The output: \"{response.GetOutputText()}\" does not contain {expectedResponse}");
}
}
- if (toolType == ToolType.AzureAISearch | toolType == ToolType.BingGrounding | toolType == ToolType.BingGroundingCustom)
+ if (toolType == ToolType.AzureAISearch | toolType == ToolType.BingGrounding | toolType == ToolType.BingGroundingCustom | toolType == ToolType.Sharepoint)
{
bool isUriCitationFound = false;
// Check Annotation for Azure AI Search tool.
@@ -679,6 +680,7 @@ public async Task TestTool(ToolType toolType)
[TestCase(ToolType.BingGroundingCustom)]
[TestCase(ToolType.OpenAPI)]
[TestCase(ToolType.OpenAPIConnection)]
+ [TestCase(ToolType.Sharepoint)]
public async Task TestToolStreaming(ToolType toolType)
{
AIProjectClient projectClient = GetTestProjectClient();
@@ -725,7 +727,7 @@ public async Task TestToolStreaming(ToolType toolType)
}
}
}
- if (toolType == ToolType.AzureAISearch | toolType == ToolType.BingGrounding | toolType == ToolType.BingGroundingCustom)
+ if (toolType == ToolType.AzureAISearch | toolType == ToolType.BingGrounding | toolType == ToolType.BingGroundingCustom | toolType == ToolType.Sharepoint)
{
annotationMet = ContainsAnnotation(itemDoneUpdate.Item, toolType);
}