Skip to content

Commit 3744e9c

Browse files
authored
Fix readme files (Azure#49897)
1 parent 79d149f commit 3744e9c

24 files changed

+128
-119
lines changed
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Release History
22

3-
## 1.0.0-beta.1 (Unreleased)
3+
## 1.0.0-beta.1 (2025-05-09)
44

55
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
6+
- Initial release

sdk/ai/Azure.AI.Agents.Persistent/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Agents in the Azure AI Agents client library are designed to facilitate various
7777

7878
#### Create an Agent
7979

80-
First, you need to create an `AgentsClient`
80+
First, you need to create an `PersistentAgentsClient`
8181
```C# Snippet:AgentsOverviewCreateAgentClient
8282
var projectEndpoint = System.Environment.GetEnvironmentVariable("PROJECT_ENDPOINT");
8383
var modelDeploymentName = System.Environment.GetEnvironmentVariable("MODEL_DEPLOYMENT_NAME");
@@ -317,7 +317,7 @@ var attachment = new MessageAttachment(
317317
To enable your Agent to perform search through Bing search API, you use `BingGroundingTool` along with a connection.
318318

319319
Here is an example:
320-
```C# Snippet:AgentsBingGroundingAsync_GetConnection
320+
```C# Snippet:AgentsBingGrounding_GetConnection
321321
BingGroundingSearchConfigurationList configurationList = new(
322322
[new BingGroundingSearchConfiguration(connectionId)]
323323
);
@@ -587,7 +587,7 @@ ToolOutput GetResolvedToolOutput(string functionName, string toolCallId, string
587587
return null;
588588
}
589589
```
590-
We create a stream and wait for the stream update of the `RequiredActionUpdate` type. This update will mark the point, when we need to submit tool outputs to the stream. We will submit outputs in the inner cycle. Please note that `RequiredActionUpdate` keeps only one required action, while our run may require multiple function calls, this case is handled in the inner cycle, so that we can add tool output to the existing array of outputs. After all required actions were submitted we clean up the array of required actions.
590+
We create a stream and wait for the stream update of the `RequiredActionUpdate` type. This update will mark the point, when we need to submit tool outputs to the stream. We will submit outputs to the new stream. Please note that `RequiredActionUpdate` keeps only one required action, while our run may require multiple function calls. After all required actions were submitted we clean up the array of required actions.
591591

592592
```C# Snippet:AgentsFunctionsWithStreamingUpdateCycle
593593
List<ToolOutput> toolOutputs = [];
@@ -776,7 +776,7 @@ namespace FunctionProj
776776

777777
In this code we define function input and output class: `Arguments` and `Response` respectively. These two data classes will be serialized in JSON. It is important that these both contain field `CorrelationId`, which is the same between input and output.
778778

779-
In our example the function will be stored in the storage account, created with the AI hub. For that we need to allow key access to that storage. In Azure portal go to Storage account > Settings > Configuration and set "Allow storage account key access" to Enabled. If it is not done, the error will be displayed "The remote server returned an error: (403) Forbidden." To create the function resource that will host our function, install azure-cli python package and run the next command:
779+
In our example the function will be stored in the storage account, created with the AI hub. For that we need to allow key access to that storage. In Azure portal go to Storage account > Settings > Configuration and set "Allow storage account key access" to Enabled. If it is not done, the error will be displayed "The remote server returned an error: (403) Forbidden." To create the function resource that will host our function, install [azure-cli](https://pypi.org/project/azure-cli/) python package and run the next command:
780780

781781
```shell
782782
pip install -U azure-cli
@@ -811,16 +811,16 @@ In the `storage_account_already_present_in_resource_group` select the `Queue ser
811811
}
812812
```
813813

814-
Next, we will monitor the output queue or the message. You should receive the next message.
814+
After the processing, the output queue should contain the message with the following contents:
815815
```json
816816
{
817817
"Value": "Bar",
818818
"CorrelationId": "42"
819819
}
820820
```
821-
Please note that the input `CorrelationId` is the same as output.
822-
*Hint:* Place multiple messages to input queue and keep second internet browser window with the output queue open and hit the refresh button on the portal user interface, so that you will not miss the message. If the message instead went to `azure-function-foo-input-poison` queue, the function completed with error, please check your setup.
823-
After we have tested the function and made sure it works, please make sure that the Azure AI Project have the next roles for the storage account: `Storage Account Contributor`, `Storage Blob Data Contributor`, `Storage File Data Privileged Contributor`, `Storage Queue Data Contributor` and `Storage Table Data Contributor`. Now the function is ready to be used by the agent.
821+
Please note that the in input `CorrelationId` value is the same as in the output.
822+
*Hint:* Place multiple messages to input queue and keep second internet browser window with the output queue open, hit the refresh button on the portal user interface, so that you will not miss the message. If the function completed with error the message instead gets into the `azure-function-foo-input-poison` queue. If that happened, please check your setup.
823+
After we have tested the function and confirmed that it works, please make sure that the Azure AI Project have the next roles for the storage account: `Storage Account Contributor`, `Storage Blob Data Contributor`, `Storage File Data Privileged Contributor`, `Storage Queue Data Contributor` and `Storage Table Data Contributor`. Now the function is ready to be used by the agent.
824824

825825

826826
#### Create Agent With OpenAPI
@@ -846,7 +846,7 @@ PersistentAgent agent = await client.Administration.CreateAgentAsync(
846846
);
847847
```
848848

849-
In this example we are using the `weather_openapi.json` file and agent will request the wttr.in website for the weather in a location fron the prompt.
849+
In this example we are using the `weather_openapi.json` file and agent will request the [wttr.in](https://wttr.in) website for the weather in a location from the prompt.
850850
```C# Snippet:AgentsOpenAPIHandlePollingWithRequiredAction
851851
PersistentAgentThread thread = await client.Threads.CreateThreadAsync();
852852
ThreadMessage message = await client.Messages.CreateMessageAsync(
@@ -893,7 +893,7 @@ To further diagnose and troubleshoot issues, you can enable logging following th
893893

894894
## Next steps
895895

896-
Beyond the introductory scenarios discussed, the AI Projects client library offers support for additional scenarios to help take advantage of the full feature set of the AI services. In order to help explore some of these scenarios, the AI Projects client library offers a set of samples to serve as an illustration for common scenarios. Please see the [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Projects/samples) for details.
896+
Beyond the introductory scenarios discussed, the AI Agents client library offers support for additional scenarios to help take advantage of the full feature set of the AI services. In order to help explore some of these scenarios, the AI Agents client library offers a set of samples to serve as an illustration for common scenarios. Please see the [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Agents.Persistent/samples) for details.
897897

898898
## Contributing
899899

@@ -907,10 +907,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
907907

908908
<!-- LINKS -->
909909
[RequestFailedException]: https://learn.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet
910-
[samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Projects/tests/Samples
910+
[samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Agents.Persistent/tests/Samples
911911
[api_ref_docs]: https://learn.microsoft.com/dotnet/api/azure.ai.projects?view=azure-dotnet-preview
912912
[nuget]: https://www.nuget.org/packages/Azure.AI.Projects
913-
[source_code]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Projects
913+
[source_code]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Agents.Persistent
914914
[product_doc]: https://learn.microsoft.com/azure/ai-studio/
915915
[azure_identity]: https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet
916916
[azure_identity_dac]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- csharp
5+
products:
6+
# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product
7+
- azure
8+
name: Azure.AI.Agents.Persistent samples for .NET
9+
description: Samples for the Azure.AI.Agents.Persistent client library.
10+
---
11+
12+
# Azure.AI.Projects Samples for Agents
13+
14+
| Sample | Description |
15+
| ------ | ----------- |
16+
| [Sample1_PersistentAgents_Additional_messages](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample1_PersistentAgents_Additional_messages.md) | Sample for using additional messages while creating agent run. |
17+
| [Sample2_PersistentAgents_Azure_Functions](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample2_PersistentAgents_Azure_Functions.md) | Sample for using Azure Functions with agents. |
18+
| [Sample3_PersistentAgents_Basics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample3_PersistentAgents_Basics.md) | Sample for basic use of an agent. |
19+
| [Sample4_PersistentAgents_Bing_Grounding](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample4_PersistentAgents_Bing_Grounding.md) | Sample for use of an agent with Bing grounding. |
20+
| [Sample5_PersistentAgents_Enterprise_File_Search](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample5_PersistentAgents_Enterprise_File_Search.md) | Sample enterprise file search with agent. |
21+
| [Sample6_PersistentAgents_FileSearch](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample6_PersistentAgents_FileSearch.md) | Sample file search with agent. |
22+
| [Sample7_PersistentAgents_Functions](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample7_PersistentAgents_Functions.md) | Sample using agents with functions. |
23+
| [Sample8_PersistentAgents_FunctionsWithStreaming](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample8_PersistentAgents_FunctionsWithStreaming.md) | Sample using agents with functions and streaming. |
24+
| [Sample9_PersistentAgents_Streaming](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample9_PersistentAgents_Streaming.md) | Sample using agents with streaming. |
25+
| [Sample10_PersistentAgents_Vector_Store_Batch_File_Search](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample10_PersistentAgents_Vector_Store_Batch_File_Search.md) | Sample for batch file search. |
26+
| [Sample11_PersistentAgents_Code_Interpreter_Enterprise_File_Search](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample11_PersistentAgents_Code_Interpreter_Enterprise_File_Search.md) | Sample enterprise file search on agent with message attachment and code interpreter. |
27+
| [Sample12_PersistentAgents_Code_Interpreter_File_Attachment](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample12_PersistentAgents_Code_Interpreter_File_Attachment.md) | Sample file search on agent with message attachment and code interpreter. |
28+
| [Sample13_PersistentAgents_OpenAPI](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample13_PersistentAgents_OpenAPI.md) | Sample using agents with OpenAPI tool. |
29+
| [Sample14_PersistentAgents_Azure_AI_Search](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample14_PersistentAgents_Azure_AI_Search.md) | Sample using agents with Azure AI Search tool. |
30+
| [Sample15_PersistentAgents_Vector_Store_Batch_Enterprise_File_Search](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample15_PersistentAgents_Vector_Store_Batch_Enterprise_File_Search.md) | Sample for enterprise batch file search. |
31+
| [Sample16_PersistentAgents_Azure_AI_Search_Streaming](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample16_PersistentAgents_Azure_AI_Search_Streaming.md) | Sample using agents with Azure AI Search tool with streaming. |
32+
| [Sample17_PersistentAgents_ImageUrlInputs](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample17_PersistentAgents_ImageUrlInputs.md) | Sample using agents with Image URL as an input. |
33+
| [Sample18_PersistentAgents_ImageFileInputs](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample18_PersistentAgents_ImageFileInputs.md) | Sample using agents with Image Fileas an input. |
34+

sdk/ai/Azure.AI.Agents.Persistent/samples/README.md__

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

sdk/ai/Azure.AI.Agents.Persistent/samples/Sample10_PersistentAgents_Vector_Store_Batch_File_Search.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sample for Azure.AI.Agents and batch file search.
1+
# Sample for Azure.AI.Agents.Persistent and batch file search.
22

33
1. To perform batch file search by an agent, we first need to upload a file, create a vector store, and associate the file to the vector store. Here is an example:
44

@@ -141,7 +141,7 @@ List<ThreadMessage> messages = await client.Messages.GetMessagesAsync(
141141
WriteMessages(messages, dtReferences);
142142
```
143143

144-
3. After the run complete, we will use `WriteMessages` method to swap reference placeholders by the actual file names.
144+
3. After the run complete, we will use `WriteMessages` method to swap reference placeholders by the actual file names or IDs.
145145
```C# Snippet:AgentsVectorStoreBatchFileSearchParseResults
146146
private static void WriteMessages(IEnumerable<ThreadMessage> messages, Dictionary<string, string> fileIds)
147147
{
@@ -191,7 +191,7 @@ private static string replaceReferences(Dictionary<string, string> fileIds, stri
191191
}
192192
```
193193

194-
4. When the experiment is complete, we will clean up the resources.
194+
4. Finally we will clean up the resources.
195195

196196
Synchronous sample:
197197
```C# Snippet:AgentsVectorStoreBatchFileSearchCleanup
@@ -219,4 +219,4 @@ else
219219
Console.WriteLine($"Unable to delete vector store {vectorStore.Id}");
220220
}
221221
await client.Administration.DeleteAgentAsync(agent.Id);
222-
```
222+
```

sdk/ai/Azure.AI.Agents.Persistent/samples/Sample11_PersistentAgents_Code_Interpreter_Enterprise_File_Search.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sample enterprise file search on agent with message attachment and code interpreter in Azure.AI.Agents.
1+
# Sample enterprise file search on agent with message attachment and code interpreter in Azure.AI.Agents.Persistent.
22

33
In this example we demonstrate, how the Azure Blob can be utilized for enterprize file search with `MessageAttachment`.
44

@@ -46,7 +46,7 @@ var attachment = new MessageAttachment(
4646
);
4747
```
4848

49-
4. Create a `ThreadMessage`, which contains the `VectorStoreDataSource` as an attachment.
49+
4. Create a message, which contains the `VectorStoreDataSource` as an attachment.
5050

5151
Synchronous sample:
5252
```C# Snippet:AgentsCodeInterpreterEnterpriseSearch_CreateThreadRun
@@ -206,7 +206,7 @@ WriteMessages(messages);
206206
```
207207

208208

209-
8. Finally, we delete all the resources, we have created in this sample.
209+
8. Finally, delete all the resources, we have created in this sample.
210210

211211
Synchronous sample:
212212
```C# Snippet:AgentsCodeInterpreterEnterpriseSearch_Cleanup

sdk/ai/Azure.AI.Agents.Persistent/samples/Sample12_PersistentAgents_Code_Interpreter_File_Attachment.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sample file search on agent with message attachment and code interpreter in Azure.AI.Agents.
1+
# Sample file search on agent with message attachment and code interpreter in Azure.AI.Agents.Persistent.
22

33
In this example we demonstrate, how to use file search with `MessageAttachment`.
44

@@ -9,7 +9,7 @@ var modelDeploymentName = System.Environment.GetEnvironmentVariable("MODEL_DEPLO
99
PersistentAgentsClient client = new(projectEndpoint, new DefaultAzureCredential());
1010
```
1111

12-
2. We need to create an agent, create and upload file and `ThreadMessage` with the uploaded file ID in the `MessageAttachment`.
12+
2. We need to create an agent, create and upload file and message with the uploaded file ID in the `MessageAttachment`.
1313

1414
Synchronous sample:
1515
```C# Snippet:AgentsCreateAgentWithInterpreterToolSync
@@ -77,7 +77,7 @@ ThreadMessage message = await client.Messages.CreateMessageAsync(
7777
);
7878
```
7979

80-
3. Next we will create a `ThreadRun` and wait until the run is completed. If the run was not successful we will print the last error message.
80+
3. Next we will create a run and wait until the run is completed. If the run was not successful we will print the last error message.
8181

8282
Synchronous sample:
8383
```C# Snippet:AgentsCodeInterpreterFileAttachmentSync_CreateRun
@@ -162,7 +162,7 @@ List<ThreadMessage> messages = await client.Messages.GetMessagesAsync(
162162
WriteMessages(messages);
163163
```
164164

165-
6. Finally, we delete all the resources, we have created in this sample.
165+
6. Finally, delete all the resources, we have created in this sample.
166166

167167
Synchronous sample:
168168
```C# Snippet:AgentsCodeInterpreterFileAttachmentSync_Cleanup

0 commit comments

Comments
 (0)