Setting vector embedding to the node using the python SDK

I am in the process creating vector index for an existing graph db.

I created a vector index following this : Vector search indexes - Cypher Manual

Next using python SDK , I traverse the nodes and get the vector-embeddings for the target attribute (by calling VertexAI vector-embeddings API)

Now I want to set the retrieved vector into the node using : Vector search indexes - Cypher Manual

My question is, how can I do this using the Python SDK ?

ok, i found the answer myself:

def update_vector_embeddings(driver, node_id, vector):
    print("updating "+ str(node_id))
    query = """
        MATCH (n:Table) WHERE id(n) = $id
        CALL db.create.setNodeVectorProperty(n, 'vec', $vector)
        RETURN n
        """
    with driver.session() as session:
        result = session.run(query, id=node_id, vector=vector)