File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,28 @@ source <your-env>/bin/activate
33
33
< your-env> /bin/pip install langchain-google-cloud-sql-mysql
34
34
```
35
35
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
+
36
58
## Document Loader Usage
37
59
38
60
Use 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