PageSourceSearch

https://www.promptingguide.ai/_next/static/chunks/pages/introduction/elements.en-f0991ffd72ed57b0.js

js promptingguide.ai collected 2026-09-24 08:31:25 UTC 28,870 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[96741],{18465:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/introduction/elements.en",function(){return t(73075)}])},73075:function(e,n,t){"use strict";t.r(n),t.d(n,{__toc:function(){return d}});var a=t(52676),o=t(45118),i=t(23742),r=t(40241);t(21729),t(29814);var l=t(41619),s=t(79496);let d=[];function _createMdxContent(e){let n=Object.assign({h1:"h1",p:"p",strong:"strong",em:"em",pre:"pre",code:"code",span:"span"},(0,l.a)(),e.components);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{children:"Elements of a Prompt"}),"\n","\n",(0,a.jsx)(n.p,{children:"As we cover more and more examples and applications with prompt engineering, you will notice that certain elements make up a prompt."}),"\n",(0,a.jsx)(n.p,{children:"A prompt contains any of the following elements:"}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"Instruction"})," - a specific task or instruction you want the model to perform"]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"Context"})," - external information or additional context that can steer the model to better responses"]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"Input Data"})," - the input or question that we are interested to find a response for"]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"Output Indicator"})," - the type or format of the output."]}),"\n",(0,a.jsx)("iframe",{width:"100%",height:"415px",src:"https://www.youtube.com/embed/kgBZhJnh-vk?si=-a-KvhmXFJMtAuCB",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),"\n",(0,a.jsx)(n.p,{children:"To demonstrate the prompt elements better, here is a simple prompt that aims to perform a text classification task:"}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.em,{children:"Prompt"})}),"\n",(0,a.jsx)(n.pre,{"data-language":"text","data-theme":"default",children:(0,a.jsxs)(n.code,{"data-language":"text","data-theme":"default",children:[(0,a.jsx)(n.span,{className:"line",children:(0,a.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:"Classify the text into neutral, negative, or positive"})}),"\n",(0,a.jsx)(n.span,{className:"line",children:(0,a.jsx)(n.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,a.jsx)(n.span,{className:"line",children:(0,a.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:"Text: I think the food was okay."})}),"\n",(0,a.jsx)(n.span,{className:"line",children:(0,a.jsx)(n.span,{style:{color:"var(--shiki-color-text)"}})}),"\n",(0,a.jsx)(n.span,{className:"line",children:(0,a.jsx)(n.span,{style:{color:"var(--shiki-color-text)"},children:"Sentiment:"})})]})}),"\n",(0,a.jsx)(n.p,{children:'In the prompt example above, the instruction correspond to the classification task, "Classify the text into neutral, negative, or positive". The input data corresponds to the "I think the food was okay.\' part, and the output indicator used is "Sentiment:". Note that this basic example doesn\'t use context but this can also be provided as part of the prompt. For instance, the context for this text classification prompt can be additional examples provided as part of the prompt to help the model better understand the task and steer the type of outputs that you expect.'}),"\n",(0,a.jsx)(n.p,{children:"You do not need all the four elements for a prompt and the format depends on the task at hand. We will touch on more concrete examples in upcoming guides."}),"\n",(0,a.jsxs)(s.cv,{title:"Related Learning",children:[(0,a.jsx)(s.Pg,{tag:"Course",tagColor:"blue",title:"Prompt Engineering for LLMs",description:"Master zero-shot, few-shot, and advanced prompting methods to get better results from large language models.",href:"https://academy.dair.ai/courses/introduction-prompt-engineering",level:"Beginner",duration:"2 hours"}),(0,a.jsx)(s.Pg,{tag:"Course",tagColor:"purple",title:"Building Effective AI Agents",description:"Learn to build effective AI agents. Covers function calling, tool integration, and debugging agentic systems.",href:"https://academy.dair.ai/courses/building-effective-ai-agents",level:"Intermediate",duration:"5 hours"})]}),"\n",(0,a.jsx)(s.zX,{title:"Explore All Courses",description:"Discover our full catalog of AI and prompt engineering courses. From beginners to advanced practitioners.",href:"https://academy.dair.ai/",buttonText:"Browse Academy",promoCode:"PROMPTING20"})]})}let c={MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:n}=Object.assign({},(0,l.a)(),e.components);return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(_createMdxContent,{...e})}):_createMdxContent(e)},pageOpts:{filePath:"pages/introduction/elements.en.mdx",route:"/introduction/elements",timestamp:1769980197e3,pageMap:[{kind:"Meta",locale:"en",data:{index:"Prompt Engineering",introduction:"Introduction",techniques:"Prompting Techniques",agents:"AI Agents",guides:"Guides",applications:"Applications",prompts:"Prompt Hub",models:"Models",risks:"Risks & Misuses",research:"LLM Research Findings",papers:"Papers",tools:"Tools",notebooks:"Notebooks",datasets:"Datasets",readings:"Additional Readings",courses:{title:"\uD83C\uDF93 Courses",type:"menu",items:{"intro-prompt-engineering":{title:"Intro to Prompt Engineering",href:"https://academy.dair.ai/courses/introduction-prompt-engineering"},"advanced-prompt-engineering":{title:"Advanced Prompt Engineering",href:"https://academy.dair.ai/courses/advanced-prompt-engineering"},"intro-ai-agents":{title:"Intro to AI Agents",href:"https://academy.dair.ai/courses/introduction-ai-agents"}
1,"agents-with-n8n":{title:"Building Effective AI Agents with n8n",href:"https://academy.dair.ai/courses/building-effective-ai-agents"},"rag-systems":{title:"Build RAG Systems",href:"https://academy.dair.ai/courses/introduction-to-rag"},"advanced-agents":{title:"Building Advanced AI Agents",href:"https://academy.dair.ai/courses/advanced-ai-agents"},"all-courses":{title:"See all →",href:"https://academy.dair.ai/courses"}}},about:{title:"About",type:"page"},services:"Services"}},{kind:"MdxPage",name:"about",route:"/about",locale:"en"},{kind:"Folder",name:"agents",route:"/agents",children:[{kind:"Meta",locale:"en",data:{introduction:"Introduction to Agents",components:"Agent Components","ai-workflows-vs-ai-agents":"AI Workflows vs AI Agents","context-engineering":"Context Engineering for AI Agents","context-engineering-deep-dive":"Context Engineering Deep Dive","function-calling":"Function Calling","deep-agents":"Deep Agents"}},{kind:"MdxPage",name:"ai-workflows-vs-ai-agents",route:"/agents/ai-workflows-vs-ai-agents",locale:"en"},{kind:"MdxPage",name:"components",route:"/agents/components",locale:"en"},{kind:"MdxPage",name:"context-engineering-deep-dive",route:"/agents/context-engineering-deep-dive",locale:"en"},{kind:"MdxPage",name:"context-engineering",route:"/agents/context-engineering",locale:"en"},{kind:"MdxPage",name:"deep-agents",route:"/agents/deep-agents",locale:"en"},{kind:"MdxPage",name:"function-calling",route:"/agents/function-calling",locale:"en"},{kind:"MdxPage",name:"introduction",route:"/agents/introduction",locale:"en"}]},{kind:"MdxPage",name:"agents",route:"/agents",locale:"en"},{kind:"Folder",name:"applications",route:"/applications",children:[{kind:"Meta",locale:"en",data:{"finetuning-gpt4o":"Fine-tuning GPT-4o",function_calling:"Function Calling","context-caching":"Context Caching with LLMs",generating:"Generating Data",synthetic_rag:"Generating Synthetic Dataset for RAG",generating_textbooks:"Tackling Generated Datasets Diversity",coding:"Generating Code",workplace_casestudy:"Graduate Job Classification Case Study",pf:"Prompt Function"}},{kind:"MdxPage",name:"coding",route:"/applications/coding",locale:"en"},{kind:"MdxPage",name:"context-caching",route:"/applications/context-caching",locale:"en"},{kind:"MdxPage",name:"finetuning-gpt4o",route:"/applications/finetuning-gpt4o",locale:"en"},{kind:"MdxPage",name:"function_calling",route:"/applications/function_calling",locale:"en"},{kind:"MdxPage",name:"generating",route:"/applications/generating",locale:"en"},{kind:"MdxPage",name:"generating_textbooks",route:"/applications/generating_textbooks",locale:"en"},{kind:"MdxPage",name:"pf",route:"/applications/pf",locale:"en"},{kind:"MdxPage",name:"synthetic_rag",route:"/applications/synthetic_rag",locale:"en"},{kind:"MdxPage",name:"workplace_casestudy",route:"/applications/workplace_casestudy",locale:"en"}]},{kind:"MdxPage",name:"applications",route:"/applications",locale:"en"},{kind:"MdxPage",name:"courses",route:"/courses",locale:"en"},{kind:"MdxPage",name:"datasets",route:"/datasets",locale:"en"},{kind:"Folder",name:"guides",route:"/guides",children:[{kind:"MdxPage",name:"4o-image-generation",route:"/guides/4o-image-generation",locale:"en"},{kind:"Meta",locale:"en",data:{"optimizing-prompts":"Optimizing Prompts","deep-research":"OpenAI Deep Research","reasoning-llms":"Reasoning LLMs","4o-image-generation":"4o Image Generation","context-engineering-guide":"Context Engineering Guide"}},{kind:"MdxPage",name:"context-engineering-guide",route:"/guides/context-engineering-guide",locale:"en"},{kind:"MdxPage",name:"deep-research",route:"/guides/deep-research",locale:"en"},{kind:"MdxPage",name:"optimizing-prompts",route:"/guides/optimizing-prompts",locale:"en"},{kind:"MdxPage",name:"reasoning-llms",route:"/guides/reasoning-llms",locale:"en"}]},{kind:"MdxPage",name:"index",route:"/",locale:"en"},{kind:"Folder",name:"introduction",route:"/introduction",children:[{kind:"Meta",locale:"en",data:{settings:"LLM Settings",basics:"Basics of Prompting",elements:"Prompt Elements",tips:"General Tips for Designing Prompts",examples:"Examples of Prompts"}},{kind:"MdxPage",name:"basics",route:"/introduction/basics",locale:"en"},{kind:"MdxPage",name:"elements",route:"/introduction/elements",locale:"en"},{kind:"MdxPage",name:"examples",route:"/introduction/examples",locale:"en"},{kind:"MdxPage",name:"settings",route:"/introduction/settings",locale:"en"},{kind:"MdxPage",name:"tips",route:"/introduction/tips",locale:"en"}]},{kind:"MdxPage",name:"introduction",route:"/introduction",locale:"en"},{kind:"Folder",name:"models",route:"/models",children:[{kind:"Meta",locale:"en",data:{chatgpt:"ChatGPT","claude-3":"Claude 3","code-llama":"Code Llama",flan:"Flan",gemini:"Gemini","gemini-advanced":"Gemini Advanced","gemini-pro":"Gemini 1.5 Pro",gemma:"Gemma","gpt-4":"GPT-4","grok-1":"Grok-1","kimi-k2.5":"Kimi K2.5",llama:"LLaMA","llama-3":"Llama 3","mistral-7b":"Mistral 7B","mistral-large":"Mistral Large",mixtral:"Mixtral","mixtral-8x22b":"Mixtral 8x22B",olmo:"OLMo","phi-2":"Phi-2",sora:"Sora",collection:"LLM Collection"}},{kind:"MdxPage",name:"chatgpt",route:"/models/chatgpt",locale:"en"},{kind:"MdxPage",name:"claude-3",route:"/models/claude-3",locale:"en"},{kind:"MdxPage",name:"code-llama",route:"/models/code-llama",locale:"en"},{kind:"MdxPage",name:"collection",route:"/models/collection",locale:"en"},{kind:"MdxPage",name:"flan",route:"/models/flan",locale:"en"},{kind:"MdxPage",name:"gemini-advanced",route:"/models/gemini-advanced",locale:"en"},{kind:"MdxPage",name:"gemini-pro",route:"/models/gemini-pro",locale:"en"},{kind:"MdxPage",name:"gemini",route:"/models/gemini",locale:"en"},{kind:"MdxPage",name:"gemma",route:"/models/gemma",locale:"en"},{kind:"MdxPage",name:"gpt-4",route:"/models/gpt-4",locale:"en"},{kind:"MdxPage",name:"grok-1",route:"/models/grok-1",locale:"en"},{kind:"MdxPage",name:"kimi-k2.5",route:"/models/kimi-k2.5",locale:"en"},{kind:"MdxPage",name:"llama-3",route:"/models/llama-3",locale:"en"},{kind:"MdxPage",name:"llama",route:"/models/llama",locale:"en"},{kind:"MdxPage",name:"mistral-7b",route:"/models/mistral-7b",locale:"en"},{kind:"MdxPage",name:"mistral-large",route:"/models/mistral-large",locale:"en"},{kind:"MdxPage",name:"mixtral-8x22b",route:"/models/mixtral-8x22b",locale:"en"},{kind:"MdxPage",name:"mixtral",route:"/models/mixtral",locale:"en"},{kind:"MdxPage",name:"olmo",route:"/models/olmo",locale:"en"},{kind:"MdxPage",name:"phi-2",route:"/models/phi-2",locale:"en"},{kind:"MdxPage",name:"sora",route:"/models/sora",locale:"en"}]},{kind:"MdxPage",name:"models",route:"/models",locale:"en"},{kind:"MdxPage",name:"notebooks",route:"/notebooks",locale:"en"},{kind:"MdxPage",name:"papers",route:"/papers",locale:"en"},{kind:"Folder",name:"prompts",route:"/prompts",children:[{kind:"Meta",locale:"en",data:{classification:"Classification",coding:"Coding",creativity:"Creativity",evaluation:"Evaluation","information-extraction":"Information Extraction","image-generation":"Image Generation",mathematics:"Mathematics","question-answering":"Question Answering",reasoning:"Reasoning","text-summarization":"Text Summarization",truthfulness:"Truthfulness","adversarial-prompting":"Adversarial Prompting"}},{kind:"Folder",name:"adversarial-prompting",route:"/prompts/adversarial-prompting",children:[{kind:"Meta",locale:"en",data:{"prompt-injection":"Prompt Injection","prompt-leaking":"Prompt Leaking","jailbreaking-llms":"Jailbreaking"}},{kind:"MdxPage",name:"jailbreaking-llms",route:"/prompts/adversarial-prompting/jailbreaking-llms",locale:"en"},{kind:"MdxPage",name:"prompt-injection",route:"/prompts/adversarial-prompting/prompt-injection",locale:"en"},{kind:"MdxPage",name:"prompt-leaking",route:"/prompts/adversarial-prompting/prompt-leaking",locale:"en"}]},{kind:"MdxPage",name:"adversarial-prompting",route:"/prompts/adversarial-prompting",locale:"en"},{kind:"Folder",name:"classification",route:"/prompts/classification",children:[{kind:"Meta",locale:"en",data:{sentiment:"Sentiment Classification","sentiment-fewsh
1ot":"Few-Shot Sentiment Classification"}},{kind:"MdxPage",name:"sentiment-fewshot",route:"/prompts/classification/sentiment-fewshot",locale:"en"},{kind:"MdxPage",name:"sentiment",route:"/prompts/classification/sentiment",locale:"en"}]},{kind:"MdxPage",name:"classification",route:"/prompts/classification",locale:"en"},{kind:"Folder",name:"coding",route:"/prompts/coding",children:[{kind:"Meta",locale:"en",data:{"code-snippet":"Generate Code Snippet","mysql-query":"Generate MySQL Query",tikz:"Draw TiKZ Diagram"}},{kind:"MdxPage",name:"code-snippet",route:"/prompts/coding/code-snippet",locale:"en"},{kind:"MdxPage",name:"mysql-query",route:"/prompts/coding/mysql-query",locale:"en"},{kind:"MdxPage",name:"tikz",route:"/prompts/coding/tikz",locale:"en"}]},{kind:"MdxPage",name:"coding",route:"/prompts/coding",locale:"en"},{kind:"Folder",name:"creativity",route:"/prompts/creativity",children:[{kind:"Meta",locale:"en",data:{rhymes:"Rhymes","infinite-primes":"Infinite Primes",interdisciplinary:"Interdisciplinary","new-words":"Inventing New Words"}},{kind:"MdxPage",name:"infinite-primes",route:"/prompts/creativity/infinite-primes",locale:"en"},{kind:"MdxPage",name:"interdisciplinary",route:"/prompts/creativity/interdisciplinary",locale:"en"},{kind:"MdxPage",name:"new-words",route:"/prompts/creativity/new-words",locale:"en"},{kind:"MdxPage",name:"rhymes",route:"/prompts/creativity/rhymes",locale:"en"}]},{kind:"MdxPage",name:"creativity",route:"/prompts/creativity",locale:"en"},{kind:"Folder",name:"evaluation",route:"/prompts/evaluation",children:[{kind:"Meta",locale:"en",data:{"plato-dialogue":"Evaluate Plato's Dialogue"}},{kind:"MdxPage",name:"plato-dialogue",route:"/prompts/evaluation/plato-dialogue",locale:"en"}]},{kind:"MdxPage",name:"evaluation",route:"/prompts/evaluation",locale:"en"},{kind:"Folder",name:"image-generation",route:"/prompts/image-generation",children:[{kind:"Meta",locale:"en",data:{"alphabet-person":"Draw a Person Using Alphabet"}},{kind:"MdxPage",name:"alphabet-person",route:"/prompts/image-generation/alphabet-person",locale:"en"}]},{kind:"MdxPage",name:"image-generation",route:"/prompts/image-generation",locale:"en"},{kind:"Folder",name:"information-extraction",route:"/prompts/information-extraction",children:[{kind:"Meta",locale:"en",data:{"extract-models":"Extract Model Names"}},{kind:"MdxPage",name:"extract-models",route:"/prompts/information-extraction/extract-models",locale:"en"}]},{kind:"MdxPage",name:"information-extraction",route:"/prompts/information-extraction",locale:"en"},{kind:"Folder",name:"mathematics",route:"/prompts/mathematics",children:[{kind:"Meta",locale:"en",data:{"composite-functions":"Evaluating Composite Functions","odd-numbers":"Adding Odd Numbers"}},{kind:"MdxPage",name:"composite-functions",route:"/prompts/mathematics/composite-functions",locale:"en"},{kind:"MdxPage",name:"odd-numbers",route:"/prompts/mathematics/odd-numbers",locale:"en"}]},{kind:"MdxPage",name:"mathematics",route:"/prompts/mathematics",locale:"en"},{kind:"Folder",name:"question-answering",route:"/prompts/question-answering",children:[{kind:"Meta",locale:"en",data:{"closed-domain":"Closed Domain Question Answering","open-domain":"Open Domain Question Answering","science-qa":"Science Question Answering"}},{kind:"MdxPage",name:"closed-domain",route:"/prompts/question-answering/closed-domain",locale:"en"},{kind:"MdxPage",name:"open-domain",route:"/prompts/question-answering/open-domain",locale:"en"},{kind:"MdxPage",name:"science-qa",route:"/prompts/question-answering/science-qa",locale:"en"}]},{kind:"MdxPage",name:"question-answering",route:"/prompts/question-answering",locale:"en"},{kind:"Folder",name:"reasoning",route:"/prompts/reasoning",children:[{kind:"Meta",locale:"en",data:{"indirect-reasoning":"Indirect Reasoning","physical-reasoning":"Physical Reasoning"}},{kind:"MdxPage",name:"indirect-reasoning",route:"/prompts/reasoning/indirect-reasoning",locale:"en"},{kind:"MdxPage",name:"physical-reasoning",route:"/prompts/reasoning/physical-reasoning",locale:"en"}]},{kind:"MdxPage",name:"reasoning",route:"/prompts/reasoning",locale:"en"},{kind:"Folder",name:"text-summarization",route:"/prompts/text-summarization",children:[{kind:"Meta",locale:"en",data:{"explain-concept":"Explain A Concept"}},{kind:"MdxPage",name:"explain-concept",route:"/prompts/text-summarization/explain-concept",locale:"en"}]},{kind:"MdxPage",name:"text-summarization",route:"/prompts/text-summarization",locale:"en"},{kind:"Folder",name:"truthfulness",route:"/prompts/truthfulness",children:[{kind:"Meta",locale:"en",data:{"identify-hallucination":"Hallucination Identification"}},{kind:"MdxPage",name:"identify-hallucination",route:"/prompts/truthfulness/identify-hallucination",locale:"en"}]},{kind:"MdxPage",name:"truthfulness",route:"/prompts/truthfulness",locale:"en"}]},{kind:"MdxPage",name:"prompts",route:"/prompts",locale:"en"},{kind:"MdxPage",name:"readings",route:"/readings",locale:"en"},{kind:"Folder",name:"research",route:"/research",children:[{kind:"Meta",locale:"en",data:{"llm-agents":"LLM Agents",rag:"RAG for LLMs","llm-reasoning":"LLM Reasoning","rag-faithfulness":"RAG Faithfulness","llm-recall":"LLM In-Context Recall",rag_hallucinations:"RAG Reduces Hallucination",synthetic_data:"Synthetic Data",thoughtsculpt:"ThoughtSculpt","infini-attention":"Infini-Attention","guided-cot":"LM-Guided CoT","trustworthiness-in-llms":"Trustworthiness in LLMs","llm-tokenization":"LLM Tokenization",groq:"What is Groq?"}},{kind:"MdxPage",name:"groq",route:"/research/groq",locale:"en"},{kind:"MdxPage",name:"guided-cot",route:"/research/guided-cot",locale:"en"},{kind:"MdxPage",name:"infini-attention",route:"/research/infini-attention",locale:"en"},{kind:"MdxPage",name:"llm-agents",route:"/research/llm-agents",locale:"en"},{kind:"MdxPage",name:"llm-reasoning",route:"/research/llm-reasoning",locale:"en"},{kind:"MdxPage",name:"llm-recall",route:"/research/llm-recall",locale:"en"},{kind:"MdxPage",name:"llm-tokenization",route:"/research/llm-tokenization",locale:"en"},{kind:"MdxPage",name:"rag-faithfulness",route:"/research/rag-faithfulness",locale:"en"},{kind:"MdxPage",name:"rag",route:"/research/rag",locale:"en"},{kind:"MdxPage",name:"rag_hallucinations",route:"/research/rag_hallucinations",locale:"en"},{kind:"MdxPage",name:"synthetic_data",route:"/research/synthetic_data",locale:"en"},{kind:"MdxPage",name:"thoughtsculpt",route:"/research/thoughtsculpt",locale:"en"},{kind:"MdxPage",name:"trustworthiness-in-llms",route:"/research/trustworthiness-in-llms",locale:"en"}]},{kind:"MdxPage",name:"research",route:"/research",locale:"en"},{kind:"Folder",name:"risks",route:"/risks",children:[{kind:"Meta",locale:"en",data:{adversarial:"Adversarial Prompting",factuality:"Factuality",biases:"Biases"}},{kind:"MdxPage",name:"adversarial",route:"/risks/adversarial",locale:"en"},{kind:"MdxPage",name:"biases",route:"/risks/biases",locale:"en"},{kind:"MdxPage",name:"factuality",route:"/risks/factuality",locale:"en"}]},{kind:"MdxPage",name:"risks",route:"/risks",locale:"en"},{kind:"MdxPage",name:"services",route:"/services",locale:"en"},{kind:"Folder",name:"techniques",route:"/techniques",children:[{kind:"Meta",locale:"en",data:{zeroshot:"Zero-shot Prompting",fewshot:"Few-shot Prompting",cot:"Chain-of-Thought Prompting","meta-prompting":"Meta Prompting",consistency:"Self-Consistency",knowledge:"Generate Knowledge Prompting",prompt_chaining:"Prompt Chaining",tot:"Tree of Thoughts",rag:"Retrieval Augmented Generation",art:"Automatic Reasoning and Tool-use",ape:"Automatic Prompt Engineer",activeprompt:"Active-Prompt",dsp:"Directional Stimulus Prompting",pal:"Program-Aided Language Models",react:"ReAct",reflexion:"Reflexion",multimodalcot:"Multimodal CoT",graph:"Graph Prompting"}},{kind:"MdxPage",name:"activeprompt",route:"/techniques/activeprompt",locale:"en"},{kind:"MdxPage",name:"ape",route:"/techniques/ape",locale:"en"},{kind:"MdxPage",name:"art",route:"/techniques/art",locale:"en"},{kind:"MdxPage",name:"consistency",route:"/techniques/consistency",locale:"en"},{kind:"MdxPage",name:"cot",route:"/techniques/cot",locale:"en"},{kind:"MdxPage",name:"dsp",route:"/techniques/dsp",locale:"en"},{kind:"MdxPage",name:"fewshot",route:"/techniques/fewshot",locale:"en"},{kind:"MdxPage",name:"graph",route:"/techniques/graph",locale:"en"},{kind:"MdxPage",name:"knowledge",route:"/techniques/knowledge",locale:"en"},{kind:"MdxPage",name:"meta-prompting",route:"/techniques/meta-prompting",locale:"en"},{kind:"MdxPage",name:"multimodalcot",route:"/techniques/multimodalcot",locale:"en"},{kind:"MdxPage",name:"pal",route:"/techniques/pal",locale:"en"},{kind:"MdxPage",name:"prompt_chaining",route:"/techniques/prompt_chaining",locale:"en"},{kind:"MdxPage",name:"rag",route:"/techniques/rag",locale:"en"},{kind:"MdxPage",name:"react",route:"/techniques/react",locale:"en"},{kind:"MdxPage",name:"reflexion",route:"/techniques/reflexion",locale:"en"},{kind:"MdxPage",name:"tot",route:"/techniques/tot",locale:"en"},{kind:"MdxPage",name:"zeroshot",route:"/techniques/zeroshot",locale:"en"}]},{kind:"MdxPage",name:"techniques",route:"/techniques",locale:"en"},{kind:"MdxPage",name:"tools",route:"/tools",locale:"en"}],flexsearch:{codeblocks:!0},title:"Elements of a Prompt",headings:d},pageNextRoute:"/introduction/elements.en",nextraLayout:i.ZP,themeConfig:r.Z};n.default=(0,o.j)(c)},79496:function(e,n,t){"use strict";t.d(n,{Pg:function(){return CourseCard},cv:function(){return CoursesSection},zX:function(){return CoursePromo}});var a=t(52676),o=t(75271);let i={blue:{bg:"#dbeafe",darkBg:"#1e3a5f",text:"#1e40af",darkText:"#93c5fd",border:"#93c5fd",darkBorder:"#3b82f6"},green:{bg:"#ecfccb",darkBg:"#1a2e05",text:"#365314",darkText:"#bef264",border:"#bef264",darkBorder:"#84cc16"},purple:{bg:"#f3e8ff",darkBg:"#2e1065",text:"#6b21a8",darkText:"#d8b4fe",border:"#d8b4fe",darkBorder:"#a855f7"},orange:{bg:"#ffedd5",darkBg:"#431407",text:"#9a3412",darkText:"#fdba74",border:"#fdba74",darkBorder:"#f97316"}},useDarkMode=()=>{let[e,n]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{let checkDarkMode=()=>{n(document.documentElement.classList.contains("dark"))};checkDarkMode();let e=new MutationObserver(checkDarkMode);return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}
1),()=>e.disconnect()},[]),e},CourseCard=e=>{let{tag:n,tagColor:t="blue",title:o,description:r,href:l,level:s,duration:d,isFree:c}=e,m=useDarkMode(),g=i[t];return(0,a.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",flexDirection:"column",textDecoration:"none",color:"inherit",backgroundColor:m?"#1e293b":"white",borderRadius:"12px",border:"1px solid ".concat(m?"#334155":"#e5e7eb"),overflow:"hidden",transition:"all 0.2s ease",boxShadow:m?"0 1px 3px rgba(0,0,0,0.3)":"0 1px 3px rgba(0,0,0,0.05)",height:"100%"},onMouseOver:e=>{e.currentTarget.style.boxShadow=m?"0 4px 12px rgba(0,0,0,0.4)":"0 4px 12px rgba(0,0,0,0.1)",e.currentTarget.style.transform="translateY(-2px)"},onMouseOut:e=>{e.currentTarget.style.boxShadow=m?"0 1px 3px rgba(0,0,0,0.3)":"0 1px 3px rgba(0,0,0,0.05)",e.currentTarget.style.transform="translateY(0)"},children:[(0,a.jsx)("div",{style:{backgroundColor:m?g.darkBg:g.bg,borderBottom:"2px solid ".concat(m?g.darkBorder:g.border),padding:"8px 16px",fontSize:"12px",fontWeight:600,color:m?g.darkText:g.text,textTransform:"uppercase",letterSpacing:"0.5px"},children:n}),(0,a.jsxs)("div",{style:{padding:"20px",display:"flex",flexDirection:"column",flex:1},children:[(0,a.jsx)("h3",{style:{margin:"0 0 12px 0",fontSize:"18px",fontWeight:700,color:m?"#f1f5f9":"#111827",lineHeight:1.3},children:o}),(0,a.jsx)("p",{style:{margin:"0",fontSize:"14px",color:m?"#94a3b8":"#6b7280",lineHeight:1.6,flex:1},children:r}),(s||d)&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",marginTop:"16px",borderTop:"1px dashed ".concat(m?"#475569":"#e5e7eb"),fontSize:"13px",color:m?"#94a3b8":"#6b7280"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,a.jsx)("path",{d:"M12 20V10M18 20V4M6 20v-4",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,a.jsx)("span",{children:s})]}),d&&(0,a.jsx)("span",{style:{fontWeight:500},children:d})]})]})]})},CoursesSection=e=>{let{title:n="Related Learning",children:t}=e,o=useDarkMode();return(0,a.jsxs)("div",{style:{backgroundColor:o?"#0f172a":"#f8fafc",borderRadius:"16px",padding:"24px",marginTop:"32px",border:"1px solid ".concat(o?"#1e293b":"#e2e8f0")},children:[(0,a.jsx)("h2",{style:{margin:"0 0 20px 0",fontSize:"20px",fontWeight:700,color:o?"#f1f5f9":"#1e293b"},children:n}),(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:"20px"},children:t})]})},CoursePromo=e=>{let{title:n="Want to learn more?",description:t="Learn more about advanced prompt engineering techniques and best practices in our AI courses.",href:o="https://academy.dair.ai/",buttonText:i="Explore Courses",promoCode:r}=e,l=useDarkMode();return(0,a.jsx)("div",{style:{backgroundColor:l?"#0f172a":"#f8fafc",borderRadius:"12px",padding:"24px",marginTop:"24px",border:"1px solid ".concat(l?"#1e293b":"#e2e8f0")},children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:"16px"},children:[(0,a.jsx)("div",{style:{backgroundColor:l?"#1e3a5f":"#dbeafe",borderRadius:"10px",padding:"12px",flexShrink:0},children:(0,a.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:l?"#60a5fa":"#2563eb",strokeWidth:"2",children:[(0,a.jsx)("path",{d:"M22 10v6M2 10l10-5 10 5-10 5z",strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M6 12v5c3 3 9 3 12 0v-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),(0,a.jsxs)("div",{style:{flex:1},children:[(0,a.jsx)("h3",{style:{margin:"0 0 8px 0",fontSize:"18px",fontWeight:700,color:l?"#f1f5f9":"#1e293b"},children:n}),(0,a.jsxs)("p",{style:{margin:"0 0 16px 0",fontSize:"14px",color:l?"#94a3b8":"#64748b",lineHeight:1.6},children:[t,r&&(0,a.jsxs)("span",{style:{display:"block",marginTop:"8px",fontWeight:500,color:l?"#cbd5e1":"#475569"},children:["Use code ",(0,a.jsx)("code",{style:{backgroundColor:l?"#78350f":"#fef3c7",padding:"2px 6px",borderRadius:"4px",fontWeight:600,color:l?"#fcd34d":"#92400e"},children:r})," for 20% off!"]})]}),(0,a.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",backgroundColor:"#2563eb",color:"white",padding:"10px 20px",borderRadius:"8px",fontSize:"14px",fontWeight:600,textDecoration:"none",transition:"all 0.2s ease"},onMouseOver:e=>{e.currentTarget.style.backgroundColor="#1d4ed8"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="#2563eb"},children:[i,(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,a.jsx)("path",{d:"M5 12h14M12 5l7 7-7 7",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})})}}},function(e){e.O(0,[57914,26494,49774,92888,40179],function(){return e(e.s=18465)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.