Skip to content

Docs/rationai sdk#2

Closed
matejpekar wants to merge 9 commits intomainfrom
docs/rationai-sdk
Closed

Docs/rationai sdk#2
matejpekar wants to merge 9 commits intomainfrom
docs/rationai-sdk

Conversation

@matejpekar
Copy link
Member

@matejpekar matejpekar commented Feb 2, 2026

Summary by CodeRabbit

  • Documentation

    • Launched comprehensive documentation site with Quick Start guides covering synchronous and asynchronous usage patterns
    • Added architecture documentation explaining SDK internals, request/response formats, and error handling
    • Introduced API reference guides for models and quality control resources
    • Updated code examples with improved image handling patterns
  • Chores

    • Configured documentation generation and CI/CD infrastructure

Copilot AI review requested due to automatic review settings February 2, 2026 12:23
@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

This pull request establishes comprehensive documentation infrastructure for the RationAI Python SDK. It introduces MkDocs configuration, creates new documentation pages covering quick starts and architecture, adds API reference documentation, updates the README with corrected code examples, and configures a GitHub Actions workflow for documentation builds.

Changes

Cohort / File(s) Summary
Documentation Content
README.md
Updated code samples to use Image.open(path).convert("RGB"), adjusted formatting with blank lines, removed concurrency guidance sentence.
Documentation Pages
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
Added comprehensive documentation including SDK overview, quick start guide, architecture/design explanation, and API reference pages for Client, Models, QC resources, and QC types using docgen directives.
Documentation Infrastructure
mkdocs.yml, pyproject.toml
Added MkDocs configuration with Material theme, plugins (search, mkdocstrings[python]), markdown extensions, and documentation dependencies (mkdocs, mkdocs-material, mkdocstrings[python], mike, pymdown-extensions).
CI/CD Configuration
.github/workflows/mkdocs-build.yml
Added GitHub Actions workflow to build and deploy MkDocs documentation on main branch pushes and pull request events.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 With whiskers twitching, pages bright,
We've hopped through docs both left and right,
New guides and references all in place,
MkDocs blooms with such good grace!
No bugs to squash, just knowledge shared,
A web of docs, oh how we've cared! 📚✨


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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 RationAI Python SDK by introducing a robust documentation system using MkDocs. It establishes a dedicated docs/ directory with detailed guides, API references, and conceptual explanations, making the SDK much easier to understand and use. The CI/CD pipeline has been updated to automate the deployment of these new documents, ensuring that the documentation remains current and accessible. Minor adjustments were also made to existing README examples to align with the new documentation's best practices for image handling.

Highlights

  • Documentation System Integration: Integrated MkDocs for generating comprehensive documentation for the RationAI Python SDK, providing detailed guides and API references.
  • CI/CD Pipeline Update: Modified the .gitlab-ci.yml to remove the Pytest template, include the MkDocs template, and change the 'test' stage to 'deploy' for automated documentation deployment.
  • Extensive Documentation Added: Introduced a new docs/ directory containing numerous new files detailing SDK usage, API references for clients and resources, and explanations of internal workings.
  • README.md Examples Refinement: Updated code examples in README.md to explicitly convert images to RGB using PIL.Image.open(...).convert("RGB") for clarity and consistency.
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 comprehensive documentation for the RationAI Python SDK, including a quick start guide, an explanation of how it works, and API references. The changes are excellent and greatly improve the project's usability. I've identified a couple of minor issues in the code examples within README.md that are missing necessary imports, and a recurring typo in the mkdocstrings syntax across the new API reference files which would prevent them from rendering correctly. Addressing these points will make the documentation perfect.

async def bounded_segment(client, path):
async with semaphore:
image = load_image(path)
image = Image.open(path).convert("RGB")

Choose a reason for hiding this comment

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

medium

The Image object from the Pillow library is used here, but from PIL import Image is missing from this code snippet. This will cause the example to fail. Please add the import at the beginning of the snippet.

async def bounded_request(client, path):
async with semaphore:
image = load_image(path)
image = Image.open(path).convert("RGB")

Choose a reason for hiding this comment

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

medium

Similar to the previous example, Image is used here without being imported. Please add from PIL import Image to make this code snippet runnable.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive MkDocs-based documentation for the RationAI Python SDK. The documentation includes user guides, API reference, and configuration for generating versioned documentation with Material for MkDocs theme.

Changes:

  • Added docs dependency group with MkDocs, mkdocs-material, mkdocstrings, and related packages
  • Created complete documentation structure with quick-start guide, conceptual documentation, and API reference
  • Updated CI pipeline to build and deploy documentation (removed unused Pytest stage)
  • Minor formatting improvements to README.md code examples

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pyproject.toml Added docs dependency group with MkDocs tooling
mkdocs.yml MkDocs configuration with Material theme and mkdocstrings for API docs
docs/index.md Landing page with minimal examples
docs/learn/get-started/quick-start.md Comprehensive quick-start guide with sync/async examples
docs/learn/how-it-works.md Technical documentation explaining SDK internals
docs/reference/client.md API reference for Client and AsyncClient
docs/reference/resources/models.md API reference for Models resources
docs/reference/resources/qc.md API reference for QC resources
docs/reference/types/qc.md API reference for QC types
README.md Fixed code examples and formatting (whitespace cleanup)
.gitlab-ci.yml Removed unused Pytest stage, added MkDocs deployment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


The SDK retries up to 3 times **only for HTTP 500** responses (using `tenacity`).

"Paths are evaluated by the server"
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

This appears to be a section heading but isn't formatted as one. It should either be formatted as a heading (e.g., #### Paths are evaluated by the server) or integrated into the paragraph below as regular text without quotes.

Suggested change
"Paths are evaluated by the server"
#### Paths are evaluated by the server

Copilot uses AI. Check for mistakes.

### Input image requirements

- The server expects an **uint8 RGB** image.
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Grammar error: should be "a uint8" not "an uint8" because "uint8" is pronounced starting with a consonant sound ("you-int-eight").

Suggested change
- The server expects an **uint8 RGB** image.
- The server expects a **uint8 RGB** image.

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +30
result = client.models.classify_image("model-name", image)
print(result)
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Code blocks should use spaces for indentation, not tabs. The rest of the codebase and documentation (including quick-start.md and README.md) consistently uses spaces. Please replace tabs with 4 spaces to maintain consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +42
xopat_url = client.qc.check_slide(
wsi_path="/data/slides/slide.svs",
output_path="/data/qc-output/slide-001",
)
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Code blocks should use spaces for indentation, not tabs. The rest of the codebase and documentation (including quick-start.md and README.md) consistently uses spaces. Please replace tabs with 4 spaces to maintain consistency.

Copilot uses AI. Check for mistakes.
- PIL: `image.size` → `(width, height)`
- NumPy: `image.shape[:2]` → `(height, width)`

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.
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

LaTeX math notation ($N \cdot H \cdot W$) will not render properly in MkDocs without math support. Either add pymdownx.arithmatex to the markdown_extensions in mkdocs.yml, or replace this with plain text like "N * H * W" or "N × H × W".

Suggested change
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.

Copilot uses AI. Check for mistakes.
- `output_path`: where masks should be written
- configuration flags from `SlideCheckConfig`

The SDK retries up to 3 times **only for HTTP 500** responses (using `tenacity`).
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

This statement is inconsistent with line 100 which correctly states "up to 3 attempts". With tenacity's stop_after_attempt(3), the SDK will make up to 3 attempts total (1 initial + 2 retries), not retry 3 times (which would be 4 total attempts). Change "retries up to 3 times" to either "attempts up to 3 times" or "retries up to 2 times" to match line 100 and the actual implementation.

Suggested change
The SDK retries up to 3 times **only for HTTP 500** responses (using `tenacity`).
The SDK makes up to 3 attempts **only for HTTP 500** responses (using `tenacity`).

Copilot uses AI. Check for mistakes.
@matejpekar matejpekar closed this Feb 2, 2026
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.

1 participant