Chuyển đến nội dung
Skillpedia
PDF, Word và slide7.8k · #12950

pptx-validation-fallback

Skill này làm gì

Skill này là phương án dự phòng để kiểm tra file .pptx bằng python-pptx. Nó dành cho những người cần xác nhận số slide và tiêu đề của một bài thuyết trình mà công cụ đọc file không xử lý được.

Khi nào nên dùng

  • ✓Khi read_file lỗi hoặc trả về thông tin chưa đầy đủ với một file PowerPoint.
  • ✓Khi bạn cần kiểm tra bài thuyết trình có đúng số slide như mong đợi.
  • ✓Khi bạn muốn liệt kê tiêu đề các slide để xem lại.

Liên kết skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pptx-validation-fallback/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pptx-validation-fallback/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Kiểm tra giúp bài thuyết trình của tôi có mười slide và liệt kê tiêu đề của từng slide. Trình đọc file thông thường không hoạt động với file này.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI chạy một script python-pptx qua shell để mở bài thuyết trình, in số slide và từng tiêu đề, rồi so sánh số lượng với số slide mong đợi.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

PowerPoint Validation Fallback

When to Use

Use this skill when read_file fails to properly read or validate PowerPoint (.pptx) files. This provides a reliable alternative for verifying presentation contents including slide count, titles, and structure.

Procedure

Step 1: Check if read_file Failed

If read_file with filetype pptx returns errors, incomplete content, or cannot extract slide information, proceed to the fallback method.

Step 2: Use run_shell with python-pptx

Execute Python code via run_shell using the python-pptx library to inspect the presentation:

from pptx import Presentation

# Load the presentation
prs = Presentation('path/to/file.pptx')

# Get basic info
slide_count = len(prs.slides)
print(f"Total slides: {slide_count}")

# Extract slide titles
for i, slide in enumerate(prs.slides):
    if slide.shapes.title:
        title = slide.shapes.title.text
        print(f"Slide {i+1}: {title}")
    else:
        print(f"Slide {i+1}: [No title]")

Step 3: Validate Structure

Check that the presentation meets expected requirements:

from pptx import Presentation

prs = Presentation('path/to/file.pptx')

# Validation checks
expected_slides = 10  # Adjust based on requirements
actual_slides = len(prs.slides)

if actual_slides >= expected_slides:
    print(f"✓ Slide count OK: {actual_slides} slides")
else:
    print(f"✗ Insufficient slides: {actual_slides}/{expected_slides}")

# Check for content on each slide
for i, slide in enumerate(prs.slides):
    has_title = slide.shapes.title is not None
    has_content = len(slide.shapes) > 1
    print(f"Slide {i+1}: title={has_title}, content={has_content}")

Step 4: Extract Detailed Content (Optional)

For deeper validation, extract text content from all shapes:

from pptx import Presentation

prs = Presentation('path/to/file.pptx')

for i, slide in enumerate(prs.slides):
    print(f"\n=== Slide {i+1} ===")
    for shape in slide.shapes:
        if hasattr(shape, "text") and shape.text.strip():
            print(shape.text)

Expected Output

Successful validation should provide:

  • Confirmed slide count
  • List of slide titles
  • Verification that each slide has expected content structure

Common Use Cases

  • Verifying generated presentations have correct number of slides
  • Confirming slide titles match required topics
  • Validating presentation structure before delivery
  • Debugging why read_file cannot parse a .pptx file

Dependencies

The python-pptx library must be available in the execution environment. Most Python environments support it via pip:

pip install python-pptx
Câu hỏi thường gặp

Slide không có tiêu đề được xử lý thế nào?

Script in một ghi chú cho biết slide đó không có tiêu đề.

Số slide được kiểm tra ra sao?

Script so sánh số thực tế với số lượng mong đợi và báo cho biết có đạt hay không.

Thư viện nào đọc file?

python-pptx đọc bài thuyết trình.

Chi tiết

Mô tả gốc của tác giả

Validate PowerPoint files using python-pptx when read_file fails

repo: HKUDS/AgentPilot

Độ phổ biến

Sao GitHub
7.8k
Vị trí xếp hạng
#12950
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự