Can't load embeddings from documents into the index

Hi,

Recently I’ve tried to load a merge of two pdf documents into Pinecone DB.

I used the following code:

from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.vectorstores import Pinecone
from langchain.llms import OpenAI


def chunk_data(docs, chunk_size=800, chunk_overlap=50) -> list:
    text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
    split_docs = text_splitter.create_documents(docs)
    return split_docs

doc1 = chunk_data(doc, chunk_size=800, chunk_overlap=50)
doc2 = chunk_data(other_doc, chunk_size=800, chunk_overlap=50)

embeddings = OpenAIEmbeddings(api_key=openai_api_key)

index_name = 'index_name'

pinecone.Pinecone(
    api_key=pinecone_api_key,
    enviornment=environment  # Should be 'environment'
)

all_chunks = doc1 + doc2

index = Pinecone.from_texts(all_chunks, embeddings, index_name=index_name)

And then I get this error:

--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[122], line 1 ----> 1 index = Pinecone.from_texts(doc_chunks, embeddings, index_name=index_name) File c:\Users\egora\ML\tartot_reader\venv\Lib\site-packages\langchain_community\vectorstores\pinecone.py:435, in Pinecone.from_texts(cls, texts, embedding, metadatas, ids, batch_size, text_key, namespace, index_name, upsert_kwargs, pool_threads, embeddings_chunk_size, **kwargs)

TypeError: expected string or buffer

Same thing happens when I try to upload only 1 document and not a combination of 2 pdf chunks.

I have the same issue.

And the most interesting that Python type() method tells me that my vector is a list, and pinecone_client 4.0.0 library raises error that vector is a string. It is so strange error.

I use the index with 1536 dimensions to host vectors from the text-embedding-3-small Openai model.
For debugging purposes I decided to print vector type with “type(vector)” and vector itself before upserting it to Pinecone. Here is what my code prints:

vector type: <class ‘list’>
vector: [-0.02244803, 0.020423306, 0.002095464, -0.026635814, -0.030433744, 0.012022587, 0.0017354779, 0.0020184363, 0.006860168, -0.029176151, -0.027189154, -0.004247519, -0.06881547, 0.009362778, -0.0018423733, -0.01892677, -0.069268204, 0.01886389, 0.02081316, -0.016160067, 0.0115006855, 0.028421596, 0.0044172946, -0.032722563, -0.002246375, -0.029402517, -0.04557516, -0.0036784587, 0.028144926, 0.021957569, 0.0042412314, -0.021278469, 0.03161588, -0.016285826, -0.044745147, -0.021655746, 0.045097277, -0.042079054, -0.020448457, 0.013255027, 0.021353925, 0.02386911, -0.00554284, -0.035187446, -0.03445804, -0.006247092, -0.05035401, 0.014097614, -0.034382585, 0.036998376, 0.010563779, 0.051611606, -0.010249381, 0.08586843, -0.021756355, -0.00864595, 0.03392985, 0.025516557, -0.008777997, 0.018084183, -0.003123546, -0.04222996, 0.0014085039, -0.01315442, -0.014663531, -0.03392985, -0.0009942843, 0.047662765, -0.047562156, 0.009494825, 0.026962787, 0.0060773166, -0.0145755, -0.04502182, 0.041576017, 0.005184426, 0.0056717433, -0.016939774, -0.015568998, 0.0062973956, 0.00870883, 0.057295926, -0.032169223, -0.047436398, 0.01639901, 0.029679189, -0.019530416, -0.07017367, -0.1234453, 0.028044317, -0.018549493, -0.0053321933, 0.022359999, -0.009205579, 0.002568633, -0.014009583, 0.025063822, -0.001036728, -0.043286342, 0.026937636, 0.018071607, 0.0066652414, -0.04514758, 0.01275199, 0.01898965, -0.00790397, 0.029578581, -0.025277613, -0.025705196, 0.054730434, -0.07691437, 0.03621867, 0.0069922153, 0.01695235, -0.059458982, 0.013078964, 0.009111259, -0.014160494, -0.021957569, -0.03979023, -0.05005219, 0.0024554497, 0.009343914, -0.027340066, 0.036595948, 0.0029977867, 0.044141505, -0.041978445, -0.04434272, -0.022900764, 0.009281035, 0.009821799, 0.045097277, -0.048895206, 0.029528277, -0.047235183, -0.030735565, 0.011066816, -0.020385578, 0.040595092, 0.03631928, -0.018297974, 0.065092996, 0.045499705, 0.026786724, 0.009903543, -0.009444522, 0.0025576293, -0.033829246, 0.035589874, 0.033829246, 0.024963215, -0.009576568, -0.008237232, 0.05452922, -0.035640176, 0.068513654, 0.07822227, -0.042406026, 0.023793655, -0.010544915, -0.046430323, -0.018423732, -0.0040903203, 0.0035023957, 0.005932694, -0.029000089, -0.024032596, -0.04595244, -0.026761573, 0.026132777, 0.030458895, -0.015568998, -0.0041940715, -0.0134436665, -0.03971478, 0.050756443, -0.011859099, -0.022749852, -0.011481822, -0.0065017543, 0.0098595265, -0.025579436, -0.027490977, -0.0072122943, -0.009306186, 0.04107298, 0.03538866, -0.0003452485, 0.0104191555, 0.007551844, 0.0020561642, -0.015770212, -0.009815511, 0.002241659, -0.034382585, 0.030634958, -0.03523775, -0.030458895, 0.0043386947, 0.028497051, 0.05613894, 0.04434272, 0.012978357, -0.038834464, -0.02210848, -0.021039527, 0.032093767, -0.021957569, -0.016449314, 0.03257165, 0.0052630254, 0.035866544, 0.023039099, -0.027088547, 0.015065961, -0.008564207, -0.015179144, -0.004128048, -0.00055923575, 0.0069922153, 0.036847465, 0.022674397, -0.007426085, -0.038708705, 0.028647963, 0.027616736, 0.01966875, -0.0049391952, -0.036872618, -0.009016939, 0.012054026, -0.0043638465, -0.021919841, 0.039765082, -0.044292416, 0.060716577, -0.015845668, -0.017744632, -0.038708705, -0.054478917, 0.0084384475, -0.015682181, 0.029779796, 0.073544025, -0.018398581, -0.0005836016, -0.050680988, 0.0028232955, -0.006879032, 0.013104117, 0.0075204046, 0.00026664895, -0.06479118, 0.025466252, -0.032873474, -0.046002742, 0.02806947, -0.008601934, -0.015581573, -0.053523146, -0.03712414, -0.02053649, -0.04421696, 0.029729491, 0.015732486, -0.012739414, 0.026811877, -0.00276356, -0.06765849, -0.0008936768, 0.019278897, -0.0059861415, 0.044317566, -0.008124049, -0.030333137, -0.033678334, 0.010658098, 0.022712125, 0.0071682786, -0.006319403, 0.0166128, -0.035464115, 0.025403373, -0.02766704, -0.037098985, 0.0017464819, 0.008199505, -0.020523913, -0.011745916, 0.082799904, -0.03918659, -0.0036816027, -0.030685263, -0.008199505, 0.01688947, 0.0434121, 0.042909063, -0.021127557, -0.009821799, 0.042355724, -0.0028374435, -0.021454532, -0.05387527, -0.05930807, 0.0508822, -0.029402517, 0.0050932504, 0.0018235095, -0.029352214, -0.02658551, 0.014374285, 0.03609291, -0.08974182, -0.024585938, -0.017769786, 0.04529849, -0.063282065, -0.008947772, -0.024258964, 0.049850974, -0.018272823, -0.009356489, 0.0068916082, 0.007055095, -0.0066212257, 0.0664512, 0.024850031, -0.018008728, -0.03609291, -0.0011467674, -0.056994103, 0.012110618, 0.0028594513, 0.0033860684, -0.014386861, -0.04245633, 0.010054454, -0.028044317, 0.015242023, 0.04351271, -0.036948074, -0.047134575, -0.0071682786, 0.011041664, -0.025453677, 0.009815511, 0.00043701346, -0.028044317, -0.006746985, -0.041173585, 0.01571991, 0.034659255, -0.020511337, -0.023152282, -0.012990933, 0.04366362, -0.028295835, -0.06298024, 0.024497906, -0.012324409, 0.011997434, 0.060465056, -0.00276356, 0.009626872, 0.03528805, -0.063634194, 0.019605871, -0.013808368, -0.00615906, 0.014751563, 0.0055302638, 0.023491831, -0.0073003257, 0.004354415, -0.014776714, -0.0005867456, 0.033955004, -0.00062997534, -0.0206874, 0.066903934, 0.028144926, 0.022812732, -0.034608953, 0.020473609, 0.020574218, -0.027591584, 0.014198222, -0.014059886, -0.0073632053, 0.014034735, -0.010368852, -0.0061842124, -0.052064337, -0.0034206521, 0.048895206, 0.024120629, -0.0067595607, 0.0138838235, -0.0057597747, 0.011123408, -0.045248184, -0.015418087, 0.024850031, 0.04124904, -0.03528805, 0.009400506, -0.0064357305, 0.011921979, -0.0022023593, 0.060263842, -0.03252135, 0.028673114, -0.018951923, 0.042280268, -0.0059484136, -0.01377064, 0.025353068, 0.055585597, -0.010387716, 0.043437254, -0.0044707423, -0.03199316, -0.01633613, -0.014047311, 0.04519788, 0.026484903, -0.01614749, 0.047134575, -0.037602022, -0.004294679, 0.018448886, 0.04243118, -0.0021614875, 0.01133091, -0.009815511, -0.053623755, 0.02149226, 0.013028661, -0.0013369783, 0.019819662, 0.022951066, -0.00092747464, -0.023479257, 0.023227738, 0.015581573, -0.032320134, 0.027717343, -0.023705622, -0.043185733, -0.04054479, 0.042833608, -0.071984604, 0.02312713, -0.042028747, -0.026635814, -0.010111045, -0.0006680961, -0.03999145, -0.018763283, 0.003282317, -0.003084246, 0.036143214, -0.059710503, 0.00963316, 0.034508344, 0.0064577386, 0.028723417, 0.02287561, 0.023378648, -0.008815725, 0.0011892112, -0.0013393363, 0.030961933, 0.029100696, 0.007803363, 0.01173334, 0.009985286, -0.023667894, -0.012607367, -0.03523775, -0.005860382, -0.07812166, -0.02121559, 0.008545343, 0.0071682786, 0.028874328, 0.029528277, -0.037602022, 0.0047191167, -0.019593295, 0.005366777, 0.034508344, -0.01377064, 0.023542136, 0.032546498, -0.05357345, -0.04693336, -0.01614749, -0.01065181, 0.059106857, 0.004986355, 0.05098281, 0.0037664901, 0.009645736, 0.01756857, -0.0042349435, -0.0048951795, -0.013795792, -0.051510997, 0.021416804, -0.005052379, 0.013644881, -0.0076964675, -0.03528805, -0.010274532, 0.06614938, 0.035891697, -0.014235949, -0.007834802, 0.007463813, -0.018624948, 0.025705196, -0.0123621365, -0.0010775997, -0.006247092, 0.0013071104, -0.020637097, -0.032269828, -0.039161436, 0.01621037, -0.01383352, -0.038230818, -0.029553428, -0.01985739, 0.020033453, 0.02488776, -0.03727505, -0.016197795, 0.022498334, 0.05327163, 0.008664814, -0.0016175787, 0.013531698, -0.019706478, -0.01748054, -0.0017637737, 0.01642416, -0.011727052, -0.0012866745, 0.037501413, -0.0001727225, 0.021353925, -0.036772013, 0.0061559165, 0.022712125, -0.027591584, 0.022913339, -0.0040557366, 0.007947986, 0.003945697, -0.0059452695, 0.020360427, 0.01621037, 0.014336557, 0.026962787, 0.016059458, 0.008796861, 0.011104544, -0.016587649, 0.02630884, -0.022724701, -0.0025230453, 0.032345284, 0.039161436, 0.010632946, -0.014726411, -0.01898965, -0.0070047914, 0.044694845, -0.04721003, -0.005212722, 0.015770212, 0.04990128, -0.029352214, 0.015179144, 0.038960222, 1.4393541e-05, 0.0097589195, -0.010488323, 0.05191343, -0.04381453, -0.006014437, 0.014185646, 0.010324836, 0.021907264, -0.03430713, 0.026761573, -0.02414578, 0.027490977, 0.0035086838, 0.009865815, 0.00088660285, 0.025478829, -0.030559503, -0.0120414505, 0.05382497, -0.0010249381, 0.0055837114, -0.0082183685, -0.034131065, 0.019039953, -0.0002949448, -0.025478829, 0.016537344, 0.016738558, 0.00082293723, -0.009312474, 0.041928142, -0.015820516, -0.013934127, -0.018499188, 0.007589572, 0.013644881, 0.017958423, 0.0027022522, -0.0108404495, -0.020058604, 0.0042035035, -0.0109599205, 0.008539055, -0.026258536, 0.048266407, 0.002584353, -0.025327917, 0.011991147, -0.010664387, 0.026258536, 0.0022023593, -0.028899482, 0.011720764, -0.005901254, 0.021152709, -0.048316713, 0.017254172, 0.0004680603, -0.03501138, -0.025126703, -0.038130213, -0.008570494, 0.026258536, -0.060666274, 0.027239459, -0.0024916055, 0.028824026, 0.043990593, -0.016839167, -0.0029977867, -0.049347937, -0.004335551, -0.011022801, 0.016248098, 0.009117547, 0.02007118, -0.02794371, 0.010607795, 0.018826162, -0.024447603, 0.002936479, 0.008463599, -0.011456669, 0.0013314763, 0.00030083975, 0.010324836, 0.011802508, -0.047008816, 0.0080171535, -0.023202585, -0.017593723, -0.0081177605, 0.019140562, -0.009092395, -0.056994103, 0.0007962134, 0.021479683, -0.017354779, -0.009117547, 0.0063036834, 0.022548638, -0.036948074, 0.013104117, -0.009652024, -0.0016317265, 0.0038450898, 0.013758064, 0.00085437705, 0.03973993, 0.032647107, -0.019341776, -0.04655608, -0.02108983, 0.016436737, -0.07942956, -0.0076021478, -0.03566533, 0.00014953564, -0.039865687, 0.0129029015, 0.026082473, -0.00052307994, -0.010658098, -0.002592213, -0.025378222, 0.008073745, 0.036445037, -0.030333137, -0.021328773, 0.0073254774, 0.010953632, -0.0067218333, -0.014097614, 0.029679189, -0.0332256, -0.0036124352, 0.0069293357, 0.008230944, 0.022359999, 0.029654035, -0.02149226, -0.006508042, 0.0023831383, -0.0073632053, 0.03337651, 0.010394004, -0.003074814, 0.046002742, -0.03332621, -0.027340066, 0.013066389, -0.0021677755, -0.029528277, 0.020461034, -0.020574218, -0.022611517, 0.014889898, -0.017996151, -0.013405939, 0.01574506, -0.050152797, 0.020398153, 0.035514418, 0.009104971, 0.0039488412, -0.014185646, 0.0152042955, -0.0030590943, 0.008847165, 0.00068303006, -0.0076587396, 0.01769433, 0.033980154, 0.009501113, 0.017304476, 0.026560359, -0.020725127, 0.015065961, -0.031414665, -0.0047631324, 0.01710326, 0.029477973, -0.028974935, -0.001374706, -0.010337412, 0.006923048, 0.0406454, 0.0071682786, -0.001213577, 0.0028688833, 0.022863036, -0.023428952, 0.015556422, -0.022863036, 0.028497051, 0.020586792, -0.0015979287, -0.0068287286, -0.014977929, 0.008859741, -0.01411019, -0.046027895, 0.0018753852, 0.0030653821, 0.0052158656, -0.008790573, -0.023403801, 0.014311405, -0.007294038, -0.073393114, -0.00022282971, -0.0059547015, -0.020649672, -0.030333137, -0.03365318, -0.012393576, 0.0042789592, -0.0026047889, -0.059257768, 0.035740785, -0.0040934645, 0.007312902, 0.017518267, 0.007388357, 0.026157929, 0.06358389, 0.0103437, 0.013531698, 0.018046455, -0.031364363, 0.010689538, 0.029000089, 0.040393878, 0.0318674, -0.016964925, -0.000103358405, -0.012330697, 0.009268458, -0.014550348, 0.008388143, -0.0005891036, -0.01182766, 0.038432032, 0.015833093, -0.014688683, -0.012462744, -0.029603733, 0.021291045, -0.014273677, 0.017128414, -0.0045807813, 0.018084183, 0.038457185, 0.0016238666, -0.016675679, -0.00037550932, 0.0014014299, -0.017216444, -0.002232227, 0.016751135, 0.015556422, 0.015166569, 0.0009817083, -0.011714476, 0.011242879, -0.04041903, -0.0019964285, 0.00010630588, 0.009545129, -0.019656174, 0.03201831, -0.0014627376, 0.003291749, 0.025403373, 0.005165562, -0.044820603, -0.0064294427, 0.037073832, -0.013166996, 0.0018077896, 0.00874027, 0.016386433, -0.022737276, -0.027893407, 0.028295835, -0.013657457, -7.31467e-05, 0.00793541, -0.039262045, 0.03755172, -0.009519977, 0.012179785, 0.021567715, -0.024661394, 0.05307041, -0.032370437, -0.007589572, 0.04909642, -0.017820088, 0.036595948, 0.02334092, -0.0027792798, 0.006398003, -0.029050391, 0.02726461, 0.005825798, -0.019002225, 0.035589874, 0.0014784575, 0.046053044, -0.004605933, -0.05478074, -0.028170077, -0.032194372, -0.010601507, 0.0004303325, -0.003942553, 0.025214734, -0.00453991, 0.006379139, -0.0054202247, 0.020473609, 0.054227397, -0.035514418, 0.0339047, 0.0047411243, -0.007614724, 0.00022715269, 0.002233799, 0.013896399, -0.010783858, -0.024762, 0.0004303325, -0.026107624, 0.0012363709, 0.007929122, -0.005646591, -0.044694845, -0.019957997, 0.026459752, 0.02618308, -0.02531534, 0.02278758, 0.023667894, 0.027088547, 0.019580718, -0.0054296567, -0.0037916421, 0.004634229, 0.007262598, -0.0143239815, 0.009658312, -0.002578065, -0.036445037, 0.034533497, -0.015958851, 0.05307041, 0.0078976825, -0.014286254, -0.0062408037, -0.014034735, 0.014789291, 0.05246677, 0.0012285109, -0.032445893, -0.018763283, -0.018788435, 0.018612372, 0.008042306, -0.017040381, -0.003958273, 0.057798963, -0.02414578, 0.023202585, -0.019178288, -0.0043795668, -0.017732058, 0.014562923, -0.017166141, 0.041148435, 0.042682696, -0.0073191896, -0.0023548424, -0.0017669178, 0.036822315, 0.030408591, -0.0305092, -0.004307255, 0.0061653485, 0.002419294, 0.02874857, 0.007092823, 0.026333991, 0.028974935, 0.040393878, -0.0073191896, 0.008683678, 0.010815297, 0.03745111, 0.004521046, 0.032722563, 0.03906083, -0.046153653, 0.03377894, 0.000519543, 0.006272244, -0.027138852, -0.015946276, 0.02244803, 0.054931648, -0.006709257, 0.0035589873, 0.020788008, -0.009740056, 0.017140988, -0.03619352, -0.024070324, 0.021504836, 0.03556472, 0.018914195, 0.04640517, -0.023994869, -0.03159073, -0.0060710288, 0.018474037, -0.008325264, 0.021014374, -0.04381453, -0.017555995, -0.0038765296, -0.00938793, -0.015958851, -0.0002955343, -0.0018580932, 0.0032257254, 0.026484903, -0.024724273, -0.018964497, 0.026535206, 0.018084183, 0.02618308, 0.024447603, -0.019907692, -0.0010037161, -0.009853239, 0.031364363, -0.0037256184, 0.027314914, -0.015405511, -0.027415521, -0.0071619907, -0.02183181, 0.042556938, 0.02229712, 0.014374285, 0.011595005, 0.0061276206, -0.00012664351, -0.013255027, 0.005027227, -0.013292755, 0.025956715, -0.02658551, 0.0024648816, 0.0072060064, -0.0007852095, 0.033678334, 0.016990077, 0.014185646, -0.0062848195, 0.037954148, -0.0021504834, -0.019140562, 0.037224744, 0.030207377, -0.03448319, 0.03267226, 0.0076524517, 0.02454821, 0.0045179017, 0.027742496, 0.008073745, 0.010129909, 0.017178716, 0.023491831, -0.020259818, -0.019517839, -0.0059484136, -0.006539482, -0.024523057, -0.0051309783, 0.026283687, -0.028974935, -0.008935196, 0.0142233735, -0.010953632, -0.050228253, 0.0024837456, 0.015166569, 0.014349133, 0.018788435, -0.010727266, -0.0098783905, -0.022611517, 0.017442811, 0.010041878, 0.024321843, 0.025830954, -0.0043952866, 0.0010202221, 0.043210886, -0.020096332, 0.016575072, 0.018197367, 0.0039299773, -0.0061339084, -0.035086837, -0.010733554, 0.016763711, -0.042406026, -0.050756443, 0.014298829, -0.0026519487, -0.020058604, -0.012324409, 0.015757637, 0.015581573, 0.01954299, -0.006910472, 0.039136287, 0.034231674, 0.0420539, -0.029125847, 0.00206874, 0.008507615, 0.033401664, -0.033250753, -0.00691676, 0.0193292, 0.0005690607, -0.044443328, 0.02414578, 0.036168367, 0.0047254045, -0.014814442, -0.028949784, 0.017493114, -0.016373858, -0.010865601, -0.018712979, 0.0076398756, 0.007979426, -0.005011507, -0.0014800294, 0.008790573, 0.010469459, -0.0046782447, -0.027516128, 0.005844662, 0.06992216, -0.0019618447, 0.056893494, -0.011859099, 0.007992001, -0.024258964, -0.002238515, 0.036595948, -0.003794786, 0.03229498, -0.020058604, -0.0136826085, 0.016298402, -0.0077027553, 0.0035306916, -0.012387288, 0.020448457, 0.009576568, -0.008947772, 0.016046884, -0.009457097, 0.03201831, 0.021718627, 0.043462403, -0.013468818, -0.006596074, 0.0069419118, -0.01213577, 0.033426814, 0.015506119, -0.029352214, -0.017895544, 0.041022673, 0.027893407, -0.007243734, 0.022988794, -0.0040525924, -0.022158783, 0.03445804, -0.018197367, 0.0011640593, -0.02198272, 0.007910258, 0.0080171535, 0.009934982, -0.044292416, -0.007841091, 0.013908976, -0.00047238325, -0.0010728838, 0.027289761, -0.00821208, -0.022536062, -0.019882541, 0.042028747, 0.017681753, 0.028320989, 0.025164431, -0.02312713, 0.0076210117, -0.048467625, 0.009255882, -0.00050185807, 0.010513475, 0.0047694203, -0.034558646, 0.004829156, 0.0016411585, -0.04990128, 0.014437164, 0.006753273, -0.00022066823, 0.026459752, -0.010463172, -0.012676534, 0.015493542, 0.0053321933, -0.017719481, -0.012217513, 0.045625463, -0.015669605, 0.015292328, -0.0023705622, 0.03337651, -0.052265555, -0.014663531, -0.015958851, -0.023366073, -0.0145755, 0.015631877, -0.004354415, 0.023026522, 0.030584656, 0.040368725, 0.021806657, 0.016738558, 0.0033797803, 0.0029254751, -0.019983148, -0.017128414, 0.008388143, 0.024384722, -0.0077153314, -0.00040557366, 0.012915477, 0.018423732, 0.011374926, -0.034986228, 0.013896399, -0.010815297, -0.023479257, 0.01973163, 0.039111134, -0.013053812, 0.023303192, -0.024372147, -0.000517578, 0.026409447, -0.010771282, -0.031817097, 0.04854308, 0.00904838, 0.0033294768, -0.031917702, -0.016788863, -0.0123621365, 0.019467534, 0.018260246, 0.0050995382, -0.010846737, 0.018021304, 0.0040368726, 0.008029729, -0.01411019, -0.031666186, 0.0008370851, 0.026610661, -0.033150144, -0.02562974, -0.002744696, -0.011110832, -0.016046884, -0.0003440695, 4.487543e-05, 0.018838739, -0.007929122, -0.0076398756, 0.01985739, -0.0069481996, 0.011142272, -0.0058132224, 0.009865815, -0.0101990765, 0.0037256184, -0.005684319, 0.037048683, -0.008620798, 0.0076964675, -0.03772778, 0.005508256, -0.044745147, 0.019505262, -0.02874857, 0.021995297, -0.031163147, -0.0025387653, -0.0070047914, -0.0013464103, 0.03297408, -0.05342254, 0.028849177, 0.014889898, -0.029352214, 0.043009672, 0.030634958, -0.021856962, -0.0033389088, 0.03863325, -0.07133066, -0.0133430585, 5.3938937e-05, 0.021655746, -0.02970434, -0.015116264, -0.0018486613, -0.012204938, -0.0018769571, -0.008036017, 0.020637097, 0.013758064, 0.009865815, -0.007143127, -0.010865601, -0.0037444823, 0.014801866, 0.005020939, 0.0298301, 0.0002230262, -0.008916332, -0.013997007, -0.015116264, 0.013720336, -0.0033546286, -0.02013406, 0.0014926053, 0.012833734, 0.018662676, -0.011846524, 0.0305092, 0.011255455, -0.019190865, -0.0040934645, -0.02210848, 0.0063162595, 0.010092181, 0.020611946, -0.017958423, 0.0069607757, 0.006111901, -0.019190865, 0.013908976, -0.013921551, 0.047788523, -0.01966875, 0.008991788, -0.03604261, 0.022649245, -0.0006728121, 0.039840538, -0.020788008, 0.022888187, 0.0013629161, 0.014713835, -0.04150056, 0.004653093, -0.016172642, -0.014022158, 0.0016584503, -0.026660966, -0.007922834, 0.010482036, 0.0014061459, -0.0124816075, 0.007067671, -0.020951495, -0.005706327, 0.045650616, -0.01778236, 0.016185218, 0.015116264, 0.0047725644, -0.0035778512, -0.013556849, -0.023240313, 0.03365318, -0.012833734, -0.0028908912, -0.024673969, -0.009318762, -0.03825597, 0.0028625955, 0.022636669, 0.026686117, -0.017279323, -0.030760719, 0.03486047, 0.008463599, -0.0046027894, -0.0015774929, -0.006027013, -0.017996151, 0.0153049035, -0.019769358, -0.0012819585, 0.014198222, 0.020360427, -0.009702328, 0.008727693, -0.017732058, -0.025516557, -0.005857238, 0.049020965, -0.010054454, -0.039689627, 0.020297546, 0.014022158, 0.015443238, 0.002931763, 0.03745111, -0.01587082, 0.014147918, 0.018788435, -0.035338357, -0.014789291, 0.06992216, 0.028195228, 0.0042380877, 0.0063445554, 0.01748054, -0.0055774236, -0.007822227, -0.041576017, -0.031942856, 0.025277613, 0.0122426655, 0.016839167, -0.024447603, 0.01621037, -0.013657457, 0.0022636668, 0.01114856, 0.023215162, -0.04421696, 0.010802722, 0.020712553, -0.0021206157, 0.03159073, 0.022988794, 0.0035495555, -0.0073946454, -0.002582781, -0.010664387, 0.021316197, -0.008507615, 0.05644076, -0.036948074, -0.015908549, 0.03647019, -0.0036627387, -0.005319617, -0.001544481, -0.007558132, 0.0056717433, -0.042657547, 0.0035526995, 0.0122426655, -0.0018486613, 0.052869197, 0.024762, -0.012965781, 0.024850031, -0.007979426, 0.020146634, -0.054328006, -0.004986355, 0.028824026, 0.018889043, -0.016260674, -0.023328345, -0.004275815, 0.012129482, 0.023403801, -0.0009361206, 0.010425444, 0.00963316, 0.02510155, -0.014022158, -0.00051246904, 0.012808582, -0.010607795, 0.009652024, -0.0015884968, 0.016323553, 0.0016222947, -0.004300967, 0.016524768, 0.023479257, -0.009035803, 0.008476175, 0.0049329074, -0.004901468, 0.015958851, 0.017606298, -0.028270684, 0.0057377666, 0.0013471962, -0.0071871425, 0.0031329778, 0.0045839255, 0.003958273, 0.044795454, -0.009796647, -0.0016065747, 0.00075023266, 0.015330055, 0.0032162934, -0.0060961805, -0.010695826, -0.007180854]

Error: Invalid vector value passed: cannot interpret type <class ‘str’>

I do not have any logic on my side that converts my vector to a string. So this error is tremendously strange because the Python thinks that the vector is a list, and the pinecone_client 4.0.0 library or Pinecone API thinks that it is a string.

Can someone from Pinecone support tell if it’s a bug from Pinecone side?

Hi @egor.a.kolpakov and welcome to the Pinecone forums!

It looks like you’re using outdated code:

from langchain... import Pinecone

Please review our updated LangChain guide and our doc on resolving the Pinecone attribute error

for working examples and resolution!

Hope this helps.

Best,
Zack

@egor.a.kolpakov and @klym - please share which tutorial / blog post / docs you were following when you found this code.

We want to identify it so we can work with the author to update their code examples.

Thanks so much!

Hi @zack.p ,

I was following Krish Naik YT.
Link to the video: https://www.youtube.com/watch?v=erUfLIi9OFM

The code which he’s referring to was working like 2 month back, but for a new project where I created a new environment it doesn’t. I guess because of updates.

@egor.a.kolpakov,

Thanks so much for your quick reply—we really appreciate it! I’ve reached out to Krish to explain we have updated code and left a link to our up-to-date LangChain guide.

Best,
Zack

I used a different code; the error was just a similar one. However, when I tried to reproduce the error with a simpler example than in my current code, I discovered what was causing it and fixed it. The error in my code occurred when I accidentally used syntax for the upsert method that was slightly different from the recommended syntax. Now, it has been fixed.

@zack.p, thank you for your quick reply!

1 Like

@klym Awesome - so glad to hear you got it working!

Best,
Zack