Dynamically passing context data #199
chenxizhang
started this conversation in
Use cases
Replies: 1 comment
-
Tip You can define the default value to your variable by using the syntax like |
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
-
At the end of discussion #186, everyone has already seen a usage like this:
What does this 'context' mean? It refers to some data that we need to pass to the command, usually because our system command or prompt command includes some variable definitions, which is why they can serve as templates. If everything were hardcoded, it wouldn't be very reusable. Therefore, since there are variable definitions involved, we need to dynamically input data when calling it.
Tip
The
context
parameter also has an alias calledvariables
.Let's look at the definition of the gpt-translator-md template.
Please note that the syntax for variable definitions encloses the variable name with two curly braces, such as {{from_language}}.
Tip
There are several predefined system variables (
username
,computername
,os
,'osarch
,currenttime
,currenttimeutc
) that you can use in your prompt directly.Beta Was this translation helpful? Give feedback.
All reactions