Skip to main content

ag2-add-custom-tool

Add a custom Python tool to an AG2 beta `Agent` using the `@tool` decorator. Use when the user wants to give an Agent a new capability backed by Python code (API calls, DB queries, computations, file ops). Covers sync and async tools, parameter typing, Pydantic schema customisation, returning typed `Input` / `ToolResult` (text / data / images / binary), `final=True` early-exit, and dependency injection via `Context` / `Inject` / `Variable` / `Depends`.

الانتقال إلى التثبيت

معلومات المصدر

المستودع
ag2ai/build-with-ag2
آخر نشاط في المصدر
٣٠ أبريل ٢٠٢٦ في ٢٣:٣٧
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
٢٤٧
التفرعات
٧٩

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.