Skillpedia
الوكلاء7.8k · #12978

route-failed-searches-to-shell-agent

ما الذي تفعله

توجه هذه المهارة وكيل الذكاء الاصطناعي إلى تسليم بحث الويب الذي يفشل مرارًا إلى وكيل طرفية، يستطيع تجربة أساليب مختلفة. وهي مناسبة لمن يحتاج إلى معلومات من الويب عندما تكون أداة البحث غير موثوقة.

متى تستخدمها

  • ✓عندما تُرجع أداة البحث أخطاء غير معروفة أو نتائج فارغة عبر عدة استعلامات.
  • ✓عندما تحتاج المهمة إلى عدة خطوات لجمع البيانات يمكن لحلقة إعادة محاولة أن تتعامل معها.
  • ✓عندما أريد أن يختار الوكيل طريقته، مثل واجهة برمجة أو سكربت، للحصول على البيانات.

رابط المهارة

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/route-failed-searches-to-shell-agent/SKILL.md

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

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

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

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

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

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

“ابحث عن أسعار الطاقة الحالية في منطقتي. أداة البحث تفشل باستمرار، فاطلب من وكيل طرفية أن يجدها بطريقة أخرى.”

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

كيف تعمل

بدل إعادة المحاولة مع أداة البحث مرارًا، يعطي الوكيل وكيل الطرفية هدفًا واضحًا. يستطيع وكيل الطرفية إعادة المحاولة، أو كتابة سكربتات صغيرة، أو استخدام أدوات أخرى لجمع البيانات.

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

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

Route Failed Web Searches to Shell Agent

When to Use This Skill

Use this workflow when:

  • Direct search_web tool calls consistently fail with 'unknown error' or similar failures
  • You need to gather web-based information but the standard search tool is unreliable
  • The task requires multi-step data collection that benefits from autonomous retry logic
  • You need resilient data gathering that can adapt when initial approaches fail

Core Pattern

Instead of repeatedly calling search_web when it fails, delegate the entire search task to shell_agent. The shell_agent's internal capabilities provide:

  • Automatic retry logic with error detection and recovery
  • Multi-step approach - can try different methods (APIs, scraping, alternative sources)
  • Code-based solutions - can write Python scripts, use curl, or other tools
  • Autonomous adaptation - figures out the best approach without manual intervention

Step-by-Step Instructions

Step 1: Detect Search Tool Failure

When search_web returns errors like:

  • "unknown error"
  • Empty or incomplete results
  • Consistent failures across multiple queries

Recognize this as a signal to switch strategies rather than retrying the same failing tool.

Step 2: Delegate to Shell Agent

Create a task for shell_agent with clear objectives:

shell_agent(
    task="Gather current energy market data including oil prices, gas prices, and bond market information. Search multiple sources and compile findings into a structured summary.",
    timeout=300
)

Key task formulation principles:

  • Specify the what (data needed) not the how (specific tools to use)
  • Include success criteria and output format expectations
  • Allow sufficient timeout for multi-step execution (300+ seconds)
  • Let shell_agent decide whether to use Python, curl, or other approaches

Step 3: Verify Results

Check shell_agent output for:

  • Complete data collection (not partial results)
  • Multiple sources cited (indicates thorough searching)
  • Structured, usable output format
  • Evidence of error handling (mentions of retry attempts, alternative approaches tried)

Step 4: Extract and Use Data

Process the shell_agent results for your downstream task:

  • Parse collected data into required format
  • Cross-reference with any partial results from failed search_web calls
  • Document sources for verification if needed

Code Example

Scenario: Gathering market data for a financial report when search_web fails.

# Failed approach - don't keep retrying this:
try:
    results = search_web(query="current oil gas bond market prices 2025")
    # This fails with unknown error
except:
    pass  # Don't just catch and retry the same failing tool

# Correct approach - delegate to shell_agent:
from tools import shell_agent

market_data = shell_agent(
    task="""
    Gather comprehensive energy market data for a trading strategy report.
    Required information:
    1. Current crude oil prices (WTI, Brent)
    2. Natural gas prices
    3. Relevant bond issuer analysis and yields
    4. Recent market trends and forecasts
    
    Use multiple sources, handle any errors by trying alternative approaches,
    and provide structured output with source citations.
    """,
    timeout=300
)

# Now use market_data for your report

Why This Works

Aspect search_web (failing) shell_agent (working)
Retry logic None or limited Built-in multi-round retry
Error handling Returns error Attempts to fix and continue
Approach flexibility Single method Can use Python, bash, APIs, scraping
Adaptation Fails completely Tries alternative strategies
Output reliability Inconsistent Structured, verified results

Best Practices

  1. Don't chain failed tools: Once search_web fails twice, switch to shell_agent immediately rather than accumulating more failures.

  2. Set appropriate timeouts: Shell_agent needs time to iterate (200-300 seconds typical for complex searches).

  3. Be specific about data needs: Shell_agent performs better with clear requirements than broad queries.

  4. Trust the autonomy: Don't micromanage which tools shell_agent should use - let it decide the best approach.

  5. Validate outputs: Always verify shell_agent results meet your needs before proceeding to downstream tasks.

Troubleshooting

Shell_agent also fails?

  • Increase timeout (
الأسئلة الشائعة

بماذا يختلف عمل وكيل الطرفية؟

يستطيع تجربة طرق مختلفة، مثل السكربتات وواجهات البرمجة والمصادر الأخرى، وإعادة المحاولة بنفسه.

كيف يعرف الوكيل أن البحث فشل؟

تذكر المهارة الأخطاء غير المعروفة والمهلات والنتائج الفارغة أو الناقصة علامات للفشل.

هل تُفحص النتائج؟

لا تصف المهارة خطوة تحقق، لذلك راجع البيانات قبل الاعتماد عليها.

التفاصيل

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

Delegate web search tasks to shell_agent when direct search_web tool fails, using its retry mechanism and multi-step capabilities for resilient data gathering

repo: HKUDS/AgentPilot

الشعبية

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

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

0

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

التعليقات

  • …

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

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