Showing content from http://reference.wolfram.com/language/ref/LLMExampleFunction.html below:
LLMExampleFunction—Wolfram Language Documentation
WOLFRAM Consulting & Solutions
We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technology expertise.
- Data & Computational Intelligence
- Model-Based Design
- Algorithm Development
- Wolfram|Alpha for Business
- Blockchain Technology
- Education Technology
- Quantum Computation
WolframConsulting.com
BUILT-IN SYMBOL
LLMExampleFunction[prompting,form]
includes the interpreter form to apply to the response.
Details and Options
- An LLMExampleFunction can be used to generate text using a large language model (LLM) with a prompt dynamically generated from a list of examples.
- LLMExampleFunction requires external service authentication, billing and internet connectivity.
- LLMExampleFunction returns an LLMFunction.
- LLMExampleFunction supports all options of LLMFunction:
- LLMEvaluator can be set to an LLMConfiguration object or an association with any of the following keys:
- "MaxTokens" maximum amount of tokens to generate "Model" base model "PromptDelimiter" string to insert between prompts "Prompts" initial prompts "StopTokens" tokens on which to stop generation "Temperature" sampling temperature "ToolMethod" method to use for tool calling "Tools" list of LLMTool objects to make available "TopProbabilities" sampling classes cutoff "TotalProbabilityCutoff" sampling probability cutoff (nucleus sampling)
- Valid forms of "Model" include:
- name named model {service,name} named model from service <|"Service"service,"Name"name,"Task"task|> fully specified model
- The generated text is sampled from a distribution. Details of the sampling can be specified using the following properties of LLMEvaluator:
- "Temperature"t Automatic sample using a positive temperature t "TopProbabilities"k Automatic sample only among the k highest-probability classes "TotalProbabilityCutoff"p Automatic sample among the most probable choices with an accumulated probability of at least p (nucleus sampling)
- Possible values for Authentication are:
- Automatic choose the authentication scheme automatically Environment check for a key in the environment variables SystemCredential check for a key in the system keychain ServiceObject[…] inherit the authentication from a service object assoc provide an explicit key and user ID
- With AuthenticationAutomatic, the function checks the variable ToUpperCase[service]<>"_API_KEY" in Environment and SystemCredential; otherwise, it uses ServiceConnect[service].
- LLMExampleFunction uses machine learning. Its methods, training sets and biases included therein may change and yield varied results in different versions of the Wolfram Language.
Examplesopen allclose all Basic Examples (2)
Create an LLMFunction from a small training set:
Evaluate the function on an input:
Clarify the task and process the output string using an interpreter type:
Evaluate the function on an input:
Scope (3)
Specify examples as a list of rules:
Evaluate the function on an input:
Prepend a prompt to clarify the task:
Evaluate the function on an input:
Specify an interpreter type to process the output:
Evaluate the function on an input:
Possible Issues (1)
Some language models are more verbose than others:
They may also provide answers in an arbitrary programming language:
Wolfram Research (2023), LLMExampleFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/LLMExampleFunction.html. Text
Wolfram Research (2023), LLMExampleFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/LLMExampleFunction.html.
CMS
Wolfram Language. 2023. "LLMExampleFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LLMExampleFunction.html.
APA
Wolfram Language. (2023). LLMExampleFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LLMExampleFunction.html
BibTeX
@misc{reference.wolfram_2025_llmexamplefunction, author="Wolfram Research", title="{LLMExampleFunction}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/LLMExampleFunction.html}", note=[Accessed: 12-July-2025 ]}
BibLaTeX
@online{reference.wolfram_2025_llmexamplefunction, organization={Wolfram Research}, title={LLMExampleFunction}, year={2023}, url={https://reference.wolfram.com/language/ref/LLMExampleFunction.html}, note=[Accessed: 12-July-2025 ]}
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4