Skip to content

Commit 7b39d29

Browse files
authored
docs: Add API reference docs (#71)
* api doc * fix typo * typo * change changelog to .md * change _ to - in config.py * fix sphinx syntax for docstrings * vertex ai model_name * fix comments * change readme.md to readme.rst * modify publish-docs.sh * correct links * test
1 parent 6fb236a commit 7b39d29

File tree

24 files changed

+967
-161
lines changed

24 files changed

+967
-161
lines changed

.github/header-checker-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ sourceFileExtensions:
99
- "proto"
1010
- "Dockerfile"
1111
- "py"
12-
- "html"
1312
- "text"
1413
ignoreFiles:
1514
- ".github/release-please.yml"
1615
- ".github/release-trigger.yml"
1716
- ".github/header-checker-lint.yml"
1817
- ".github/sync-repo-settings.yaml"
18+
- ".github/workflows/docs.yml"
1919
- ".kokoro/**"
2020
- "**/requirements.txt"
2121
- "**/requirements-test.txt"

.github/workflows/docs.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
name: docs
6+
jobs:
7+
docs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Setup Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.9"
16+
- name: Install nox
17+
run: |
18+
python -m pip install --upgrade setuptools pip wheel
19+
python -m pip install nox
20+
- name: Run docs
21+
run: |
22+
nox -s docs
23+
docfx:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Setup Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.10"
32+
- name: Install nox
33+
run: |
34+
python -m pip install --upgrade setuptools pip wheel
35+
python -m pip install nox
36+
- name: Run docfx
37+
run: |
38+
nox -s docfx

.kokoro/docker/docs/requirements.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nox

.kokoro/docker/docs/requirements.txt

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --generate-hashes requirements.in
6+
#
7+
argcomplete==3.3.0 \
8+
--hash=sha256:c168c3723482c031df3c207d4ba8fa702717ccb9fc0bfe4117166c1f537b4a54 \
9+
--hash=sha256:fd03ff4a5b9e6580569d34b273f741e85cd9e072f3feeeee3eba4891c70eda62
10+
# via nox
11+
colorlog==6.8.2 \
12+
--hash=sha256:3e3e079a41feb5a1b64f978b5ea4f46040a94f11f0e8bbb8261e3dbbeca64d44 \
13+
--hash=sha256:4dcbb62368e2800cb3c5abd348da7e53f6c362dda502ec27c560b2e58a66bd33
14+
# via nox
15+
distlib==0.3.8 \
16+
--hash=sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784 \
17+
--hash=sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64
18+
# via virtualenv
19+
filelock==3.14.0 \
20+
--hash=sha256:43339835842f110ca7ae60f1e1c160714c5a6afd15a2873419ab185334975c0f \
21+
--hash=sha256:6ea72da3be9b8c82afd3edcf99f2fffbb5076335a5ae4d03248bb5b6c3eae78a
22+
# via virtualenv
23+
nox==2024.4.15 \
24+
--hash=sha256:6492236efa15a460ecb98e7b67562a28b70da006ab0be164e8821177577c0565 \
25+
--hash=sha256:ecf6700199cdfa9e5ea0a41ff5e6ef4641d09508eda6edb89d9987864115817f
26+
# via -r requirements.in
27+
packaging==24.0 \
28+
--hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5 \
29+
--hash=sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9
30+
# via nox
31+
platformdirs==4.2.1 \
32+
--hash=sha256:031cd18d4ec63ec53e82dceaac0417d218a6863f7745dfcc9efe7793b7039bdf \
33+
--hash=sha256:17d5a1161b3fd67b390023cb2d3b026bbd40abde6fdb052dfbd3a29c3ba22ee1
34+
# via virtualenv
35+
virtualenv==20.26.1 \
36+
--hash=sha256:604bfdceaeece392802e6ae48e69cec49168b9c5f4a44e483963f9242eb0e78b \
37+
--hash=sha256:7aa9982a728ae5892558bff6a2839c00b9ed145523ece2274fad6f414690ae75
38+
# via nox

.kokoro/docs/common.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ env_vars: {
3232
key: "V2_STAGING_BUCKET"
3333
# Push non-cloud library docs to `docs-staging-v2-staging` instead of the
3434
# Cloud RAD bucket `docs-staging-v2`
35-
value: "docs-staging-v2-staging"
35+
value: "docs-staging-v2"
3636
}
3737

3838
# It will upload the docker image after successful builds.

.kokoro/publish-docs.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ python3 -m nox --version
2727
# build docs
2828
nox -s docs
2929

30-
VERSION=$(python -c "import langchain_google_cloud_sql_mysql;print(langchain_google_cloud_sql_mysql.__version__)")
30+
python3 -m pip install .
31+
VERSION=$(python3 -c "import langchain_google_cloud_sql_mysql;print(langchain_google_cloud_sql_mysql.__version__)")
3132

3233
# create metadata
3334
python3 -m docuploader create-metadata \

.trampolinerc

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Add required env vars here.
16+
required_envvars+=(
17+
)
18+
19+
# Add env vars which are passed down into the container here.
20+
pass_down_envvars+=(
21+
"NOX_SESSION"
22+
###############
23+
# Docs builds
24+
###############
25+
"STAGING_BUCKET"
26+
"V2_STAGING_BUCKET"
27+
##################
28+
# Samples builds
29+
##################
30+
"INSTALL_LIBRARY_FROM_SOURCE"
31+
"RUN_TESTS_SESSION"
32+
"BUILD_SPECIFIC_GCLOUD_PROJECT"
33+
# Target directories.
34+
"RUN_TESTS_DIRS"
35+
# The nox session to run.
36+
"RUN_TESTS_SESSION"
37+
)
38+
39+
# Prevent unintentional override on the default image.
40+
if [[ "${TRAMPOLINE_IMAGE_UPLOAD:-false}" == "true" ]] && \
41+
[[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then
42+
echo "Please set TRAMPOLINE_IMAGE if you want to upload the Docker image."
43+
exit 1
44+
fi
45+
46+
# Define the default value if it makes sense.
47+
if [[ -z "${TRAMPOLINE_IMAGE_UPLOAD:-}" ]]; then
48+
TRAMPOLINE_IMAGE_UPLOAD=""
49+
fi
50+
51+
if [[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then
52+
TRAMPOLINE_IMAGE=""
53+
fi
54+
55+
if [[ -z "${TRAMPOLINE_DOCKERFILE:-}" ]]; then
56+
TRAMPOLINE_DOCKERFILE=""
57+
fi
58+
59+
if [[ -z "${TRAMPOLINE_BUILD_FILE:-}" ]]; then
60+
TRAMPOLINE_BUILD_FILE=""
61+
fi

README.md

-122
This file was deleted.

0 commit comments

Comments
 (0)