Skillpedia
PDF وWord والعروض التقديمية7.8k · #12950

pptx-validation-fallback

ما الذي تفعله

هذه المهارة احتياط لفحص ملفات .pptx بمكتبة python-pptx. وهي مناسبة لمن يحتاج إلى التأكد من عدد شرائح عرض لا تستطيع أداة القراءة التعامل معه.

متى تستخدمها

  • ✓عندما تفشل read_file أو تُرجع معلومات ناقصة عن ملف PowerPoint.
  • ✓عندما أحتاج إلى التأكد من أن العرض التقديمي يحتوي على عدد الشرائح المتوقع.
  • ✓عندما أريد عرض عناوين الشرائح للمراجعة.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pptx-validation-fallback/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“تحقق من أن عرضي التقديمي فيه عشر شرائح، واعرض عنوان كل واحدة. أداة القراءة العادية لا تعمل معه.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يشغّل الذكاء الاصطناعي سكربت python-pptx من الطرفية يحمّل العرض، ويطبع عدد الشرائح وعنوان كل شريحة، ويقارن العدد بالمتوقع.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

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
الأسئلة الشائعة

كيف تُعالج الشرائح التي لا عنوان لها؟

يطبع السكربت ملاحظة تفيد بأن الشريحة لا عنوان لها.

كيف يُفحص عدد الشرائح؟

يقارن السكربت العدد الفعلي بالعدد المتوقع، ويبلغ هل النتيجة مطابقة.

أي مكتبة تقرأ الملف؟

تقرأ مكتبة python-pptx العرض التقديمي.

التفاصيل

الوصف الأصلي من المؤلف

Validate PowerPoint files using python-pptx when read_file fails

repo: HKUDS/AgentPilot

الشعبية

نجوم GitHub
7.8k
الترتيب
#12950
الترخيص
MIT
آخر تحديث
1‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة