Skip to content

Improve practical examples and reader setup guidance - #38

Draft
3lf wants to merge 3 commits into
docs/base-rag-capstonefrom
docs/base-examples-reader-flow
Draft

3lf wants to merge 3 commits into
docs/base-rag-capstonefrom
docs/base-examples-reader-flow

Conversation

@3lf

@3lf 3lf commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Complete the reader setup and Python/shell prerequisites, keep the install commands compatible with the preceding examples, and repair the tone, café-refinement and neutral-question examples. Separate the example rule from fixed data and restore the three missing Decisions subsection links in the table of contents.

Consolidate the duplicate Persian-model section into the specialist-model discussion with its source links, same-task multilingual comparison, and local-resource/license caveats. This is an intentional content consolidation as well as a reader-flow change. This draft depends on #37 and targets docs/base-rag-capstone.

  • Source validation at 53ccb01f7fb80ed9e4754e1ff278520a9dcb5f8a: 79 Node tests, source/anchor QA, volatile-data checks and workflow lint. CI.
  • 44 cumulative committed Python checks pass in Python 3.12; all documented Python/Bash fences receive syntax checks. The separate fresh-install/offline-import smoke covers the stated dependencies; execution on every supported OS/Python version is not claimed.
  • Source headings change 363 → 362 and internal links 205 → 213. PDF headings keep their separate inventory; the heading reduction comes from the explicitly merged duplicate section.
  • Stock normal/print/high outputs each contain 305 pages. Retain exact measured inventories and the inherited 310-page ceiling; automated PDF QA renders every page, with focused human review of changed examples and figures.

This update keeps the existing PR Draft. No merge or release is included.

@3lf 3lf left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Independent review of the #33 to #39 stack at 4284f85: needs changes, priority high.

The install section is not enough to run the book's code: langchain, Python 3.10+ and Windows setup are missing (WRAP-006). Also the tone example (WRAP-049) and the Persian models section removed without saying so (WRAP-051).

Size: this PR takes README.md from 546,289 to 553,136 bytes (+6,847). The README panel on the repo page only renders about the first 512,000 bytes, and main was already over that. Details and options in the #33 review, under "Stack level".

Line numbers inside the findings refer to the stack head (b779ae9) unless another commit is named; each link points to the line in this PR.

4 findings are inline threads on this diff.

The 5 findings below are nits, or on lines this PR does not change but within its topic:

Minor

  • WRAP-048 · README.md:156 · pre-existing
    The table of contents lists only subsections 2, 4 and 5 of the «مدل‌های تصمیم‌گیری» chapter; 1 (line 2842), 3 (line 2893) and 6 (line 2962) are missing. A list that starts at 2 and skips 3 tells the reader something is missing and makes navigation harder.
    Suggested fix: Add these three lines, in order: «* ۱. اینجا مدل قراره چی رو انتخاب کنه؟ 🧭 🔗 (#۱-اینجا-مدل-قراره-چی-رو-انتخاب-کنه-)», «* ۳. مدل این انتخاب رو چطور می‌سازه؟ ⚙️ 🔗 (#۳-مدل-این-انتخاب-رو-چطور-می‌سازه-️)» and «* ۶. برای کار تو کدوم راه مناسب‌تره؟ ⚖️ 🔗 (#۶-برای-کار-تو-کدوم-راه-مناسب‌تره-️)».
Nits (4)
  • WRAP-118 · README.md:1010 · new in #38
    Under «داده ثابت» ("fixed data"), the instruction «اطلاعات تازه‌ای اضافه نکن» ("don't add new information") sits inside the data itself, which is exactly what section 1 of this chapter (lines 629 to 651, «دستور و داده رو قاطی نکن!») says not to do. Beginners will copy this pattern.
    Suggested fix: Move the instruction out: «# قانون ثابت برای هر سه تلاش: اطلاعات تازه‌ای اضافه نکن.», and under «# داده ثابت» keep only: «کافه «صبح» شنبه ساعت ۸ افتتاح می‌شه؛ آدرس: خیابان بهار، پلاک ۱۲.»
  • WRAP-119 · README.md:1610 · new in #38
    The book never numbers its chapters (the TOC and headings are unnumbered), and this is the only numeric chapter reference in the whole README. Readers have to count chapters themselves, and depending on whether they count «مقدمه» (Introduction) and «فهرست مطالب» (Table of Contents), they may land on the wrong one.
    Suggested fix: Refer to the section by name: «# OpenAI + NumPy؛ برای مثال امبدینگ (بخش «چطوری کار می‌کنن؟») هم لازمن»
  • WRAP-120 · README.md:2124 · new in #38
    PR #38 renames this example's heading and explanations to «دسته‌بندی تیکت» (lines 2064 and 2095, heading at 6302), but «طبقه‌بندی» is still used inside the same examples (2124 «این تیکت رو طبقه‌بندی کن», 6305 «تو یه سیستم طبقه‌بندی تیکت‌های پشتیبانی هستی», 2093 «تو طبقه‌بندی»). Both words mean classification, so readers may think these are two different tasks.
    Suggested fix: Either change both places inside the examples to «دسته‌بندی» («# حالا این تیکت رو دسته‌بندی کن:» and «تو یه سیستم دسته‌بندی تیکت‌های پشتیبانی هستی.»), or introduce it once as «دسته‌بندی (طبقه‌بندی، Classification)» and use one term after that.
  • WRAP-121 · README.md:3879 · new in #38
    The quotation marks contain a sentence that is not in the example above: prompt 2 (line 3873) was «با این قانون، برای سفارش سه روز پیش دیگه برای مرجوعی دیر شده؟», without «درسته؟». Also, «قانون و تاریخ خرید رو بده» ("give the rule and the purchase date") recommends something both example prompts already had («با این قانون» and «سه روز پیش»); the real difference is how leading the question is.
    Suggested fix: Suggested wording: «۱. سوال رو بی‌طرفانه بنویس: به جای «دیگه برای مرجوعی دیر شده؟»، بپرس «طبق این قانون، برای سفارش سه روز پیش وضعیت درخواست مرجوعی چیه؟».»

Comment thread README.md Outdated
> **ادبی/شاعرانه:** «هوش مصنوعی، چهره جهان را دگرگون می‌سازد.»
>
> **محاوره‌ای خودمونی:** «ببین، این هوش مصنوعیه داره همه‌چی رو زیر و رو می‌کنه! یه چیزایی داره میاد که باورت نمی‌شه.»
> **محاوره‌ای خودمونی:** «ببین، هوش مصنوعی داره دنیا رو عوض می‌کنه.»

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Minor (incomplete fix in #38) · WRAP-049

This PR's fix keeps the information, but the input sentence (line 782) is already conversational, so the «پاسخ خودمونی» (casual answer) is almost the same as the input, just with «ببین» added and «تکنولوژی» removed. The example no longer shows a difference in tone, which defeats its purpose.

Suggested fix: Make the input formal and neutral so the two outputs really differ, for example the input «جمله: "فناوری هوش مصنوعی در حال دگرگون‌کردن جهان است."» and the casual output «ببین، هوش مصنوعی داره دنیا رو زیرورو می‌کنه.»

Comment thread README.md Outdated

هر سه خروجی زمان و آدرس یکسانی دارن؛ چیزی که عوض کردیم، هدف و لحن پیامه. حالا می‌تونی چک کنی جمله آخر هم خبر افتتاح رو می‌رسونه، هم با صفحه کافه جور درمیاد.

ببین چطور با هر بار اصلاح، خروجی بهتر شد؟ **نکته حرفه‌ای:** یه دفترچه (حتی یه فایل ساده) داشته باش و پرامپت‌هایی که خوب جواب دادن رو توش ذخیره کن؛ دفعه بعد لازم نیست از صفر شروع کنی! 📓

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Minor (new in #38) · WRAP-050

PR #38 replaces the coffee example (bad, then medium, then good output) with the café example but keeps the sentence that follows it. In the new example, the outputs of attempt 1 («... افتتاح خواهد شد.») and attempt 2 («... افتتاح می‌شود.») are practically the same: attempt 1 has no visible flaw, and the «قالب روشن‌تره» ("clearer format") label is not reflected in the output. So «با هر بار اصلاح، خروجی بهتر شد» ("each fix made the output better") does not match the example, and the section's main lesson (find one specific flaw and fix it, the loop in figure vis-06) never shows.

Suggested fix: Either make attempt 1 genuinely flawed, for example «خروجی: "کافه صبح، یه کافه دنج با قهوه‌های خاص، به‌زودی تو خیابان بهار باز می‌شه!" (ساعت جا افتاده و "قهوه‌های خاص" تو داده نبود)» (the time is missing and the specialty coffees are not in the data), or change the sentence at line 1027 to: «ببین هر تلاش چطور یه چیز مشخص رو روشن کرد: اول قالب، بعد مخاطب و لحن.»

Comment thread README.md Outdated
pip install openai numpy

# LangChain؛ برای نمونه سریع قالب JSON
pip install "langchain-openai>=1.6.3" langchain-core

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Major (pre-existing) · WRAP-006

The two agent examples (lines 2261 and 3094) use the langchain package, but no install command earlier in the book installs it. The setup section (line 1614) installs only langchain-openai and langchain-core, and line 2625 only langchain-openai and pydantic. Line 60 (added in PR #38) tells readers the library installs are in the setup section, so a reader who runs exactly that hits ModuleNotFoundError. The note at line 2292 only says «LangChain نسخه ۱ به بالا» (LangChain 1 or later) and gives no pip command.

Suggested fix: In the setup section (lines 1613 and 1614), write «# LangChain؛ برای نمونه قالب JSON، فراخوانی ابزار و ایجنت‌ها» and change the command to pip install "langchain>=1" "langchain-openai>=1.6.3" langchain-core. At minimum, add a line above the example at line 2260: «برای این مثال بسته langchain هم لازمه: pip install "langchain>=1" "langchain-openai>=1.6.3"».

Comment thread README.md
### مدل‌های تخصصی فارسی چی؟ 🧿

چند تیم ایرانی مدل‌های متن‌باز رو با داده فارسی فاین‌تیون کردن؛ شناخته‌شده‌ترها: **[Dorna2](https://huggingface.co/PartAI/Dorna2-Llama3.1-8B-Instruct)** (از Part AI، روی پایه Llama 3.1) و **PersianMind** (دانشگاه تهران، با واژگان گسترش‌یافته فارسی). واقعیت صادقانه: برای اکثر کارها، مدل‌های چندزبانه بزرگ هنوز فارسیِ بهتری از مدل‌های تخصصی کوچیک تحویل می‌دن؛ مدل‌های تخصصی بیشتر برای پژوهش، اجرای کاملاً لوکال یا فاین‌تیون اختصاصی روی داده خودت جذابن. برای رصد وضعیت، لیدربورد [Open Persian LLM Leaderboard](https://huggingface.co/spaces/PartAI/open-persian-llm-leaderboard) رو ببین.
مدل‌هایی هم مشخصاً با داده فارسی سازگار شدن؛ مثل **[Dorna2](https://huggingface.co/PartAI/Dorna2-Llama3.1-8B-Instruct)** از PartAI، روی پایه Llama 3.1 هشت‌میلیاردی، و **[PersianMind](https://huggingface.co/universitytehran/PersianMind-v1.0)** از دانشگاه تهران با واژگان گسترش‌یافته فارسی. تو پژوهش‌های ۲۰۲۵ هم **[Persian-Phi](https://arxiv.org/abs/2512.07454)** و **[Matina](https://aclanthology.org/2025.findings-acl.1074/)** نمونه‌های دیگه‌ان.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Minor (new in #38) · WRAP-051

PR #38 removes the whole «مدل‌های فارسی‌زبان متن‌باز» section (the H3 heading and two paragraphs) and merges a summary of it into «مدل‌های تخصصی فارسی چی؟». It also adds three new external links (PersianMind, Persian-Phi, Matina) and drops two recommendations: «برای خیلی از کارها یه مدل چندزبانه قوی (Qwen یا Gemma) هم‌تراز یا بهتره» (for many tasks a strong multilingual model is as good or better) and «اگه حریم خصوصی و اجرای کاملاً لوکال مهمه، یه مدل فارسیِ سبک عالیه» (if privacy and fully local execution matter, a lightweight Persian model is a great choice). The PR body only says "synchronize the affected heading", and the PR's topic (examples, prerequisites, reading path) does not match this change; it belongs in #33 (models) or #39 (Persian). The drop in headings from 362 to 361 and subheadings from 296 to 295 is exactly this removal.

Suggested fix: Either move this merge to #39 or #33, or have the #38 body say it explicitly, for example: "The duplicate section «مدل‌های فارسی‌زبان متن‌باز» was merged into «مدل‌های تخصصی فارسی چی؟»; three source links were added; the advice to compare against a multilingual model was kept as «با نمونه‌های واقعی کارت مقایسه کن» (compare on real samples of your task)." Dropping the privacy recommendation is a content decision for the owner.

@3lf
3lf force-pushed the docs/base-examples-reader-flow branch from 4284f85 to c9dfc78 Compare November 9, 2026 18:44
@3lf
3lf force-pushed the docs/base-rag-capstone branch from 4b33f3e to 95f238e Compare November 9, 2026 18:44
@3lf
3lf force-pushed the docs/base-rag-capstone branch from 95f238e to f224653 Compare November 9, 2026 19:23
@3lf
3lf force-pushed the docs/base-examples-reader-flow branch from c9dfc78 to 53ccb01 Compare November 9, 2026 19:23
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