Skip to content

Commit a0de649

Browse files
totoleonHailong Likurtisvg
authored
doc: fixing colab (#78)
* doc: fixing colab --------- Co-authored-by: Hailong Li <[email protected]> Co-authored-by: Kurtis Van Gent <[email protected]>
1 parent 5e79043 commit a0de649

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

samples/langchain_quick_start.ipynb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,15 @@
498498
"\n",
499499
"sample_vector_table_name = \"movie_vector_table_samples\"\n",
500500
"\n",
501+
"pg_engine = PostgresEngine.from_instance(\n",
502+
" project_id=project_id,\n",
503+
" instance=instance_name,\n",
504+
" region=region,\n",
505+
" database=database_name,\n",
506+
" user=\"postgres\",\n",
507+
" password=password,\n",
508+
")\n",
509+
"\n",
501510
"pg_engine.init_vectorstore_table(\n",
502511
" sample_vector_table_name,\n",
503512
" vector_size=768,\n",
@@ -742,12 +751,12 @@
742751
" PostgresChatMessageHistory,\n",
743752
")\n",
744753
"\n",
745-
"# Intialize the embedding service\n",
754+
"# Initialize the embedding service\n",
746755
"embeddings_service = VertexAIEmbeddings(\n",
747756
" model_name=\"textembedding-gecko@latest\", project=project_id\n",
748757
")\n",
749758
"\n",
750-
"# Intialize the engine\n",
759+
"# Initialize the engine\n",
751760
"pg_engine = PostgresEngine.from_instance(\n",
752761
" project_id=project_id,\n",
753762
" instance=instance_name,\n",
@@ -757,7 +766,7 @@
757766
" password=password,\n",
758767
")\n",
759768
"\n",
760-
"# Intialize the Vector Store\n",
769+
"# Initialize the Vector Store\n",
761770
"vector_table_name = \"movie_vector_table\"\n",
762771
"vector_store = PostgresVectorStore.create_sync(\n",
763772
" engine=pg_engine,\n",
@@ -774,7 +783,7 @@
774783
" ],\n",
775784
")\n",
776785
"\n",
777-
"# Intialize the PostgresChatMessageHistory\n",
786+
"# Initialize the PostgresChatMessageHistory\n",
778787
"chat_history = PostgresChatMessageHistory.create_sync(\n",
779788
" pg_engine,\n",
780789
" session_id=\"my-test-session\",\n",
@@ -844,7 +853,7 @@
844853
},
845854
"outputs": [],
846855
"source": [
847-
"# Intialize retriever, llm and memory for the chain\n",
856+
"# Initialize retriever, llm and memory for the chain\n",
848857
"retriever = vector_store.as_retriever(\n",
849858
" search_type=\"mmr\", search_kwargs={\"k\": 5, \"lambda_mult\": 0.8}\n",
850859
")"
@@ -856,7 +865,7 @@
856865
"id": "3maZ8SLlneYJ"
857866
},
858867
"source": [
859-
"Now let's intialize our LLM, in this case we are using Vertex AI's \"gemini-pro\"."
868+
"Now let's initialize our LLM, in this case we are using Vertex AI's \"gemini-pro\"."
860869
]
861870
},
862871
{

0 commit comments

Comments
 (0)