|
498 | 498 | "\n",
|
499 | 499 | "sample_vector_table_name = \"movie_vector_table_samples\"\n",
|
500 | 500 | "\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", |
501 | 510 | "pg_engine.init_vectorstore_table(\n",
|
502 | 511 | " sample_vector_table_name,\n",
|
503 | 512 | " vector_size=768,\n",
|
|
742 | 751 | " PostgresChatMessageHistory,\n",
|
743 | 752 | ")\n",
|
744 | 753 | "\n",
|
745 |
| - "# Intialize the embedding service\n", |
| 754 | + "# Initialize the embedding service\n", |
746 | 755 | "embeddings_service = VertexAIEmbeddings(\n",
|
747 | 756 | " model_name=\"textembedding-gecko@latest\", project=project_id\n",
|
748 | 757 | ")\n",
|
749 | 758 | "\n",
|
750 |
| - "# Intialize the engine\n", |
| 759 | + "# Initialize the engine\n", |
751 | 760 | "pg_engine = PostgresEngine.from_instance(\n",
|
752 | 761 | " project_id=project_id,\n",
|
753 | 762 | " instance=instance_name,\n",
|
|
757 | 766 | " password=password,\n",
|
758 | 767 | ")\n",
|
759 | 768 | "\n",
|
760 |
| - "# Intialize the Vector Store\n", |
| 769 | + "# Initialize the Vector Store\n", |
761 | 770 | "vector_table_name = \"movie_vector_table\"\n",
|
762 | 771 | "vector_store = PostgresVectorStore.create_sync(\n",
|
763 | 772 | " engine=pg_engine,\n",
|
|
774 | 783 | " ],\n",
|
775 | 784 | ")\n",
|
776 | 785 | "\n",
|
777 |
| - "# Intialize the PostgresChatMessageHistory\n", |
| 786 | + "# Initialize the PostgresChatMessageHistory\n", |
778 | 787 | "chat_history = PostgresChatMessageHistory.create_sync(\n",
|
779 | 788 | " pg_engine,\n",
|
780 | 789 | " session_id=\"my-test-session\",\n",
|
|
844 | 853 | },
|
845 | 854 | "outputs": [],
|
846 | 855 | "source": [
|
847 |
| - "# Intialize retriever, llm and memory for the chain\n", |
| 856 | + "# Initialize retriever, llm and memory for the chain\n", |
848 | 857 | "retriever = vector_store.as_retriever(\n",
|
849 | 858 | " search_type=\"mmr\", search_kwargs={\"k\": 5, \"lambda_mult\": 0.8}\n",
|
850 | 859 | ")"
|
|
856 | 865 | "id": "3maZ8SLlneYJ"
|
857 | 866 | },
|
858 | 867 | "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\"." |
860 | 869 | ]
|
861 | 870 | },
|
862 | 871 | {
|
|
0 commit comments