Skip to content

Prompts / Instructions

Generally prompts tell/instruct the LLM what to do next. For instance, querying the user about a certain piece of information such as his/her name, insurance number, address/contact details etc.

Prompts can be either defined in plaintext, or programmatically.

Static/Plain Text Prompts

Example:

Greet the user and ask him for his name.

Dynamic/Programmatic Prompts

Sometimes, it is necessary to include dynamic information in the prompt that has been retrieved from some external source or is state, that is not static. For example: You application relies on the current date and time. LLMs have been trained up to a certain point of time, and they are text based and hence do not know the current date and time. If the application relies on time, for instance to schedule appointments, the LLM can be instructed/told about the current date and time.

Example on how to instruct the LLM about the current date and time.

function prompt(params) {
    return ({ "text": "Today is " + new Date().toLocaleString() });
}