动态传入上下文数据 - context #187
chenxizhang
started this conversation in
Use cases - 简体中文
Replies: 2 comments
-
Tip 你可以在提示词中直接使用如下的系统变量 ( |
Beta Was this translation helpful? Give feedback.
0 replies
-
Tip 你还可以通过这样的语法 ( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
在 #186 讨论的结尾处,大家已经看到这样一个用法:
这个context 是什么意思呢? 这是我们需要传递给命令的一些数据,通常是因为我们的 system 指令,或者 prompt 指令中包含了一些变量定义,这才是他们能成为模板的原因嘛。如果都写死了,那就不能很好地复用。那么,既然里面有变量定义,就需要在调用时动态传入数据。
Tip
context 参数有一个别名,叫
variables
。我们来看一下 gpt-translator-md 这个模板的定义。
请注意,这里的变量定义语法,是用两个花括号把变量名包裹起来,例如 {{from_language}} 这样的形式。
Beta Was this translation helpful? Give feedback.
All reactions