@@ -104,7 +104,7 @@ PersistentAgentThread thread = await client.Threads.CreateThreadAsync();
104
104
105
105
With a thread created, messages can be created on it:
106
106
``` C# Snippet:AgentsOverviewCreateMessage
107
- ThreadMessage message = await client .Messages .CreateMessageAsync (
107
+ PersistentThreadMessage message = await client .Messages .CreateMessageAsync (
108
108
thread .Id ,
109
109
MessageRole .User ,
110
110
" I need to solve the equation `3x + 11 = 14`. Can you help me?" );
@@ -140,11 +140,11 @@ Assert.AreEqual(
140
140
Assuming the run successfully completed, listing messages from the thread that was run will now reflect new information
141
141
added by the agent:
142
142
``` C# Snippet:AgentsOverviewListUpdatedMessages
143
- AsyncPageable < ThreadMessage > messages
143
+ AsyncPageable < PersistentThreadMessage > messages
144
144
= client .Messages .GetMessagesAsync (
145
145
threadId : thread .Id , order : ListSortOrder .Ascending );
146
146
147
- await foreach (ThreadMessage threadMessage in messages )
147
+ await foreach (PersistentThreadMessage threadMessage in messages )
148
148
{
149
149
Console .Write ($" {threadMessage .CreatedAt : yyyy - MM - dd HH : mm : ss } - {threadMessage .Role ,10 }: " );
150
150
foreach (MessageContent contentItem in threadMessage .ContentItems )
@@ -190,7 +190,7 @@ Once uploaded, the file ID can then be provided to create a vector store for it
190
190
``` C# Snippet:AgentsCreateVectorStore
191
191
// Create a vector store with the file and wait for it to be processed.
192
192
// If you do not specify a vector store, create_message will create a vector store with a default expiration policy of seven days after they were last active
193
- VectorStore vectorStore = await client .VectorStores .CreateVectorStoreAsync (
193
+ PersistentAgentsVectorStore vectorStore = await client .VectorStores .CreateVectorStoreAsync (
194
194
fileIds : new List <string > { uploadedAgentFile .Id },
195
195
name : " my_vector_store" );
196
196
```
@@ -221,7 +221,7 @@ var ds = new VectorStoreDataSource(
221
221
assetIdentifier : blobURI ,
222
222
assetType : VectorStoreDataSourceAssetType .UriAsset
223
223
);
224
- VectorStore vectorStore = await client .VectorStores .CreateVectorStoreAsync (
224
+ PersistentAgentsVectorStore vectorStore = await client .VectorStores .CreateVectorStoreAsync (
225
225
name : " sample_vector_store" ,
226
226
storeConfiguration : new VectorStoreConfiguration (
227
227
dataSources : [ ds ]
@@ -247,7 +247,7 @@ var ds = new VectorStoreDataSource(
247
247
assetIdentifier : blobURI ,
248
248
assetType : VectorStoreDataSourceAssetType .UriAsset
249
249
);
250
- VectorStore vectorStore = await client .VectorStores .CreateVectorStoreAsync (
250
+ PersistentAgentsVectorStore vectorStore = await client .VectorStores .CreateVectorStoreAsync (
251
251
name : " sample_vector_store"
252
252
);
253
253
@@ -290,7 +290,7 @@ var attachment = new MessageAttachment(
290
290
291
291
PersistentAgentThread thread = await client .Threads .CreateThreadAsync ();
292
292
293
- ThreadMessage message = await client .Messages .CreateMessageAsync (
293
+ PersistentThreadMessage message = await client .Messages .CreateMessageAsync (
294
294
threadId : thread .Id ,
295
295
role : MessageRole .User ,
296
296
content : " Can you give me the documented codes for 'banana' and 'orange'?" ,
@@ -369,12 +369,12 @@ the reference placeholder by the actual reference and url. Please note, that to
369
369
get sensible result, the index needs to have fields "title" and "url".
370
370
371
371
``` C# Snippet:AgentsPopulateReferencesAgentWithAzureAISearchTool
372
- AsyncPageable < ThreadMessage > messages = client .Messages .GetMessagesAsync (
372
+ AsyncPageable < PersistentThreadMessage > messages = client .Messages .GetMessagesAsync (
373
373
threadId : thread .Id ,
374
374
order : ListSortOrder .Ascending
375
375
);
376
376
377
- await foreach (ThreadMessage threadMessage in messages )
377
+ await foreach (PersistentThreadMessage threadMessage in messages )
378
378
{
379
379
Console .Write ($" {threadMessage .CreatedAt : yyyy - MM - dd HH : mm : ss } - {threadMessage .Role ,10 }: " );
380
380
foreach (MessageContent contentItem in threadMessage .ContentItems )
@@ -387,11 +387,11 @@ await foreach (ThreadMessage threadMessage in messages)
387
387
string annotatedText = textItem .Text ;
388
388
foreach (MessageTextAnnotation annotation in textItem .Annotations )
389
389
{
390
- if (annotation is MessageTextUrlCitationAnnotation urlAnnotation )
390
+ if (annotation is MessageTextUriCitationAnnotation uriAnnotation )
391
391
{
392
392
annotatedText = annotatedText .Replace (
393
- urlAnnotation .Text ,
394
- $" [see {urlAnnotation . UrlCitation .Title }] ({urlAnnotation . UrlCitation . Url })" );
393
+ uriAnnotation .Text ,
394
+ $" [see {uriAnnotation . UriCitation .Title }] ({uriAnnotation . UriCitation . Uri })" );
395
395
}
396
396
}
397
397
Console .Write (annotatedText );
@@ -701,7 +701,7 @@ After we have created a message with request to ask "What would foo say?", we ne
701
701
```C # Snippet :AgentsAzureFunctionsHandlePollingWithRequiredAction
702
702
PersistentAgentThread thread = await client .Threads .CreateThreadAsync ();
703
703
704
- ThreadMessage message = await client .Messages .CreateMessageAsync (
704
+ PersistentThreadMessage message = await client .Messages .CreateMessageAsync (
705
705
thread .Id ,
706
706
MessageRole .User ,
707
707
" What is the most prevalent element in the universe? What would foo say?" );
@@ -849,7 +849,7 @@ PersistentAgent agent = await client.Administration.CreateAgentAsync(
849
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.
850
850
``` C# Snippet:AgentsOpenAPIHandlePollingWithRequiredAction
851
851
PersistentAgentThread thread = await client .Threads .CreateThreadAsync ();
852
- ThreadMessage message = await client .Messages .CreateMessageAsync (
852
+ PersistentThreadMessage message = await client .Messages .CreateMessageAsync (
853
853
thread .Id ,
854
854
MessageRole .User ,
855
855
" What's the weather in Seattle?" );
0 commit comments