File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
docs/ai/quickstarts/snippets/chat-with-data/azure-openai Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,15 @@ namespace VectorDataAI;
4
4
5
5
internal class CloudService
6
6
{
7
- [ VectorStoreRecordKey ]
7
+ [ VectorStoreKey ]
8
8
public int Key { get ; set ; }
9
9
10
- [ VectorStoreRecordData ]
10
+ [ VectorStoreData ]
11
11
public string Name { get ; set ; }
12
12
13
- [ VectorStoreRecordData ]
13
+ [ VectorStoreData ]
14
14
public string Description { get ; set ; }
15
15
16
- [ VectorStoreRecordVector ( Dimensions : 384 , DistanceFunction = DistanceFunction . CosineSimilarity ) ]
16
+ [ VectorStoreVector ( Dimensions : 384 , DistanceFunction = DistanceFunction . CosineSimilarity ) ]
17
17
public ReadOnlyMemory < float > Vector { get ; set ; }
18
18
}
Original file line number Diff line number Diff line change 58
58
// <SnippetVectorStore>
59
59
// Create and populate the vector store
60
60
var vectorStore = new InMemoryVectorStore ( ) ;
61
- IVectorStoreRecordCollection < int , CloudService > cloudServicesStore =
61
+ VectorStoreCollection < int , CloudService > cloudServicesStore =
62
62
vectorStore . GetCollection < int , CloudService > ( "cloudServices" ) ;
63
- await cloudServicesStore . CreateCollectionIfNotExistsAsync ( ) ;
63
+ await cloudServicesStore . EnsureCollectionExistsAsync ( ) ;
64
64
65
65
foreach ( CloudService service in cloudServices )
66
66
{
75
75
ReadOnlyMemory < float > queryEmbedding = await generator . GenerateVectorAsync ( query ) ;
76
76
77
77
List < VectorSearchResult < CloudService > > results =
78
- await cloudServicesStore . SearchEmbeddingAsync ( queryEmbedding , top : 1 ) . ToListAsync ( ) ;
78
+ await cloudServicesStore . SearchAsync ( queryEmbedding , top : 1 ) . ToListAsync ( ) ;
79
79
80
80
foreach ( VectorSearchResult < CloudService > result in results )
81
81
{
Original file line number Diff line number Diff line change 11
11
<ItemGroup >
12
12
<PackageReference Include =" Azure.Identity" Version =" 1.14.0" />
13
13
<PackageReference Include =" Azure.AI.OpenAI" Version =" 2.1.0" />
14
- <PackageReference Include =" Microsoft.Extensions.AI.OpenAI" Version =" 9.4.3 -preview.1.25230 .7" />
15
- <PackageReference Include =" Microsoft.Extensions.VectorData.Abstractions" Version =" 9.0.0-preview.1.25229.1 " />
16
- <PackageReference Include =" Microsoft.SemanticKernel.Connectors.InMemory" Version =" 1.48.0 -preview" />
14
+ <PackageReference Include =" Microsoft.Extensions.AI.OpenAI" Version =" 9.5.0 -preview.1.25265 .7" />
15
+ <PackageReference Include =" Microsoft.Extensions.VectorData.Abstractions" Version =" 9.5.0 " />
16
+ <PackageReference Include =" Microsoft.SemanticKernel.Connectors.InMemory" Version =" 1.53.1 -preview" />
17
17
<PackageReference Include =" Microsoft.Extensions.Configuration" Version =" 10.0.0-preview.4.25258.110" />
18
18
<PackageReference Include =" Microsoft.Extensions.Configuration.UserSecrets" Version =" 10.0.0-preview.4.25258.110" />
19
19
<PackageReference Include =" System.Linq.AsyncEnumerable" Version =" 10.0.0-preview.4.25258.110" />
You can’t perform that action at this time.
0 commit comments