Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: new build process with rtd and API documentation #1474

Merged
merged 13 commits into from
Oct 13, 2024
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,3 @@ experiments/
**/fil-result/
src/ragas/_version.py
.vscode
/docs/references/
22 changes: 13 additions & 9 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.12"
commands:
- pip install -e .[docs]
- python scripts/gen_ref_pages.py
- mkdocs build --site-dir $READTHEDOCS_OUTPUT/html

mkdocs:
configuration: mkdocs.yml
# mkdocs:
# configuration: mkdocs.yml

python:
install:
- method: pip
path: .
extra_requirements:
- docs
# python:
# install:
# - method: pip
# path: .
# extra_requirements:
# - docs
3 changes: 3 additions & 0 deletions docs/references/embeddings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
::: ragas.embeddings
options:
members_order: "source"
1 change: 1 addition & 0 deletions docs/references/evaluate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: ragas.evaluation.evaluate
12 changes: 12 additions & 0 deletions docs/references/evaluation_schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
::: ragas.dataset_schema
options:
members_order: "source"

::: ragas.messages
options:
members_order: "source"

::: ragas.evaluation.Result
options:
show_root_heading: True

6 changes: 6 additions & 0 deletions docs/references/executor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
::: ragas.executor
options:
members:
- Executor
- run_async_batch
- is_event_loop_running
1 change: 1 addition & 0 deletions docs/references/generate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: ragas.testset.synthesizers.generate
1 change: 1 addition & 0 deletions docs/references/graph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: ragas.testset.graph
18 changes: 18 additions & 0 deletions docs/references/integrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
::: ragas.integrations.langchain
options:
show_root_heading: true
::: ragas.integrations.langsmith
options:
show_root_heading: true

::: ragas.integrations.llama_index
options:
show_root_heading: true

::: ragas.integrations.opik
options:
show_root_heading: true

::: ragas.integrations.helicone
options:
show_root_heading: true
3 changes: 3 additions & 0 deletions docs/references/llms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
::: ragas.llms
options:
members_order: "source"
5 changes: 5 additions & 0 deletions docs/references/metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
::: ragas.metrics.base
options:
members_order: "source"

::: ragas.metrics
12 changes: 12 additions & 0 deletions docs/references/prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

::: ragas.prompt
options:
members:
- BasePrompt
- StringPrompt
- InputModel
- OutputModel
- PydanticPrompt
- BoolIO
- StringIO
- PromptMixin
1 change: 1 addition & 0 deletions docs/references/run_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: ragas.run_config
1 change: 1 addition & 0 deletions docs/references/synthesizers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: ragas.testset.synthesizers
26 changes: 26 additions & 0 deletions docs/references/testset_schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
::: ragas.testset.synthesizers.testset_schema
options:
members_order: "source"

::: ragas.testset.synthesizers.base
options:
members:
- QueryLength
- QueryStyle

::: ragas.testset.synthesizers.base.Scenario

::: ragas.testset.synthesizers.base
options:
members:
- BaseScenario

::: ragas.testset.synthesizers.specific_query.SpecificQueryScenario
options:
show_root_heading: True
show_root_full_path: False

::: ragas.testset.synthesizers.abstract_query.AbstractQueryScenario
options:
show_root_heading: True
show_root_full_path: False
1 change: 1 addition & 0 deletions docs/references/transforms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: ragas.testset.transforms
45 changes: 37 additions & 8 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,32 @@ nav:
- howtos/applications/index.md
- Integrations:
- howtos/integrations/index.md
- 📖 References: references/
- 📖 References:
- Core:
- Prompt: references/prompt.md
- LLMs: references/llms.md
- Embeddings: references/embeddings.md
- RunConfig: references/run_config.md
- Executor: references/executor.md
- Evaluation:
- Schemas: references/evaluation_schema.md
- Metrics: references/metrics.md
- evaluate(): references/evaluate.md
- Testset Generation:
- Schemas: references/testset_schema.md
- Graph: references/graph.md
- Transforms: references/transforms.md
- Synthesizers: references/synthesizers.md
- Generation: references/generate.md
- Integrations: references/integrations.md
- ❤️ Community: community/index.md

# https://www.mkdocs.org/user-guide/configuration/#validation
# validation:
# omitted_files: warn
# absolute_links: warn
# unrecognized_links: warn

# Material-Docs Theme
theme:
name: material
Expand Down Expand Up @@ -122,9 +145,9 @@ theme:
- announce.dismiss
- navigation.tabs
- navigation.instant
- navigation.path
- navigation.instant.prefetch
- navigation.instant.progress
- navigation.path
- navigation.sections
- navigation.top
- navigation.tracking
Expand Down Expand Up @@ -180,23 +203,29 @@ plugins:
- mkdocstrings:
handlers:
python:
paths: [src]
options:
docstring_style: numpy
members_order: source
separate_signature: true
filters: ["!^_"]
docstring_options:
ignore_init_summary: true
merge_init_into_class: true
show_signature_annotations: true
signature_crossrefs: true
- mkdocs-jupyter:
execute: false
include: ["*.ipynb"]
ignore: ["*.md"]
# include: ["*.ipynb"]
ignore: ["*.md", "*.ipynb"]
jupyter_options:
hide_input: false
hide_output: false
code_folding: true
code_line_numbers: true
jupyter_images: true
jupyter_table_beautifier: true
- glightbox
- literate-nav:
nav_file: SUMMARY.md
- section-index
# - glightbox

extra_javascript:
- _static/js/mathjax.js
Expand Down
5 changes: 4 additions & 1 deletion scripts/gen_ref_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
from pathlib import Path

import mkdocs_gen_files
from mkdocs_gen_files.nav import Nav

logger = logging.getLogger(__name__)

nav = mkdocs_gen_files.Nav()
nav = Nav()
root = Path(__file__).parent.parent
src = root / "src"
src_ragas = root / "src" / "ragas"
Expand All @@ -24,8 +25,10 @@
parts = parts[:-1]
# doc_path = doc_path.with_name("index.md")
# full_doc_path = full_doc_path.with_name("index.md")

elif parts[-1] == "__main__":
continue

elif parts[-1][0] == "_": # Skip private modules
continue

Expand Down
2 changes: 0 additions & 2 deletions src/ragas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from ragas.adaptation import adapt
from ragas.dataset_schema import EvaluationDataset, MultiTurnSample, SingleTurnSample
from ragas.evaluation import evaluate
from ragas.run_config import RunConfig
Expand All @@ -11,7 +10,6 @@

__all__ = [
"evaluate",
"adapt",
"RunConfig",
"__version__",
"SingleTurnSample",
Expand Down
38 changes: 0 additions & 38 deletions src/ragas/adaptation.py

This file was deleted.

Loading
Loading