LLMFunction
LLMFunction[prompt]
represents a template for a large language model (LLM) prompt.
LLMFunction[{prompt1,prompt2,…}]
represents a combination of multiple prompts.
LLMFunction[prompt,form]
includes the interpreter form to apply to the response.
LLMFunction[…][params]
give the LLM service response for prompt applied to parameters params.
Details and Options

- The prompti support the following values:
-
"prompt" static text LLMPrompt["name"] repository prompt StringTemplate[…] templated text TemplateObject[…] template for creating text - LLMFunction supports the following options:
-
InsertionFunction TextString function or format to apply before inserting expressions CombinerFunction StringJoin function to apply to combine pieces within a prompt
Examples
open allclose allBasic Examples (3)
Create a function for getting cooking instructions:
Create a function that returns a city as an Entity:
Scope (2)
Properties & Relations (1)
LLMFunction with no parameters sends the prompt directly to the LLM:
This is equivalent to LLMSynthesize with zero temperature:
Text
Wolfram Research (2023), LLMFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/LLMFunction.html.
CMS
Wolfram Language. 2023. "LLMFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LLMFunction.html.
APA
Wolfram Language. (2023). LLMFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LLMFunction.html