I am beginning to learn Vector databases, i am using Pinecone to make the databases, but in this code:
public static async Task SaveToDatabase(List<float> vector)
{
string ApiKey = "pcsk_Fuhui_3Ct3UH3hQCTV3gLJKweFSMjRuKpzmM47x4djc8xwQuRVjw8DzxpJBdCLbyAqpbx";
using var pinecone = new PineconeClient(ApiKey);
var indexes = await pinecone.ListIndexes();
foreach (IndexDetails i in indexes) { Console.WriteLine(i.Name); }
Pinecone.Index<RestTransport> index = await pinecone.GetIndex("pinecone
pdfai");
var vectors = new[]
{
new Vector
{
Id = "vector1",
Values = vector.ToArray(),
Metadata = new MetadataMap
{
["genre"] = "horror",
["duration"] = 120
}
}
};
await index.Upsert(vectors);
}
But i just get this error when i run it: System.Text.Json.JsonException: 'JSON deserialization for type 'Pinecone.Rest.UpsertResponse' was missing required properties including: 'upsertedCount'.'
I have tried looking for the 'upsertedCount' but can't find it in any documentation, and i cant figure out why the error is even happening.
Please comment if you need any more info :)