دکوریتورهای پرامپت (Prompt Decorators) 

فهرست مطالب

دکوریتورهای پرامپت (Prompt Decorators) چیستند و چگونه از آن‌ها استفاده کنیم؟

در دنیای در حال تحول هوش مصنوعی، هرچه تعامل ما با مدل‌های زبانی هوشمندتر و دقیق‌تر شود، نیاز به ابزارهایی برای کنترل بهتر خروجی نیز بیشتر حس می‌شود. یکی از این ابزارها، مفهومی نوآورانه و فوق‌العاده کاربردی به نام Prompt Decorator است.

برای خواندن مقاله کامل و تخصصی در این زمینه با پرامپت های بسیار کامل تر به این مقاله مراجعه کنید: The Prompt Decorator Canvas: A Framework for Advanced LLM Interaction

دکوریتور پرامپت چیست؟

Prompt Decorator یا “تزئین‌گر پرامپت”، یک دستور یا تگ کنترلی است که به متن پرامپت (دستور) افزوده می‌شود تا نوع پاسخ، نحوه ارائه، لحن، ساختار و یا منطق پاسخ مدل زبان را تغییر دهد.

برای مثال، وقتی در انتهای پرامپت بنویسید:
+++StepByStep
مدل موظف می‌شود پاسخ را به صورت مرحله‌به‌مرحله ارائه دهد، حتی اگر در حالت عادی یک پاسخ ساده و فشرده کافی به نظر برسد.

چرا باید از Prompt Decorator استفاده کنیم؟

هوش مصنوعی قدرتمند است، اما تنها در صورتی که درست از آن درخواست کنیم. دکوریتورها این امکان را فراهم می‌کنند تا:

  • خروجی‌های استاندارد و قابل پیش‌بینی داشته باشیم.
  • سطح عمق پاسخ را کنترل کنیم.
  • لحن و قالب خروجی را متناسب با نیاز تنظیم کنیم.
  • ساختارهای تحلیلی، انتقادی یا آموزشی را از مدل بخواهیم.
  • از مدل بخواهیم فقط در همان پرامپت یا کل گفتگو طبق دستور عمل کند.

در واقع، دکوریتورها پل ارتباطی ما با هوش مصنوعی برای سفارشی‌سازی دقیق رفتار آن هستند.


چگونه از دکوریتورها استفاده کنیم؟

برای استفاده از دکوریتورها کافی‌ست در انتهای یا ابتدای پرامپت خود، دکوریتور مورد نظر را بنویسید. مثلا:

پنج روش برای افزایش فروش آنلاین نام ببر
+++StepByStep

این دکوریتور باعث می‌شود پاسخ به صورت گام به گام ارائه شود.

نحوه عملکرد:

  • دکوریتورهایی مثل +++ChatScope تا زمانی که حذف نشوند، در تمام گفتگو فعال می‌مانند.
  • دکوریتور +++MessageScope فقط برای همان پیام اعمال می‌شود.
  • با +++Clear می‌توان همه دکوریتورها را حذف کرد.

Prompt Decorators Guide

🔍 از کجا شروع کنم؟

متن زیر را کپی کنید و در چت با هوش مصنوعی ارسال نمایید. سیستم نکات را ذخیره می‌کند و در آینده از آن‌ها استفاده خواهد کرد.

📦 متن کامل دستور دکوریتیو


## Introduction to Prompt Decorators

A "Prompt Decorator" is an instruction added to a prompt to modify the output or influence how the response is generated.

Please retain this definition in memory, as I will use it in future interactions.

---

## Compliance Requirements

You must detect, apply, and fully comply with all decorators whenever they are present. Ignoring, overlooking, or incorrectly executing any decorator is unacceptable.

You must maintain an active memory of all decorators applied at the chat scope. This memory must persist throughout the conversation, dynamically updating when decorators are activated, deactivated, or cleared.

You must also correctly manage the scope of decorators. Chat-scoped decorators must remain active across multiple messages until explicitly cleared or changed. Message-scoped decorators must apply only to the specific prompt where they are used.

These definitions must always be followed precisely when the corresponding decorator is present in a prompt or activated within the chat.

---

### Defined Prompt Decorators:

#### `+++Reasoning`
When this decorator is included in a prompt, you must begin your response with a detailed explanation of the reasoning and logic behind your answer. The explanation should be clear, structured, and directly relevant to the prompt. This requirement must always be followed when the decorator is present.

---

#### `+++StepByStep`
When this decorator is used, your response must be structured into a sequence of logically ordered steps. Each step should be explicitly labeled, such as:
**[Step 1] → [Step 2] → ... → [Final Step]**.
This structured progression must always be followed when the decorator is present.

---

#### `+++Socratic`
When this decorator is present, engage in a Socratic approach by posing clarifying questions before providing a direct answer. The response should encourage critical thinking and follow this structured sequence:
**[Restate Question] → [Clarify Definitions] → [Analyze Assumptions] → [Explore Perspectives] → [Use Analogies/Examples] → [Encourage Further Inquiry]**.
This structure must always be maintained when the decorator is used.

---

#### `+++Debate`
When this decorator is applied, your response must analyze multiple viewpoints before reaching a conclusion. The response should follow this format:
**[State Position] → [Perspective 1] → [Perspective 2] → ... → [Analysis & Rebuttal] → [Conclusion]**.
Ensuring a balanced discussion of differing perspectives is essential when this decorator is present.

---

#### `+++Critique`
When this decorator is included, your response must provide constructive criticism by assessing both strengths and weaknesses before suggesting improvements. The structure should be:
**[Identify Subject] → [Highlight Strengths] → [Critique Weaknesses] → [Suggest Improvements] → [Constructive Conclusion]**.
This balanced critique format must always be used when the decorator is specified.

---

#### `+++Refine(iterations=N)`
When this decorator appears, your response must go through multiple refinements, improving clarity, accuracy, or effectiveness in each step. The number of iterations is specified as **N**, and the format should follow:
**[Iteration 1] → [Iteration 2] → ... → [Final Answer]**.
Each refinement must enhance the response step by step.

---

#### `+++CiteSources`
When this decorator is present, all claims must be supported by credible references. Your response should follow this structure:
**[Initial Answer] → [Identify Key Claims] → [Find Credible Sources] → [Integrate Citations] → [Provide Full References] → [Verify Credibility] → [Final Answer]**.
Citations must be included in all cases where verification is necessary.

---

#### `+++FactCheck`
When this decorator is used, you must verify the factual accuracy of key claims before finalizing the response. The structure should be:
**[Initial Answer] → [Identify Claims] → [Research & Verify] → [Mark Uncertainties] → [Provide Verified Sources] → [Final Answer]**.
If verification is inconclusive, uncertainties must be explicitly marked.

---

#### `+++OutputFormat(format=FORMAT)`
When this decorator is applied, your response must strictly adhere to the specified output format. The format is defined by the parameter:
- **`format (json | markdown | yaml | xml | …)`** – Specifies the desired output structure.

The response must be formatted accordingly, without unnecessary deviations.

---

#### `+++Tone(style=STYLE)`
When this decorator is included, the response tone must match the specified style. The tone is defined by the parameter:
- **`style (formal | casual | friendly | technical | humorous | …)`** – Specifies the desired tone of the response.

The entire response must be consistent with the requested style.

---

#### `+++ChatScope`
When this decorator is included, all subsequently specified decorators must be applied at the conversation (chat) level rather than a single message.
Additionally, any decorators mentioned in the same message where `+++ChatScope` appears must immediately become active in the chat scope. These decorators will automatically apply to all future prompts until manually deactivated.

---

#### `+++MessageScope`
When this decorator is included, chat-scope behavior is stopped, and decorators will apply only to the specific message in which they are used.
Previously active chat-scoped decorators are paused but not erased unless cleared separately.

---

#### `+++Clear`
When this decorator is included without parameters, all active chat-scoped decorators must be cleared.
Optionally, one or more specific decorators can be cleared by specifying them as parameters.
Examples:
- `+++Clear` → clears all active decorators.
- `+++Clear(+++Reasoning, +++StepByStep)` → clears only the specified decorators.

---

#### `+++ActiveDecs`
When this decorator is included, you must return a list of all currently active decorators applied at the chat level.
If no decorators are active, the message "No active decorators" must be returned.

---

#### `+++AvailableDecs`
When this decorator is included, you must return a table listing all available decorators, showing their names, descriptions, and current status.
The table must include the following columns: **Name**, **Description**, and **Status** (Active or Inactive).
If a decorator is currently active in the chat scope, it must be clearly marked as "Active" in the Status column.
    

معرفی دکوریتورهای اصلی

🎯 راهنمای دکوریتورهای هوشمند

روی هر مورد کلیک کن تا توضیحات و مثالش رو ببینی👇

+++Reasoning

پاسخ باید با دلیل و منطق شروع بشه. خیلی شفاف و منطقی.

مثال: +++Reasoning چرا فروش ما در زمستان بیشتره؟
+++StepByStep

جواب باید مرحله‌ای و با ترتیب منطقی نوشته بشه.

مثال: +++StepByStep چطور یک کمپین ایمیلی طراحی کنیم؟
+++Socratic

با پرسیدن سوال‌های هوشمندانه ذهن کاربر رو درگیر کن، نه جواب مستقیم.

مثال: +++Socratic آیا تبلیغات تلویزیونی هنوز ارزش داره؟
+++Debate

چند دیدگاه مختلف رو بررسی کن و بعد نتیجه بگیر.

مثال: +++Debate آیا استفاده از ChatGPT برای تولید محتوا خوبه یا نه؟
+++Tone(style=humorous)

لحن پاسخ رو تنظیم کن. رسمی، صمیمی، فنی، یا شوخ‌طبع!

مثال: +++Tone(style=humorous) تفاوت بازاریاب و فروشنده چیه؟
+++ChatScope

همه دکوریتورهای این پیام از اینجا به بعد توی چت فعال می‌مونن.

مثال: +++ChatScope +++StepByStep
راهنمای دکوریتورهای پرامپت

📌 راهنمای دکوریتورهای پرامپت

نام دکوریتور توضیح ساده و شفاف مثال کاربردی
+++Reasoning با توضیح و منطق جواب بده +++Reasoning چرا فروش زمستانی بیشتره؟
+++StepByStep جواب رو مرحله‌به‌مرحله بده +++StepByStep چطور کمپین طراحی کنیم؟
+++Socratic با سوال و تحلیل ذهن رو درگیر کن +++Socratic تبلیغات تلویزیونی مفید هست؟
+++Debate دیدگاه‌های مختلف رو بررسی کن +++Debate استفاده از AI برای محتوا خوبه یا نه؟
+++Critique نقد مثبت و منفی + پیشنهاد بهتر +++Critique ارزیابی صفحه فرود من
+++Refine(iterations=3) جواب رو در چند مرحله بهتر کن +++Refine(iterations=3) یه بیو لینکدین بساز
+++CiteSources منبع معتبر برای هر ادعا بده +++CiteSources قهوه برای قلب مضره؟
+++FactCheck ادعاها رو بررسی و تایید کن +++FactCheck آیا میشه ۵ کیلو در هفته کم کرد؟
+++OutputFormat(format=json) جواب رو در قالب خاص بده +++OutputFormat(format=json) جدول مشخصات بده
+++Tone(style=casual) لحن پاسخ رو تنظیم کن (رسمی، صمیمی…) +++Tone(style=humorous) فرق بازاریاب با فروشنده چیه؟
+++ChatScope دکوریتورها تا اطلاع بعدی فعال می‌مونن +++ChatScope +++StepByStep از این به بعد همه رو مرحله‌ای جواب بده
+++MessageScope فقط توی همون پیام فعالن +++MessageScope +++Tone(style=casual)
+++Clear همه یا بخشی از دکوریتورها رو غیرفعال کن +++Clear یا +++Clear(+++Reasoning)
+++ActiveDecs لیست دکوریتورهای فعال رو بده +++ActiveDecs
+++AvailableDecs نمایش جدول کامل همه دکوریتورها و وضعیت‌شون +++AvailableDecs
📌 نکته: دکوریتورها رو کجا و چطور بنویسیم؟

دکوریتورها رو در ابتدای پرامپت بنویس و هر کدوم با +++ شروع می‌شن. مثلاً:

+++Tone(style=casual) +++Reasoning
به نظرت چرا مردم عاشق برند اپل هستن؟

نکات مهم در استفاده:

  • دکوریتورها قابل ترکیب هستند. مثلاً می‌توانید همزمان +++Reasoning و +++Tone(style=casual) داشته باشید.
  • برخی دکوریتورها نیاز به پارامتر دارند مثل: +++Tone(style=technical)
  • در صورت اشتباه تایپی یا ساختاری، مدل آن را اجرا نمی‌کند.

کاربردهای واقعی در پروژه‌ها

کاربرددکوریتورها
ساخت محتوای آموزشی+++StepByStep + +++Tone(style=formal)
تحلیل استراتژی+++Reasoning + +++Critique
تولید کپشن جذاب+++Tone(style=humorous) + +++Refine(iterations=2)
تولید JSON برای API+++OutputFormat(format=json)

Prompt Decoratorها قدرت شما برای کنترل دقیق رفتار هوش مصنوعی هستند. چه برای تولید محتوا، تحلیل داده، پاسخ به سوالات یا تعامل با چت‌بات‌ها، با استفاده از دکوریتورها می‌توانید تجربه‌ای کاملاً شخصی‌سازی‌شده و حرفه‌ای خلق کنید.

پیشنهاد می‌کنم برای پروژه‌های خود لیستی از دکوریتورهای پرکاربرد درست کنید و آن‌ها را به عنوان بخشی از استاندارد پرامپت‌نویسی‌تان استفاده کنید.
هوش مصنوعی باهوش‌تر از همیشه، اگر شما هوشمندانه‌تر با آن صحبت کنید.

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *

آماده ای یاد بگیری چطور 100 برند رو موفق کردم؟

اطلاعاتت رو ثبت کن تا ارتباطمون شروع بشه