Skip to content

Conversation

@epsjunior
Copy link
Contributor

@epsjunior epsjunior commented Aug 27, 2025

Description

  • Adds a new Advanced Features page documenting how to use images and webpage screenshots as visual inputs in Intelligent Contracts.
  • Cleans up navigation to include the new page and sorts entries alphabetically.

Changes

  • New page: pages/developers/intelligent-contracts/advanced-features/visual-inputs.mdx
    • Core concepts for visual inputs (images array vs. webpage screenshot).
    • Methods overview for gl.nondet.exec_prompt(images=...) and gl.nondet.web.render(...).
    • Three examples (each write and view methods):
      • Single image: store and read dominant color.
      • Multiple images: create variant (mirrored) and store identified difference.
      • Webpage screenshot: capture, analyze, and store banner text.
    • Notes on wait_after_loaded and when to use each mode.
    • Explicit note that only mode='screenshot' produces image bytes suitable for images=[...].
  • Navigation: updated pages/developers/intelligent-contracts/advanced-features/_meta.json to add “Visual Inputs” and sort keys alphabetically.

Breaking changes

  • None.

Checklist

  • Docs build successfully
  • Navigation updated and sorted
  • Examples compile syntactically and follow existing style
  • Links to references verified

Summary by CodeRabbit

  • Documentation
    • Added “Visual Inputs” guide covering how to supply images and webpage screenshots to prompts, with step-by-step examples (single image analysis, image comparison, webpage screenshot analysis), parameter tips, and troubleshooting.
    • Updated navigation: added “Visual Inputs” and removed “Error Handling”; other advanced features entries remain unchanged.

@netlify
Copy link

netlify bot commented Aug 27, 2025

Deploy Preview for genlayer-docs ready!

Name Link
🔨 Latest commit b9a43e0
🔍 Latest deploy log https://app.netlify.com/projects/genlayer-docs/deploys/68ae888f05f7ff00083f1f49
😎 Deploy Preview https://deploy-preview-298--genlayer-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

Introduces a new documentation page on visual inputs for gl.nondet and updates the advanced features navigation metadata by replacing “Error Handling” with “Visual Inputs.” The doc explains using images and webpage screenshots with exec_prompt and web.render, includes API signatures, examples, and troubleshooting.

Changes

Cohort / File(s) Summary of Changes
Navigation Metadata Update
pages/developers/intelligent-contracts/advanced-features/_meta.json
Replaced key "error-handling": "Error Handling" with "visual-inputs": "Visual Inputs". Other entries unchanged aside from ordering.
New Documentation: Visual Inputs
pages/developers/intelligent-contracts/advanced-features/visual-inputs.mdx
Added a page detailing visual input handling with gl.nondet.exec_prompt(images=[...]) and gl.nondet.web.render(..., mode='screenshot'), API signatures, examples (single image, compare images, webpage screenshot), and troubleshooting.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant GL as gl.nondet
    rect rgba(200,230,255,0.2)
    note over Dev,GL: Path A — Direct image bytes
    Dev->>GL: exec_prompt(prompt, images=[bytes, ...])
    GL-->>Dev: result (str)
    end
Loading
sequenceDiagram
    autonumber
    actor Dev as Developer
    participant Web as gl.nondet.web
    participant GL as gl.nondet
    rect rgba(220,255,220,0.2)
    note over Dev,Web: Path B — Webpage to screenshot bytes
    Dev->>Web: render(url, mode='screenshot', wait_after_loaded?)
    Web-->>Dev: screenshot (bytes)
    end
    Dev->>GL: exec_prompt(prompt, images=[screenshot])
    GL-->>Dev: result (str)
    note over Dev: For mode 'text'/'html', render returns str (not images)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble docs with whiskers bright,
New “Visual Inputs” hops to light—
Bytey pics and webpage views,
Prompted paths a bunny chews.
Click, render, compare just right—
Determinism? Carrot-tight! 🥕
Thump! The pixels pass the night.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dxp-593-visual-context-in-intelligent-contracts

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (7)
pages/developers/intelligent-contracts/advanced-features/_meta.json (2)

3-3: "Error Handling" still in nav despite PR stating it was removed.

Either remove this entry or update the PR summary. Recommend removal to match objectives.

-  "error-handling": "Error Handling",

6-6: Title-case consistency: “Working with balances” → “Working with Balances”.

Aligns with other entries’ casing.

-  "working-with-balances": "Working with balances"
+  "working-with-balances": "Working with Balances"
pages/developers/intelligent-contracts/advanced-features/visual-inputs.mdx (5)

7-8: Tighten phrasing.

“image byte arrays” → “image bytes” for clarity.

-1. Images: pass one or more image byte arrays via `images=[...]` to `gl.nondet.exec_prompt(...)`.
+1. Images: pass one or more image bytes via `images=[...]` to `gl.nondet.exec_prompt(...)`.

12-14: Minor grammar.

Add “as” for smoother read.

-- `mode='text'` and `mode='html'` return strings (not images); use them for content extraction, not visual inputs.
+- `mode='text'` and `mode='html'` return strings (not images); use them for content extraction, not as visual inputs.

25-26: Minor grammar.

Add article.

-  - **wait_after_loaded**: Optional delay after DOM load (e.g. `"1000ms"`).
+  - **wait_after_loaded**: An optional delay after DOM load (e.g. `"1000ms"`).

30-31: Minor grammar.

Clarify object reference and preposition.

-- For `images`, supply raw bytes for each image. If you have a PIL image, save to a `BytesIO` buffer in PNG/JPEG and call `getvalue()`.
+- For `images`, supply raw bytes for each image. If you have a PIL image, save it to a `BytesIO` buffer as PNG/JPEG and call `getvalue()`.

131-138: Optional: make example resilient if Pillow isn’t installed.

Add a brief note to install Pillow to avoid import errors during local runs.

-        def run() -> str:
+        def run() -> str:
+            # Requires Pillow: pip install Pillow
             import PIL.Image as Image
             from PIL import ImageOps
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between be95d21 and b9a43e0.

📒 Files selected for processing (2)
  • pages/developers/intelligent-contracts/advanced-features/_meta.json (1 hunks)
  • pages/developers/intelligent-contracts/advanced-features/visual-inputs.mdx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
pages/**/*.mdx

📄 CodeRabbit inference engine (CLAUDE.md)

pages/**/*.mdx: All content is in MDX format supporting React components
Import and use custom components within MDX files
Create .mdx file in appropriate pages/ subdirectory when adding new pages
All content should support React components in MDX files

Files:

  • pages/developers/intelligent-contracts/advanced-features/visual-inputs.mdx
pages/**/_meta.json

📄 CodeRabbit inference engine (CLAUDE.md)

pages/**/_meta.json: Navigation is controlled by _meta.json files in each directory
Edit _meta.json files to change page ordering or titles
Update corresponding _meta.json to include the new page when adding new pages

Files:

  • pages/developers/intelligent-contracts/advanced-features/_meta.json
🪛 LanguageTool
pages/developers/intelligent-contracts/advanced-features/visual-inputs.mdx

[grammar] ~7-~7: There might be a mistake here.
Context: ...=[...]togl.nondet.exec_prompt(...). 2. Webpage screenshots: call gl.nondet.web...

(QB_NEW_EN)


[grammar] ~12-~12: There might be a mistake here.
Context: ...r content extraction, not visual inputs. - If a page is JS-driven, set `wait_after_...

(QB_NEW_EN)


[grammar] ~25-~25: There might be a mistake here.
Context: ... delay after DOM load (e.g. "1000ms"). - returns: str for text/html; scre...

(QB_NEW_EN)


[grammar] ~30-~30: There might be a mistake here.
Context: ...uffer in PNG/JPEG and call getvalue(). - For webpage screenshots, use `gl.nondet....

(QB_NEW_EN)

🔇 Additional comments (2)
pages/developers/intelligent-contracts/advanced-features/_meta.json (1)

1-7: ✅ Navigation metadata validation complete
The _meta.json file is valid, and all referenced pages—including visual-inputs.mdx and error-handling.mdx—exist under
pages/developers/intelligent-contracts/advanced-features. No further changes needed.

pages/developers/intelligent-contracts/advanced-features/visual-inputs.mdx (1)

115-151: LGTM overall.

Examples clearly illustrate single image, multi-image, and screenshot flows; API notes are accurate.

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