> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crewai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# الاستدلال

> أصبح استدلال الوكيل جزءًا من تخطيط الوكيل. تعرّف على كيفية الانتقال من reasoning=True إلى planning_config.

## نظرة عامة

يتيح استدلال الوكيل للوكيل التأمل في المهمة وكتابة خطة قبل التنفيذ. أصبح الآن جزءًا من تخطيط الوكيل، الذي ينفّذ الخطة أيضًا خطوة بخطوة، ويتحقق من كل خطوة، ويمكنه إعادة التخطيط عندما تفشل خطوة.

لا يزال المعاملان `reasoning` و `max_reasoning_attempts` يعملان لكنهما مهملان. يُصدر `reasoning=True` تحذير `DeprecationWarning` تخفيه مرشّحات التحذير الافتراضية في Python، ولا يكون لـ `max_reasoning_attempts` أثر إلا مع `reasoning=True`. اضبط التخطيط باستخدام `planning_config` بدلًا منهما. راجع [التخطيط](https://docs.crewai.com/edge/ar/concepts/planning.md) للدليل الكامل.

## الانتقال من `reasoning=True`

استبدل `reasoning=True` بـ `planning_config=PlanningConfig()`، وانقل `max_reasoning_attempts` إلى `PlanningConfig(max_attempts=...)`:

```python theme={null}
from crewai import Agent, PlanningConfig

agent = Agent(
    role="Data Analyst",
    goal="Analyze complex datasets and provide insights",
    backstory="You are an experienced data analyst with expertise in finding patterns in complex data.",
    planning_config=PlanningConfig(max_attempts=3),
)
```

| المهمل | البديل |
| - | - |
| `reasoning=True` | `planning_config=PlanningConfig()` |
| `reasoning=True, max_reasoning_attempts=3` | `planning_config=PlanningConfig(max_attempts=3)` |

تحافظ هذه البدائل على السلوك نفسه: جهد استدلال متوسط، وتحسين الخطة حتى تصبح جاهزة أو حتى الوصول إلى `max_attempts`. دون `max_attempts`، يواصل المخطِّط التحسين حتى يعلّم الخطة بأنها جاهزة، لذا يُنصح بتعيين حد.

> [!WARNING]
>
> `planning=True` ليس مماثلًا لـ `reasoning=True`. فهو يستخدم `PlanningConfig(reasoning_effort="low", max_attempts=1)`: محاولة تخطيط واحدة ودون مراجعة LLM بعد كل خطوة. استخدمه عندما تريد تخطيطًا أقل تكلفة، وليس كبديل مباشر.

## كيف يعمل

تُحفظ الخطة في حالة تنفيذ الوكيل ولا تُضاف إلى وصف المهمة. تعمل كل خطوة من الخطة كعنصر todo مستقل، ويتحقق الوكيل من النتيجة قبل الانتقال إلى ما بعدها. إذا فشل التخطيط، يشغّل الوكيل المهمة دون خطة.

لمستويات جهد الاستدلال، وحدود الخطوات، و LLM تخطيط منفصل، والموجّهات المخصصة، والتخطيط مع `Agent.kickoff()`، راجع [التخطيط](https://docs.crewai.com/edge/ar/concepts/planning.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.