LLMExampleFunction
LLMExampleFunction[{in1out1,in2out2,…}]
creates an LLMFunction from few-shot examples.
LLMExampleFunction[{in1,in2,…}{out1,out2,…}]
generates the same result.
LLMExampleFunction[{header,training}]
prefaces the prompt with header.
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:
-
InsertionFunction TextString function or format to apply before inserting expressions CombinerFunction StringJoin function to apply to combine pieces within a prompt Authentication Automatic explicit user ID and API key LLMEvaluator $LLMEvaluator LLM configuration to use
Examples
open allclose allBasic 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:
Scope (3)
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