-
Notifications
You must be signed in to change notification settings - Fork 2
docs: visual context in intelligent contracts #298
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for genlayer-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughIntroduces 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
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
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)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
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
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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.
📒 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.jsonfile is valid, and all referenced pages—includingvisual-inputs.mdxanderror-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.
Description
Changes
pages/developers/intelligent-contracts/advanced-features/visual-inputs.mdxgl.nondet.exec_prompt(images=...)andgl.nondet.web.render(...).wait_after_loadedand when to use each mode.mode='screenshot'produces image bytes suitable forimages=[...].pages/developers/intelligent-contracts/advanced-features/_meta.jsonto add “Visual Inputs” and sort keys alphabetically.Breaking changes
Checklist
Summary by CodeRabbit