AgentMark supports importing and reusing components across your prompts.
Use the import statement to include components from other files:
math-tutor.prompt.mdx
Copy
---name: math-tutortext_config: model_name: gpt-4---import MathInstructions from './math-instructions.mdx';<System> You are a math tutor. <MathInstructions /></System><User>What's 2 + 2?</User>
Components can accept props to make them more dynamic:
language-tutor.prompt.mdx
Copy
---name: language-tutortext_config: model_name: gpt-4test_settings: props: language: "Spanish" difficulty: "beginner"---import LanguageInstructions from './language-instructions.mdx';<System> <LanguageInstructions language={props.language} level={props.difficulty} /></System><User>How do I say "Hello"?</User>
Components are just regular .mdx files that can accept props:math-instructions.mdx:
math-instructions.mdx
Copy
<If condition={props.level == "advanced"}> Provide detailed mathematical proofs and explanations.</If><Else> Keep explanations simple and provide step-by-step solutions.</Else>
---name: math-tutortext_config: model_name: gpt-4---import MathInstructions from './math-instructions.md';<System> You are a math tutor. <MathInstructions /></System>