LLMPrompt
LLMPrompt["name"]
gives the TemplateObject for the specified large language model prompt.
LLMPrompt[resource]
retrieves the TemplateObject for the specified resource.
LLMPrompt[…,params]
gives the TemplateObject with slots filled in by params.
LLMPrompt[…][p1,p2,…]
applies a template with numbered slots to parameter values pi.
LLMPrompt[…] [key1p1,key2p2]
applies a template with named slots to parameter data.
Details and Options
- LLMPrompt retrieves prompts from the Wolfram Prompt Repository.
- The resource can be a prompt ResourceObject, an LLMFunction or a TemplateObject.
- The params should be a list for templates with numbered slots or an Association for templates with named slots.
- In LLMPrompt["name",params], using TemplateSlot as a value will rename or reorder slots within the template.
- LLMPrompt is commonly used within LLMFunction and LLMSynthesize.
Examples
open allclose allBasic Examples (3)
Retrieve a prompt template from the Wolfram Prompt Repository:
Apply an LLMPrompt to values to get a prompt string:
Insert values into an LLMPrompt:
Scope (3)
Retrieve a prompt using a ResourceObject:
Get the template from an LLMFunction:
Insert a value for the first slot and renumber the second slot as the first:
Use LLMPrompt directly on a TemplateObject to reconfigure the slots:
Text
Wolfram Research (2023), LLMPrompt, Wolfram Language function, https://reference.wolfram.com/language/ref/LLMPrompt.html.
CMS
Wolfram Language. 2023. "LLMPrompt." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LLMPrompt.html.
APA
Wolfram Language. (2023). LLMPrompt. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LLMPrompt.html