Skip to content

Commit e78c4b5

Browse files
speedstorm1copybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 999758960
1 parent 78f6d34 commit e78c4b5

7 files changed

Lines changed: 2423 additions & 0 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Builds the API reference (https://googleapis.github.io/python-genai/) with the
2+
# pinned Sphinx in docs_src/requirements.txt and publishes it to GitHub Pages.
3+
#
4+
# Run by hand from the Actions tab for now. Publishing needs the repository's
5+
# Pages source set to "GitHub Actions"; until then, leave "deploy" unchecked to
6+
# build the site and download it as an artifact without publishing it.
7+
name: Docs
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
ref:
13+
description: Tag or branch to build, e.g. v2.31.0
14+
required: true
15+
default: main
16+
deploy:
17+
description: Publish to GitHub Pages
18+
type: boolean
19+
default: false
20+
21+
permissions:
22+
contents: read
23+
24+
concurrency:
25+
group: pages
26+
cancel-in-progress: false
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
with:
35+
ref: ${{ inputs.ref }}
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: '3.12'
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install -r requirements.txt -r docs_src/requirements.txt
46+
47+
- name: Build
48+
# conf.py adds ../google to the path, so `genai` imports from the
49+
# checkout. custom.css is copied in first, as build_and_copy_docs.sh does.
50+
# The doctree cache goes outside the site, so it is not published.
51+
run: |
52+
mkdir -p _site/_static/css
53+
cp docs_src/custom.css _site/_static/css/custom.css
54+
sphinx-build -b html -d "$RUNNER_TEMP/doctrees" docs_src _site
55+
56+
- name: Upload the site
57+
uses: actions/upload-pages-artifact@v3
58+
with:
59+
path: _site
60+
61+
deploy:
62+
if: inputs.deploy
63+
needs: build
64+
runs-on: ubuntu-latest
65+
permissions:
66+
pages: write
67+
id-token: write
68+
environment:
69+
name: github-pages
70+
url: ${{ steps.deployment.outputs.page_url }}
71+
steps:
72+
- name: Publish to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v4

‎docs_src/conf.py‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = 'Google Gen AI SDK'
10+
copyright = '2024, Google'
11+
author = 'Google'
12+
13+
# -- General configuration ---------------------------------------------------
14+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
16+
extensions = []
17+
18+
templates_path = ['_templates']
19+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
20+
21+
autoclass_content = 'both'
22+
23+
# -- Options for HTML output -------------------------------------------------
24+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
25+
26+
html_static_path = ['_static']
27+
28+
import html
29+
import os
30+
import sys
31+
sys.path.insert(0, os.path.abspath('.')) # Add current directory to path
32+
sys.path.insert(0, os.path.abspath('../google'))
33+
34+
extensions = ['sphinxcontrib.autodoc_pydantic', 'myst_parser', 'sphinx.ext.autodoc', 'sphinx_autodoc_typehints', 'sphinx.ext.napoleon']
35+
html_theme = 'furo'
36+
37+
TEXT_FONTS = '"Google Sans Text", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif'
38+
CODE_FONTS = 'Roboto Mono, "Helvetica Neue Mono", monospace'
39+
FONT_COLOR_FOR_LIGHT_THEME = 'black'
40+
FONT_COLOR_FOR_DARK_THEME = 'white'
41+
42+
html_theme_options = {
43+
"light_css_variables": {
44+
"font-stack": TEXT_FONTS,
45+
"font-stack--monospace": CODE_FONTS,
46+
"font-stack--headings": TEXT_FONTS,
47+
"color-brand-primary": FONT_COLOR_FOR_LIGHT_THEME,
48+
"color-brand-content": FONT_COLOR_FOR_LIGHT_THEME,
49+
},
50+
"dark_css_variables": {
51+
"font-stack": TEXT_FONTS,
52+
"font-stack--monospace": CODE_FONTS,
53+
"font-stack--headings": TEXT_FONTS,
54+
"color-brand-primary": FONT_COLOR_FOR_DARK_THEME,
55+
"color-brand-content": FONT_COLOR_FOR_DARK_THEME,
56+
},
57+
}
58+
59+
# These folders are copied to the documentation's HTML output
60+
html_static_path = ['_static']
61+
62+
# These paths are either relative to html_static_path
63+
# or fully qualified paths (eg. https://...)
64+
html_css_files = [
65+
'css/custom.css',
66+
]
67+
68+
autodoc_pydantic_model_show_json = True
69+
autodoc_pydantic_model_show_config_summary = False

‎docs_src/custom.css‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@import url('https://fonts.googleapis.com/css?family=Google+Sans:400,500|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700&display=swap');
2+
3+
body {
4+
font-weight: 400;
5+
}
6+
7+
h1 {
8+
font-size: 32px;
9+
font-weight: 400;
10+
}
11+
12+
h2 {
13+
font-size: 24px;
14+
font-weight: 400;
15+
}
16+
17+
h3 {
18+
font-size: 20px;
19+
font-weight: 400;
20+
}
21+
22+
h4 {
23+
font-size: 16px;
24+
font-weight: 400;
25+
}
26+
27+
.sidebar-brand-text {
28+
font-size: 14px;
29+
}
30+
31+
.highlight {
32+
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
33+
}

‎docs_src/genai.rst‎

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
Submodules
2+
----------
3+
4+
genai.client module
5+
-------------------
6+
7+
.. automodule:: genai.client
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
13+
GAOS Client Resources
14+
^^^^^^^^^^^^^^^^^^^^^
15+
16+
The following resource classes are returned by the client properties
17+
``client.interactions``, ``client.agents``, ``client.webhooks``,
18+
``client.triggers``, and ``client.environments``.
19+
20+
.. autoclass:: genai._gaos.google_genai.GeminiNextGenInteractions
21+
:members:
22+
:undoc-members:
23+
:show-inheritance:
24+
25+
.. autoclass:: genai._gaos.google_genai.AsyncGeminiNextGenInteractions
26+
:members:
27+
:undoc-members:
28+
:show-inheritance:
29+
30+
.. autoclass:: genai._gaos.google_genai.GeminiNextGenAgents
31+
:members:
32+
:undoc-members:
33+
:show-inheritance:
34+
35+
.. autoclass:: genai._gaos.google_genai.AsyncGeminiNextGenAgents
36+
:members:
37+
:undoc-members:
38+
:show-inheritance:
39+
40+
.. autoclass:: genai._gaos.google_genai.GeminiNextGenWebhooks
41+
:members:
42+
:undoc-members:
43+
:show-inheritance:
44+
45+
.. autoclass:: genai._gaos.google_genai.AsyncGeminiNextGenWebhooks
46+
:members:
47+
:undoc-members:
48+
:show-inheritance:
49+
50+
.. autoclass:: genai._gaos.google_genai.GeminiNextGenTriggers
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
.. autoclass:: genai._gaos.google_genai.AsyncGeminiNextGenTriggers
56+
:members:
57+
:undoc-members:
58+
:show-inheritance:
59+
60+
.. autoclass:: genai._gaos.google_genai.GeminiNextGenEnvironments
61+
:members:
62+
:undoc-members:
63+
:show-inheritance:
64+
65+
.. autoclass:: genai._gaos.google_genai.AsyncGeminiNextGenEnvironments
66+
:members:
67+
:undoc-members:
68+
:show-inheritance:
69+
70+
genai.live module
71+
-----------------
72+
73+
.. automodule:: genai.live
74+
:members:
75+
:undoc-members:
76+
:show-inheritance:
77+
78+
genai.models module
79+
-------------------
80+
81+
.. automodule:: genai.models
82+
:members:
83+
:undoc-members:
84+
:show-inheritance:
85+
86+
genai.tokens module
87+
-------------------
88+
89+
.. automodule:: genai.tokens
90+
:members:
91+
:undoc-members:
92+
:show-inheritance:
93+
94+
genai.tunings module
95+
--------------------
96+
97+
.. automodule:: genai.tunings
98+
:members:
99+
:undoc-members:
100+
:show-inheritance:
101+
102+
genai.types module
103+
------------------
104+
105+
.. automodule:: genai.types
106+
:members:
107+
:undoc-members:
108+
:show-inheritance:

0 commit comments

Comments
 (0)