Skip to content

chore(docs): Update vector store notebook#96

Merged
averikitsch merged 12 commits intogoogleapis:mainfrom
vmanghnani:patch-1
Oct 4, 2024
Merged

chore(docs): Update vector store notebook#96
averikitsch merged 12 commits intogoogleapis:mainfrom
vmanghnani:patch-1

Conversation

@vmanghnani
Copy link
Copy Markdown
Contributor

  1. Added Installation of additional dependencies "langchain-google-vertexai" it is needed for text embedding generation.

  2. Set "GOOGLE_CLOUD_PROJECT" env variable for PROJECT_ID, it is needed for table creation / SQL execution in vector_store module.

  3. Specified "id_column" value as "row_id", to match it with table creation in "init_vector_store_table" function, if "id_column" is not set then default value is "langchain_id"

1.  Added Installation of  additional dependencies "langchain-google-vertexai" it is needed for text embedding generation.

2.  Set "GOOGLE_CLOUD_PROJECT" env variable for  PROJECT_ID, it is needed for table creation / SQL execution in vector_store module.

3.  Specified "id_column" value as "row_id", to match it with table creation in "init_vector_store_table" function, if  "id_column" is not set then default value is "langchain_id"
@vmanghnani vmanghnani requested review from a team September 30, 2024 21:35
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the googleapis/langchain-google-spanner-python API. label Sep 30, 2024
@averikitsch averikitsch self-assigned this Sep 30, 2024
Comment thread docs/vector_store.ipynb Outdated
Comment thread docs/vector_store.ipynb Outdated
Comment thread docs/vector_store.ipynb Outdated
" database_id=DATABASE,\n",
" table_name=TABLE_NAME,\n",
" ignore_metadata_columns=[],\n",
" id_column=\"row_id\",\n",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could similarity update this section to call out the customization:

db = SpannerVectorStore(
    instance_id=INSTANCE,
    database_id=DATABASE,
    table_name=TABLE_NAME,
    embedding_service=embeddings,
    # Connect to a custom vector store table
    # id_column="row_id",
    # content_column="content_column",
    # metadata_columns=["metadata", "title"]
    # metadata_json_column="my-json-metadata",
)

Copy link
Copy Markdown
Contributor Author

@vmanghnani vmanghnani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated code based on few suggestions

Copy link
Copy Markdown
Contributor Author

@vmanghnani vmanghnani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#98 is submitted to make "metadata_columns" option parameter. For now, update code to make it fully functional in colab env

@averikitsch averikitsch changed the title Update vector_store.ipynb chore(docs): Update vector store notebook Oct 4, 2024
@averikitsch averikitsch merged commit 6632fe2 into googleapis:main Oct 4, 2024
@vmanghnani vmanghnani deleted the patch-1 branch October 7, 2024 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/langchain-google-spanner-python API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants