def search_embeddings(airtable, embedding_column, query, n=3, pprint=True):
    records = get_embeddings_table(airtable)

    query_embedding = openai.Embedding.create(input=query,engine="text-embedding-ada-002")["data"][0]["embedding"]
    query_embedding = np.array(query_embedding)
    #print("query_embedding.shape")
    #print(type(query_embedding))
    

    similarities = []
    with ThreadPoolExecutor() as executor:
        futures = [executor.submit(calculate_similarity, record, query_embedding) for record in records]
        for future in futures:
            similarities.append(future.result())

    for i in range(len(similarities)):
        records[i]["similarities"] = similarities[i]
        #print(records[i]["similarities"])

    records = sorted(records, key=itemgetter("similarities"), reverse=True)
    print("sorted")
    #print(len(records))
    return records[:25]

Can you rewrite the code above to first store the records from Airtable into Pinecone, and then use Pinecone's vector search function for similarity?