Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
pull_request:
branches:
- main
name: docs
permissions:
contents: read # This applies to all jobs
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "3.10"
- name: Install nox
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install nox
- name: Run docs
run: |
nox -s docs
docfx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "3.10"
- name: Install nox
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install nox
- name: Run docfx
run: |
nox -s docfx
48 changes: 46 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Code samples and snippets live in the `samples/`_ folder.
.. _samples/: https://github.com/googleapis/llama-index-cloud-sql-pg-python/tree/main/samples

Vector Store Usage
~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~

Use a vector store to store embedded data and perform vector search.

Expand All @@ -109,8 +109,52 @@ 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
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~

Use a document store to make storage and maintenance of data easier.

Expand Down
1 change: 1 addition & 0 deletions docs/README.rst
20 changes: 20 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
div#python2-eol {
border-color: red;
border-width: medium;
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}

/* Insert space between methods for readability */
dl.method {
padding-top: 10px;
padding-bottom: 10px
}

/* Insert empty space between classes */
dl.class {
padding-bottom: 50px
}
50 changes: 50 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

{% extends "!layout.html" %}
{%- block content %}
{%- if theme_fixed_sidebar|lower == 'true' %}
<div class="document">
{{ sidebar() }}
{%- block document %}
<div class="documentwrapper">
{%- if render_sidebar %}
<div class="bodywrapper">
{%- endif %}

{%- block relbar_top %}
{%- if theme_show_relbar_top|tobool %}
<div class="related top">
&nbsp;
{{- rellink_markup () }}
</div>
{%- endif %}
{% endblock %}

<div class="body" role="main">
<div class="admonition" id="python2-eol">
As of January 1, 2020 this library no longer supports Python 2 on the latest released version.
Library versions released prior to that date will continue to be available. For more information please
visit <a href="https://cloud.google.com/python/docs/python2-sunset/">Python 2 support on Google Cloud</a>.
</div>
{% block body %} {% endblock %}
</div>

{%- block relbar_bottom %}
{%- if theme_show_relbar_bottom|tobool %}
<div class="related bottom">
&nbsp;
{{- rellink_markup () }}
</div>
{%- endif %}
{% endblock %}

{%- if render_sidebar %}
</div>
{%- endif %}
</div>
{%- endblock %}
<div class="clearer"></div>
</div>
{%- else %}
{{ super() }}
{%- endif %}
{%- endblock %}
1 change: 1 addition & 0 deletions docs/changelog.md
Loading