Skip to content

docs: initial SDK documentation#3

Merged
matejpekar merged 17 commits intomainfrom
mkdocs
Mar 1, 2026
Merged

docs: initial SDK documentation#3
matejpekar merged 17 commits intomainfrom
mkdocs

Conversation

@matejpekar
Copy link
Member

@matejpekar matejpekar commented Feb 2, 2026

This pull request introduces comprehensive documentation for the RationAI Python SDK, including a new MkDocs-based documentation site, quick start guides, detailed API references, and configuration for automated documentation builds. It also improves code examples and clarifies usage in the README.md. The most important changes are grouped below:

Documentation site and configuration:

  • Added a complete MkDocs documentation site with structure, navigation, and theming in mkdocs.yml, including sections for getting started, how the SDK works, and API/type references.
  • Introduced new documentation pages: docs/index.md (overview and minimal examples), docs/learn/get-started/quick-start.md (quick start and usage patterns), docs/learn/how-it-works.md (details on SDK-server communication), and reference pages for client, resources, and types. [1] [2] [3] [4] [5] [6]

Automation and dependencies:

  • Added a GitHub Actions workflow .github/workflows/mkdocs-build.yml to automate documentation builds using the standard RationAI workflow.
  • Updated pyproject.toml to include a new docs dependency group with all necessary packages for building the documentation site.

README improvements:

  • Clarified and expanded parameter documentation for all major SDK functions in README.md. [1] [2] [3] [4] [5]
  • Updated async usage examples to use Image.open(path).convert("RGB") directly, improving code clarity and ensuring correct image format. [1] [2]
  • Minor formatting and instructional improvements, such as clarifying concurrency recommendations and configuration.

These changes provide a robust foundation for users to understand, install, and use the SDK effectively, with automated and well-structured documentation.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive SDK docs: home, Quick Start, How It Works, API reference, and examples for sync/async usage, concurrency guidance, and configuration.
  • Bug Fixes
    • Updated sample code to consistently load/convert images as RGB for examples.
  • Chores
    • Added site configuration and documentation tooling.
    • Added a CI workflow to build the docs.
  • New Features
    • Simplified public imports for core resources (Models, QualityControl, Slide).

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b65617 and 86fcc26.

📒 Files selected for processing (1)
  • mkdocs.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • mkdocs.yml

📝 Walkthrough

Walkthrough

Adds MkDocs configuration and documentation pages (Quick Start, How It Works, API stubs), a docs dependency group, a GitHub Actions MkDocs build workflow, README example edits to load images as RGB, and re-exports several resource classes from rationai.resources.__init__.

Changes

Cohort / File(s) Summary
CI Workflow
​.github/workflows/mkdocs-build.yml
Adds a GitHub Actions workflow "MkDocs Build (RationAI Standard)" that triggers on pushes to main and PR events and invokes a reusable MkDocs workflow from an external repo.
Docs tooling & config
mkdocs.yml, pyproject.toml
Adds MkDocs site configuration and a docs dependency group (mkdocs, mkdocs-material, mkdocstrings[python], mike, pymdown-extensions).
Site content — landing & guides
docs/index.md, docs/learn/get-started/quick-start.md, docs/learn/how-it-works.md
Adds landing page and detailed guides documenting sync/async clients, usage examples, I/O formats, concurrency guidance, and configuration.
API reference pages
docs/reference/client.md, docs/reference/resources/models.md, docs/reference/resources/qc.md, docs/reference/types/qc.md
Adds mkdocstrings/autodoc stubs for Client/AsyncClient, Models/AsyncModels, QualityControl/AsyncQualityControl, and QC-related types.
README edits
README.md
Updates example code to load images as RGB via Image.open(...).convert("RGB") and adjusts formatting in sample blocks.
Public API re-exports
rationai/resources/__init__.py
Re-exports AsyncModels, Models, AsyncQualityControl, QualityControl, AsyncSlide, and Slide, updating __all__ to expose them at package level.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through files at morning's glow,

Wove docs and YAML in tidy rows.
Images turned RGB, imports set free,
Pages sprout where code once be.
A joyful nibble, small and spry.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: initial SDK documentation' directly and accurately reflects the main purpose of this pull request, which adds comprehensive documentation for the RationAI Python SDK.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mkdocs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @matejpekar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience for the RationAI Python SDK by providing a robust and comprehensive documentation system. It establishes a new, well-organized documentation website, complete with guides and API references, and integrates automated build processes to maintain its currency. These changes aim to streamline the onboarding process for new users and provide clear, accessible information for all developers interacting with the SDK.

Highlights

  • Comprehensive Documentation Site: Introduced a new MkDocs-based documentation site with a structured navigation, including quick start guides, detailed explanations of SDK mechanics, and API references for various modules.
  • Automated Documentation Builds: Added a GitHub Actions workflow (.github/workflows/mkdocs-build.yml) to automate the building and deployment of the documentation site, ensuring it remains up-to-date.
  • README.md Improvements: Enhanced the README.md by clarifying parameter documentation for key SDK functions and updating async usage examples for better code clarity and correctness.
  • Documentation Dependencies: Updated pyproject.toml to include a new docs dependency group, listing all necessary packages for building the documentation site.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/mkdocs-build.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive documentation site for the RationAI Python SDK using MkDocs, which is a fantastic addition. The new documentation is well-structured, with quick start guides, API references, and clear explanations of how the SDK works. The improvements to the README.md, especially fixing the code examples, are also valuable. My review found the new documentation to be of high quality. I have one minor suggestion to improve the type hints in an example for better clarity.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

23-24: ⚠️ Potential issue | 🟡 Minor

Inconsistent image loading between sync and async examples.

The synchronous Quick Start example loads the image without .convert("RGB"):

image = Image.open("path/to/image.jpg")

However, the async examples (lines 159, 185) and the docs correctly use .convert("RGB"). Since the API documentation states the image "must be uint8 RGB image" (lines 63, 75), this example should be consistent to avoid user confusion.

📝 Suggested fix
 # Load an image
-image = Image.open("path/to/image.jpg")
+image = Image.open("path/to/image.jpg").convert("RGB")
🤖 Fix all issues with AI agents
In `@docs/learn/get-started/quick-start.md`:
- Around line 94-106: The async example uses "async with" at module scope which
raises SyntaxError; wrap the usage in an async function (e.g., define async def
main(): and inside it use "async with rationai.AsyncClient() as client:" and
await client.models.classify_image("model-name", image)), then call
asyncio.run(main()) to execute it; ensure references to AsyncClient,
models.classify_image, main, and asyncio.run match the doc snippet.

In `@mkdocs.yml`:
- Around line 2-3: Update the mkdocs.yml settings: replace the GitLab values for
the keys site_url and repo_url with the repository's GitHub locations (use the
repo origin https://github.com/RationAI/rationai-sdk-python or the appropriate
GitHub repo web URL) so both site_url and repo_url point to the GitHub-hosted
repository instead of GitLab.
🧹 Nitpick comments (3)
mkdocs.yml (1)

38-44: Consider whether show_if_no_docstring: true is intentional.

With show_if_no_docstring: true, mkdocstrings will render all public members even without docstrings, which can result in sparse documentation pages. This is fine if you intend to document everything incrementally, but if the codebase has many undocumented members, consider setting this to false initially.

docs/learn/how-it-works.md (2)

73-74: Missing admonition syntax for the callout.

Line 73 appears intended as an admonition/callout but lacks the proper MkDocs syntax. Currently it will render as plain quoted text.

📝 Suggested fix using admonition syntax
-"Paths are evaluated by the server"
-`wsi_path` and `output_path` must make sense in the environment where the QC service runs (not necessarily your local machine).
+!!! warning "Paths are evaluated by the server"
+    `wsi_path` and `output_path` must make sense in the environment where the QC service runs (not necessarily your local machine).

51-51: Math notation may not render correctly.

The LaTeX-style math ($N \cdot H \cdot W$) requires the pymdownx.arithmatex extension to render properly, which isn't configured in mkdocs.yml. Without it, this will display as literal text.

Option 1: Add arithmatex to mkdocs.yml
markdown_extensions:
  # ... existing extensions ...
  - pymdownx.arithmatex:
      generic: true

extra_javascript:
  - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
Option 2: Use plain text instead
-So the server response is expected to contain exactly $N \cdot H \cdot W$ float16 values (after decompression), where $N$ is the number of output classes.
+So the server response is expected to contain exactly `N × H × W` float16 values (after decompression), where `N` is the number of output classes.

@matejpekar matejpekar requested review from a team, Adames4 and JakubPekar and removed request for JakubPekar February 26, 2026 11:17
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mkdocs.yml`:
- Line 23: The repository icon configured under theme.icon.repo in mkdocs.yml is
set to the GitLab icon ("fontawesome/brands/gitlab") while repo_url and site_url
point to GitHub, causing a mismatch; update theme.icon.repo to the correct
GitHub icon (e.g., use the appropriate FontAwesome GitHub identifier) or change
repo_url/site_url to GitLab so the icon and repository URLs match, ensuring
theme.icon.repo, repo_url, and site_url consistently reference the same
platform.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aaa7789 and 49808f4.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • .github/workflows/mkdocs-build.yml
  • README.md
  • docs/index.md
  • docs/learn/get-started/quick-start.md
  • docs/learn/how-it-works.md
  • docs/reference/client.md
  • docs/reference/resources/models.md
  • docs/reference/resources/qc.md
  • docs/reference/types/qc.md
  • mkdocs.yml
  • pyproject.toml
  • rationai/resources/__init__.py
✅ Files skipped from review due to trivial changes (2)
  • docs/reference/types/qc.md
  • .github/workflows/mkdocs-build.yml
🚧 Files skipped from review as they are similar to previous changes (6)
  • docs/index.md
  • docs/reference/resources/models.md
  • docs/reference/resources/qc.md
  • pyproject.toml
  • README.md
  • docs/learn/how-it-works.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mkdocs.yml`:
- Around line 20-26: Remove the duplicate, incomplete theme mapping: delete the
first bare "theme:" block (the standalone "theme:\n  name: material\n  icon:")
and keep the complete "theme:" mapping that includes the "icon:\n    repo:
fontawesome/brands/github" entry so there is only one valid "theme" key in the
YAML.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 49808f4 and 7b65617.

📒 Files selected for processing (1)
  • mkdocs.yml

@matejpekar matejpekar merged commit 4a4e0d5 into main Mar 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants