File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,28 @@ source <your-env>/bin/activate
3333< your-env> /bin/pip install langchain-google-cloud-sql-mysql
3434```
3535
36+ ## Vector Store Usage
37+
38+ Use a [ vector store] ( https://python.langchain.com/docs/modules/data_connection/vectorstores/ ) to store
39+ embedded data and perform vector search.
40+
41+ ``` python
42+ from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLVectorStore
43+ from langchain_google_vertexai import VertexAIEmbeddings
44+
45+
46+ engine = MySQLEngine.from_instance(" project-id" , " region" , " my-instance" , " my-database" )
47+ engine.init_vectorstore_table(
48+ table_name = " my-table-name" ,
49+ vector_size = 768 , # Vector size for `VertexAIEmbeddings()`
50+ )
51+ vectorstore = MySQLVectorStore(
52+ engine,
53+ embedding_service = VertextAIEmbeddings(),
54+ table_name = " my-table-name" ,
55+ )
56+ ```
57+
3658## Document Loader Usage
3759
3860Use a [ document loader] ( https://python.langchain.com/docs/modules/data_connection/document_loaders/ ) to load data as LangChain ` Document ` s.
You can’t perform that action at this time.
0 commit comments