diff --git a/OpenAI_API/Embedding/EmbeddingResult.cs b/OpenAI_API/Embedding/EmbeddingResult.cs index 2801ef2..611b172 100644 --- a/OpenAI_API/Embedding/EmbeddingResult.cs +++ b/OpenAI_API/Embedding/EmbeddingResult.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using System.Collections.Generic; using System.Linq; namespace OpenAI_API.Embedding @@ -12,7 +13,7 @@ public class EmbeddingResult : ApiResultBase /// List of results of the embedding /// [JsonProperty("data")] - public Data[] Data { get; set; } + public List Data { get; set; } /// /// Usage statistics of how many tokens have been used for this request diff --git a/OpenAI_Tests/EmbeddingEndpointTests.cs b/OpenAI_Tests/EmbeddingEndpointTests.cs index 982a91b..5ecfaa5 100644 --- a/OpenAI_Tests/EmbeddingEndpointTests.cs +++ b/OpenAI_Tests/EmbeddingEndpointTests.cs @@ -24,7 +24,7 @@ public void GetBasicEmbedding() var results = api.Embeddings.CreateEmbeddingAsync(new EmbeddingRequest(Model.AdaTextEmbedding, "A test text for embedding")).Result; Assert.IsNotNull(results); Assert.NotNull(results.Object); - Assert.NotZero(results.Data.Length); + Assert.NotZero(results.Data.Count); Assert.That(results.Data.First().Embedding.Length == 1536); }