diff --git a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingRawVectorQuery.md b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingRawVectorQuery.md index ae806d897333f..2782499061deb 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingRawVectorQuery.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingRawVectorQuery.md @@ -87,10 +87,10 @@ AzureKeyCredential credential = new AzureKeyCredential(key); OpenAIClient openAIClient = new OpenAIClient(endpoint, credential); string description = "Very popular hotel in town."; -EmbeddingsOptions embeddingsOptions = new(description); +EmbeddingsOptions embeddingsOptions = new("EmbeddingsModelName", new string[] { description }); -Embeddings embeddings = await openAIClient.GetEmbeddingsAsync("EmbeddingsModelName", embeddingsOptions); -IReadOnlyList descriptionVector = embeddings.Data[0].Embedding; +Embeddings embeddings = await openAIClient.GetEmbeddingsAsync(embeddingsOptions); +ReadOnlyMemory descriptionVector = embeddings.Data[0].Embedding; ``` In the sample code below, we are using hardcoded embeddings for the vector fields named `DescriptionVector` and `CategoryVector`: diff --git a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md index fe4a427345edd..01571c482dd12 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingSemanticHybridQuery.md @@ -105,10 +105,10 @@ AzureKeyCredential credential = new AzureKeyCredential(key); OpenAIClient openAIClient = new OpenAIClient(endpoint, credential); string description = "Very popular hotel in town."; -EmbeddingsOptions embeddingsOptions = new(description); +EmbeddingsOptions embeddingsOptions = new("EmbeddingsModelName", new string[] { description }); -Embeddings embeddings = await openAIClient.GetEmbeddingsAsync("EmbeddingsModelName", embeddingsOptions); -IReadOnlyList descriptionVector = embeddings.Data[0].Embedding; +Embeddings embeddings = await openAIClient.GetEmbeddingsAsync(embeddingsOptions); +ReadOnlyMemory descriptionVector = embeddings.Data[0].Embedding; ``` In the sample code below, we are using hardcoded embeddings for the vector fields named `DescriptionVector` and `CategoryVector`: diff --git a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizableTextQuery.md b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizableTextQuery.md index cb6fea295d425..b8fd230caf209 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizableTextQuery.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch_UsingVectorizableTextQuery.md @@ -103,10 +103,10 @@ AzureKeyCredential credential = new AzureKeyCredential(key); OpenAIClient openAIClient = new OpenAIClient(endpoint, credential); string description = "Very popular hotel in town."; -EmbeddingsOptions embeddingsOptions = new(description); +EmbeddingsOptions embeddingsOptions = new("EmbeddingsModelName", new string[] { description }); -Embeddings embeddings = await openAIClient.GetEmbeddingsAsync("EmbeddingsModelName", embeddingsOptions); -IReadOnlyList descriptionVector = embeddings.Data[0].Embedding; +Embeddings embeddings = await openAIClient.GetEmbeddingsAsync(embeddingsOptions); +ReadOnlyMemory descriptionVector = embeddings.Data[0].Embedding; ``` In the sample code below, we are using hardcoded embeddings for the vector fields named `DescriptionVector` and `CategoryVector`: diff --git a/sdk/search/Azure.Search.Documents/tests/Azure.Search.Documents.Tests.csproj b/sdk/search/Azure.Search.Documents/tests/Azure.Search.Documents.Tests.csproj index b23eadc793180..273e7a624fbd3 100644 --- a/sdk/search/Azure.Search.Documents/tests/Azure.Search.Documents.Tests.csproj +++ b/sdk/search/Azure.Search.Documents/tests/Azure.Search.Documents.Tests.csproj @@ -27,7 +27,7 @@ - + diff --git a/sdk/search/Azure.Search.Documents/tests/Samples/Readme.cs b/sdk/search/Azure.Search.Documents/tests/Samples/Readme.cs index d9a1323659b90..fda5e53c1c27d 100644 --- a/sdk/search/Azure.Search.Documents/tests/Samples/Readme.cs +++ b/sdk/search/Azure.Search.Documents/tests/Samples/Readme.cs @@ -215,10 +215,10 @@ public async Task GetEmbeddings() OpenAIClient openAIClient = new OpenAIClient(endpoint, credential); string description = "Very popular hotel in town."; - EmbeddingsOptions embeddingsOptions = new(description); + EmbeddingsOptions embeddingsOptions = new("EmbeddingsModelName", new string[] { description }); - Embeddings embeddings = await openAIClient.GetEmbeddingsAsync("EmbeddingsModelName", embeddingsOptions); - IReadOnlyList descriptionVector = embeddings.Data[0].Embedding; + Embeddings embeddings = await openAIClient.GetEmbeddingsAsync(embeddingsOptions); + ReadOnlyMemory descriptionVector = embeddings.Data[0].Embedding; #endregion }