"Prompt" (Resource Object Type)
[Experimental]
Details
- LLM prompt resources contain templated messages that can be accessed with LLMPrompt.
Properties
- There are standard ResourceObject properties common to all resource types. Additionally, each resource type defines additional special properties.
- Special properties for prompt resources include:
-
"PromptParameter" number or names of template parameters "PromptLocation" storage location of prompt template "SampleChat" sample of a chat notebook featuring the prompt - The "PromptLocation" property can be a CloudObject, LocalObject, File or URL.
- Properties used for sorting prompt resources include:
-
"Categories" type of prompt: function, persona, etc. "Topics" corresponding domains - Commonly used standard ResourceObject properties for prompt resources include:
-
"DefinitionNotebook" notebook defining the prompt and resource "ExampleNotebook" notebook showing programmatic use
Using a Prompt Resource
- The prompt is accessed with LLMPrompt or LLMResourceFunction.
- LLMPrompt["name"] provides the TemplateObject defining the prompt and can be applied to values to create prompt strings.
- LLMResourceFunction["name"][val1,val2,…] applies the prompt and sends the message to an LLM to generate a response.
- Properties can be accessed using ResourceObject[…]["prop"].
Creating a Prompt Resource
- To create a prompt resource with complete metadata, use the definition notebook available with CreateNotebook["PromptResource"].
- Using the definition notebook, the resource can also be stored locally, deployed to the cloud or submitted for publication in the Wolfram Prompt Repository.
Publishing in the Prompt Repository
- Prompt resources can be published in the Wolfram Prompt Repository.
- Submission to the prompt repository requires a PublisherID.
- Publication requires approval from a review team and typically involves modifications.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Retrieve a prompt resource from the public repository:
In[1]:=1

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-vbl2eq
Out[1]=1

The resource has type "Prompt":
In[2]:=2

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-qt32ca
Out[2]=2

In[3]:=3

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-ilrjgt
Out[3]=3

Apply the template to create a message:
In[4]:=4

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-y3txy8
Out[4]=4

Scope (2)Survey of the scope of standard use cases
Explore the metadata for a published prompt resource:
In[1]:=1

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-s3p5z1
Out[1]=1

See the location of the prompt content:
In[2]:=2

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-nc6nxm
Out[2]=2

See how many parameters are accepted by the template:
In[3]:=3

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-nr46sx
Out[3]=3

In[4]:=4

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-hsyu55
Out[4]=4

In[5]:=5

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-t29h61
Out[5]=5

In[6]:=6

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-y4vdlj
Out[6]=6

Open a blank prompt resource definition notebook to create a new prompt resource with metadata:
In[1]:=1

✖
https://wolfram.com/xid/0fl3kl8a40nmoaq5h9m5oslg2-hduf7z
Out[1]=1
