From 10632297ece4780e0573f8ff2db7ff3e3416dd41 Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Fri, 14 Feb 2025 12:44:50 -0800 Subject: [PATCH 1/3] docs: Add integrations to README.rst --- README.rst | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.rst b/README.rst index aceb5d3..850b5f9 100644 --- a/README.rst +++ b/README.rst @@ -109,6 +109,48 @@ Use a vector store to store embedded data and perform vector search. ) +Chat Store Usage +~~~~~~~~~~~~~~~~~~~ + +A chat store serves as a centralized interface to store your chat history. + +.. code-block:: python + from llama_index.core.memory import ChatMemoryBuffer + from llama_index_cloud_sql_pg import PostgresChatStore, PostgresEngine + + + engine = await PostgresEngine.afrom_instance( + "project-id", "region", "my-instance", "my-database" + ) + chat_store = await PostgresChatStore.create( + engine=engine, table_name="chat_store" + ) + memory = ChatMemoryBuffer.from_defaults( + token_limit=3000, + chat_store=chat_store, + chat_store_key="user1", + ) + + +Document Reader Usage +~~~~~~~~~~~~~~~~~~~ + +A Reader ingest data from different data sources and data formats into a simple `Document` representation. + +.. code-block:: python + from llama_index.core.memory import ChatMemoryBuffer + from llama_index_cloud_sql_pg import PostgresReader, PostgresEngine + + + engine = await PostgresEngine.afrom_instance( + "project-id", "region", "my-instance", "my-database" + ) + reader = await PostgresReader.create( + engine=engine, table_name="my-db-table" + ) + documents = reader.load_data() + + Document Store Usage ~~~~~~~~~~~~~~~~~~~~~ From 047ba08c9940f99510cdbe8e2a41203d9baad81f Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Fri, 14 Feb 2025 12:46:11 -0800 Subject: [PATCH 2/3] Update README.rst --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 850b5f9..74b25fd 100644 --- a/README.rst +++ b/README.rst @@ -115,6 +115,7 @@ Chat Store Usage A chat store serves as a centralized interface to store your chat history. .. code-block:: python + from llama_index.core.memory import ChatMemoryBuffer from llama_index_cloud_sql_pg import PostgresChatStore, PostgresEngine @@ -138,6 +139,7 @@ Document Reader Usage A Reader ingest data from different data sources and data formats into a simple `Document` representation. .. code-block:: python + from llama_index.core.memory import ChatMemoryBuffer from llama_index_cloud_sql_pg import PostgresReader, PostgresEngine From c9d61d0bfffca23b62efeb912d9c71a3392559c8 Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Tue, 18 Feb 2025 14:57:54 -0800 Subject: [PATCH 3/3] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 74b25fd..5d85589 100644 --- a/README.rst +++ b/README.rst @@ -150,7 +150,7 @@ A Reader ingest data from different data sources and data formats into a simple reader = await PostgresReader.create( engine=engine, table_name="my-db-table" ) - documents = reader.load_data() + documents = await reader.aload_data() Document Store Usage