Jupyter notebook

From microsoft/ai-agents-for-beginners · View interactive version

Jupyter notebook is an AI agent skill from the GitHub repository microsoft/ai-agents-for-beginners. ใช้เมื่อผู้ใช้ร้องขอให้สร้าง จัดโครงร่าง หรือแก้ไข Jupyter notebooks (`.ipynb`) สำหรับการทดลอง การสำรวจ หรือบทแนะนำ; ควรใช้เทมเพลตที่มาพร้อมและรันสคริปต์ช่วยเหลือ `new_notebook.py` เพื่อสร้างโน้ตบุ๊กเริ่มต้นที่สะอาด

How to use this skill

Skill file

ทักษะ Jupyter Notebook

สร้างโน้ตบุ๊ก Jupyter ที่สะอาดและทำซ้ำได้สำหรับสองโหมดหลัก:

ให้ใช้เทมเพลตที่มาพร้อมและสคริปต์ช่วยเหลือเพื่อโครงสร้างที่สม่ำเสมอและลดความผิดพลาดของ JSON.

เมื่อใดควรใช้

แผนผังการตัดสินใจ

เส้นทางทักษะ (ตั้งครั้งเดียว)

export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
export JUPYTER_NOTEBOOK_CLI="$CODEX_HOME/skills/jupyter-notebook/scripts/new_notebook.py"

User-scoped skills install under $CODEX_HOME/skills (default: ~/.codex/skills).

เวิร์กโฟลว์

  1. ยืนยันความตั้งใจ.

Identify the notebook kind: experiment or tutorial.

Capture the objective, audience, and what "done" looks like.

  1. สร้างโครงจากเทมเพลต.

Use the helper script to avoid hand-authoring raw notebook JSON.

uv run --python 3.12 python "$JUPYTER_NOTEBOOK_CLI" \
  --kind experiment \
  --title "Compare prompt variants" \
  --out output/jupyter-notebook/compare-prompt-variants.ipynb
uv run --python 3.12 python "$JUPYTER_NOTEBOOK_CLI" \
  --kind tutorial \
  --title "Intro to embeddings" \
  --out output/jupyter-notebook/intro-to-embeddings.ipynb
  1. เติมโน้ตบุ๊กด้วยขั้นตอนขนาดเล็กที่รันได้.

Keep each code cell focused on one step.

Add short markdown cells that explain the purpose and expected result.

หลีกเลี่ยงผลลัพธ์ขนาดใหญ่ที่รกเมื่อสรุปสั้นๆ ก็เพียงพอ.

  1. ใช้รูปแบบที่เหมาะสม.

For experiments, follow references/experiment-patterns.md.

For tutorials, follow references/tutorial-patterns.md.

  1. แก้ไขอย่างปลอดภัยเมื่อทำงานกับโน้ตบุ๊กที่มีอยู่.

Preserve the notebook structure; avoid reordering cells unless it improves the top-to-bottom story.

Prefer targeted edits over full rewrites.

If you must edit raw JSON, review references/notebook-structure.md first.

  1. ตรวจสอบผลลัพธ์.

Run the notebook top-to-bottom when the environment allows.

If execution is not possible, say so explicitly and call out how to validate locally.

Use the final pass checklist in references/quality-checklist.md.

เทมเพลตและสคริปต์ช่วยเหลือ

Script path:

แบบแผนสำหรับไฟล์ชั่วคราวและเอาต์พุต

การพึ่งพา (ติดตั้งเฉพาะเมื่อจำเป็น)

Prefer uv for dependency management.

Optional Python packages for local notebook execution:

uv pip install jupyterlab ipykernel

The bundled scaffold script uses only the Python standard library and does not require extra dependencies.

สภาพแวดล้อม

ไม่มีตัวแปรสภาพแวดล้อมที่จำเป็น.

แผนที่อ้างอิง


<!-- CO-OP TRANSLATOR DISCLAIMER START -->

คำปฏิเสธ:

เอกสารฉบับนี้ได้รับการแปลโดยใช้บริการแปลด้วยปัญญาประดิษฐ์ Co-op Translator แม้ว่าเราจะมุ่งมั่นให้การแปลมีความถูกต้อง โปรดทราบว่าการแปลอัตโนมัติอาจมีข้อผิดพลาดหรือความคลาดเคลื่อนได้ ฉบับต้นฉบับในภาษาต้นทางควรถือเป็นแหล่งอ้างอิงหลัก สำหรับข้อมูลที่มีความสำคัญ แนะนำให้ใช้บริการแปลโดยนักแปลมืออาชีพ เราไม่รับผิดชอบต่อความเข้าใจผิดหรือการตีความที่ผิดพลาดใด ๆ ที่เกิดขึ้นจากการใช้การแปลนี้

<!-- CO-OP TRANSLATOR DISCLAIMER END -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.