docs: migrate chat-webpage-simple-rag cookbook to v2 API (5/N)#95
Draft
Vikrant-Khedkar wants to merge 3 commits into
Draft
docs: migrate chat-webpage-simple-rag cookbook to v2 API (5/N)#95Vikrant-Khedkar wants to merge 3 commits into
Vikrant-Khedkar wants to merge 3 commits into
Conversation
- Client -> ScrapeGraphAI (auto-reads SGAI_API_KEY) - markdownify(website_url=) -> scrape(url, formats=[MarkdownFormatConfig()]) - Drop scrapegraph_py.logger.sgai_logger (no longer exists) -> stdlib logging - Response shape: response['result'] (str) -> "\\n\\n".join(response.data.results["markdown"]["data"]) (list[str]) - Update dashboard URL: dashboard.scrapegraphai.com -> scrapegraphai.com/dashboard - Swap outdated banner image Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
1 task
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fifth of N PRs (follows #91, #92, #93, #94) restoring + migrating the cookbook notebooks that were removed in 1f3b123 to the v2 SDK API. This PR migrates
cookbook/chat-webpage-simple-rag/scrapegraph_burr_lancedb.ipynb— the heavy one (RAG pipeline with Burr + LanceDB + OpenAI + OpenTelemetry).Migration
from scrapegraph_py import Clientfrom scrapegraph_py import ScrapeGraphAI, MarkdownFormatConfigfrom scrapegraph_py.logger import sgai_loggersgai_logger.set_logging(level="INFO")logging.basicConfig(level=logging.INFO)(stdlib)Client()ScrapeGraphAI()sgai_client.markdownify(website_url=url)sgai_client.scrape(url, formats=[MarkdownFormatConfig()])response["result"](str)"\n\n".join(response.data.results["markdown"]["data"])(list[str] → joined str) +.statuscheckhttps://dashboard.scrapegraphai.com/https://scrapegraphai.com/dashboardNotable v2 response shape change
scrape()returnsresponse.data.results["markdown"]["data"]aslist[str](one element per page), not a single string like the oldmarkdownify(). Cell 15'sfetch_webpageaction now joins them with\n\nbefore passing into the chunking pipeline.Validation
jupyter nbconvert --execute— migrated cells (11, 14, 15) all run clean. Verifiedscrape()returns proper markdown; chunking + embedding (cell 22) consumes the joined string correctly. Fullapp.run()pipeline (cell 29) takes >10 min due to OpenAI embedding all chunks ofscrapegraphai.com— that's pre-existing notebook behavior, not a migration regression.Follow-ups (separate PRs, not blocking)
This completes all 5 direct-SDK notebooks. Remaining cookbook work:
langchain-scrapegraphwrapper, need separate verificationllama-index-tools-scrapegraphwrapper, need separate verification🤖 Generated with Claude Code