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

Examples

open 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 then others:

Or 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_2024_llmexamplefunction, author="Wolfram Research", title="{LLMExampleFunction}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/LLMExampleFunction.html}", note=[Accessed: 22-July-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_llmexamplefunction, organization={Wolfram Research}, title={LLMExampleFunction}, year={2023}, url={https://reference.wolfram.com/language/ref/LLMExampleFunction.html}, note=[Accessed: 22-July-2024 ]}