metaprompt
1.0.0
Metaprompt是LLM及时工程的特定领域的语言。这是用于文本提示的模板引擎,表达式扩展可以取决于LLM输出。
目的是通过可编程性,可重复性和启动元能力扩展参数化提示的常规技术。
The text you are reading right now is a valid metaprompt program.
[# this is a comment that is ignored by the interpreter, that can be
used to add some info for the human-developer]
[# This whole text is a parametrized prompt, one of the parameters
being [:subject]]
[# [:subject] here is a variable reference. Variables can be defined
in-place, or passed from the external environment]
Give me a detailed poetic description of [:subject], using one or more
of the following metaphoric expressions:
[# Now I want to specialize my prompt depending on the value of
[:subject]. The output of the prompt below will be included *instead*
of the [$ ... block]: ]
[$ Write me a bullet list of metaphors for [:subject]. Do not produce
any other output]
[# Conditionals allow for logic branching: ]
[:if [:subject] is a human
:then
Use jokingly exaggerated style
:else
Include some references to [$ List some people who have any
relation to [:subject], comma-separated]
]
请参阅examples/更多。
这是一个早期的工作。在Twitter上关注我以获取更新
[:variable]和[:variable=some value] [:if ... :then ... :else ...]true还是false [$ meta-prompt]$ output的语法 - 暂时[:_=...] works(分配到_变量) [:use module :param1=value1][# comments][:STUATUS=some-status] - 在及时评估期间显示[@foreign_function arg1 :with arg2 :param1=foo :param2=bar]MODEL变量 - 示例) [chat1$ the object is the moon][chat1$ what is the object?] (示例) ROLE变量(示例) [:use @ffi-function :param1=foo :param2=bar] [:use ...]调用