1"use strict";(self.webpackChunksemantic_router_docs=self.webpackChunksemantic_router_docs||[]).push([[27021],{5142(e,t,n){n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"tutorials/plugin/system-prompt","title":"System Prompt","description":"Overview","source":"@site/versioned_docs/version-v0.3/tutorials/plugin/system-prompt.md","sourceDirName":"tutorials/plugin","slug":"/tutorials/plugin/system-prompt","permalink":"/docs/v0.3/tutorials/plugin/system-prompt","draft":false,"unlisted":false,"editUrl":"https://github.com/vllm-project/semantic-router/edit/main/website/docs/tutorials/plugin/system-prompt.md","tags":[],"version":"v0.3","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Request Parameters","permalink":"/docs/v0.3/tutorials/plugin/request-params"},"next":{"title":"Tool Selection","permalink":"/docs/v0.3/tutorials/plugin/tool-selection"}}');var o=n(74848),r=n(28453);const i={},l="System Prompt",a={},c=[{value:"Overview",id:"overview",level:2},{value:"Key Advantages",id:"key-advantages",level:2},{value:"What Problem Does It Solve?",id:"what-problem-does-it-solve",level:2},{value:"When to Use",id:"when-to-use",level:2},{value:"Configuration",id:"configuration",level:2}];function d(e){const t={code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"system-prompt",children:"System Prompt"})}),"\n",(0,o.jsx)(t.h2,{id:"overview",children:"Overview"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.code,{children:"system_prompt"})," is a route-local plugin for inserting or modifying the system prompt on matched traffic."]}),"\n",(0,o.jsxs)(t.p,{children:["It aligns to ",(0,o.jsx)(t.code,{children:"config/fragments/plugin/system-prompt/expert.yaml"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"key-advantages",children:"Key Advantages"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:"Keeps instruction shaping local to the route."}),"\n",(0,o.jsx)(t.li,{children:"Makes prompt mode explicit instead of hiding it in application code."}),"\n",(0,o.jsx)(t.li,{children:"Works well for expert, persona, or workflow-specific routes."}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"what-problem-does-it-solve",children:"What Problem Does It Solve?"}),"\n",(0,o.jsxs)(t.p,{children:["Some routes need a different instruction layer than the router default. ",(0,o.jsx)(t.code,{children:"system_prompt"})," lets those routes attach the extra prompt context without affecting unrelated traffic."]}),"\n",(0,o.jsx)(t.h2,{id:"when-to-use",children:"When to Use"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:"one route needs an expert or persona-specific instruction layer"}),"\n",(0,o.jsx)(t.li,{children:"prompt insertion should happen after the decision matches"}),"\n",(0,o.jsx)(t.li,{children:"prompt policy should stay visible in the route config"}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,o.jsxs)(t.p,{children:["Use this fragment under ",(0,o.jsx)(t.code,{children:"routing.decisions[].plugins"}),":"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-yaml",children:"plugin:\n type: system_prompt\n configuration:\n enabled: true\n mode: insert\n system_prompt: You are a domain expert. Answer precisely, state tradeoffs, and keep the response actionable.\n"})})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},28453(e,t,n){n.d(t,{R:()=>i,x:()=>l});var s=n(96540);const o={},r=s.createContext(o);function i(e){const t=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]);
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.