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

Examples

open allclose all

Basic Examples  (3)

Create a function for getting cooking instructions:

Create a helper tool:

Use the function:

Create a function that returns a city as an Entity:

Use the function:

Scope  (2)

Use named parameters:

Apply it using an Association:

Set a default for a parameter:

Properties & Relations  (1)

LLMFunction with no parameters sends the prompt directly to the LLM:

This is equivalent to LLMSynthesize with zero temperature:

Wolfram Research (2023), LLMFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/LLMFunction.html.

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

BibTeX

@misc{reference.wolfram_2023_llmfunction, author="Wolfram Research", title="{LLMFunction}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/LLMFunction.html}", note=[Accessed: 28-November-2023 ]}

BibLaTeX

@online{reference.wolfram_2023_llmfunction, organization={Wolfram Research}, title={LLMFunction}, year={2023}, url={https://reference.wolfram.com/language/ref/LLMFunction.html}, note=[Accessed: 28-November-2023 ]}