Skip to content

docs: initial SDK documentation#3

Open
matejpekar wants to merge 14 commits intomainfrom
mkdocs
Open

docs: initial SDK documentation#3
matejpekar wants to merge 14 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, new home/quick-start/how-it-works pages, API reference, examples for sync/async usage, and guides on concurrency and configuration.
  • Bug Fixes
    • Sample code updated to ensure images are converted to RGB before processing.
  • Chores
    • Added docs site configuration, documentation tooling, and a CI workflow to build the docs.
  • New Features
    • Simplified public imports for core resources (Models, QualityControl, Slide).

@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

Warning

Rate limit exceeded

@Jurgee has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds MkDocs site configuration, multiple new documentation pages and API reference stubs, a docs dependency group in pyproject, a GitHub Actions workflow to run MkDocs, minor README image-preprocessing edits, 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 that triggers on pushes to main and PR events and invokes a reusable MkDocs build 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, 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, Quick Start, and How It Works guides describing sync/async clients, usage examples, request/response formats, and concurrency guidance.
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 types.
README edits
README.md
Formatting adjustments and replaces load_image(path) with Image.open(path).convert("RGB") in async image examples to ensure RGB input before model calls.
Public API re-exports
rationai/resources/__init__.py
Re-exports AsyncModels, Models, AsyncQualityControl, QualityControl, AsyncSlide, and Slide via __all__, exposing them at package level.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through files at dawn's first light,

Wove docs and YAML through the night.
Pages bloomed and imports align,
Images now RGB — colors fine.
A tiny hop, a joyous write.

🚥 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 clearly summarizes the main change: initial SDK documentation is being added across multiple files including MkDocs configuration, documentation pages, and workflow automation.
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

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

@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.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link

@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.

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.

2 participants