There are two posssible paths: Installing node
or using nvm
- Go to https://nodejs.org/en/download/prebuilt-installer, and install
Node v22.11.00
and choose the installer that correspond to your system. - Yo can check that can it was succesfully installed by open the med and write
node --version
. Maybe you should restart the computer before the system detetcs it installed.
- Download
nvm
your OS .For Windows, you need to download the.exe
form this url while Linux and iOS users cand do it from the command line:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
respectively.
In case of choosing using nvm
, there are additional steps the user should follow:
- Install
node
usingnvm
(v. 23.3.0 recommended)
nvm install v23.3.0
- Choose it as the version to use
nvm use 23.3.0
- Start
node
usingnvm
(requires administrator permits)
nvm on
To close node, write the command:
nvm off
.
-
Go to https://code.visualstudio.com/download, and dowload the version that is for your system.
-
Open
vscode
. -
In,
vscode
, open the Impropmtu folder (Go toFile
->Open Folder..
->Select the folder). -
Once in the Impromptu workspace, open a new Terminal (
Terminal
->New Terminal
)
This step is only necessary if you have downloaded node
directtely instead of using nvm
.
-
Open PowerShell as Administrator (press
Ctrl+X
->Terminal(Administrator)
) -
Change the
Execution Policy
toRemote Signed
. This policy allows scripts created on your local computer to run, but requires that scripts downloaded from the internet be signed by a trusted publisher.:
Set-ExecutionPolicy RemoteSigned
- Check that the Execution Policy has been changed
ExecutionPolicy
For further details, visit this post.
Changing the Execution Policy may open vulnerability to your system. A more secure option is done by the command
Set-ExecutionPolicy RemoteSigned –Scope Process
, which only affects the current session.
-
Install the Impromptu service by writing in the terminal
npm install
-
Install Langium from the Extension marketplace (Go to
Extension
icon in the lateral scroll, and writeLangium
in the serch bar. Click on the result and install it). -
In order to make use of Impromptu as a expansion, one should also install. You can install the extension by (downloading the
.vsix
file and) running:code --install-extension impromptu-1.0.0.vsix
Alternatively, if you open Visual Studio Code and search the extension file (impromptu-1.0.0.vsix
), you can right-click on it and select"Install VSIX Extension"
at the bottom of the list of options. -
Lastly, to make Langium operative, the user needs to do an initial run of Impromptu by its
run
commands:
npm run langium:generate
npm run build
- Extract Impromptu's
.zip
folder in your PC - Install
node
in your PC - Install
vscode
- Change the Execution Policy of the system (Windows).
- Run
npm install
- Install
Langium
andImpromptu
vscode's Extension - Run
npm run langium:generate
andnpm run build
A .prm
file contains a Language (optional), and a set of prompts, chain and composer (Assets). It may also contain one or more imports.
Every .prm
starts by declaring the language of the prompt that will generate. The grammar of it is:
language = <language>
Until now, the two possible languages are Spanish and English (i.e language=English
).
This element is optional. If it was not declared, it is assumed that the language is English.
In the future, it will be used to ensure the compatibility between an asset and its imports/references.
Prompt
is the basic function that generates a prompt. Its grammar is:
prompt <name> ([<inputs>]): <media>
[prefix = <snippets>]
core = <snippets>
[suffix = <snippets>]
[separator = <string>]
[language = <language>]
name: name that we give to the prompt. It has to be unique, and serves to reference the prompt in other places
inputs: Parameters and another inputs that are used to generate the prompt. There are two types of inputs:
- parameter: Transmit a
snippet
(explained HERE) inside theprompt
as a variable. They should start by an@
symbol. - metadata: to be developed
media: Indicate the types of exit the prompt will generate when used in the LLM.
prefix, core & suffix: They are where what will truly generate the prompt is located. They are composed by a set of commands (called snippets
) that induces that statemnt in the prompt. snippets
will be explained in the next section.
The difference betweeen prefix, core and suffix is merely concptual. The snippets in the core are supposed to be related with the intructions of the prompt related to generate the answer, while in suffix and prefix appear instructions to guide the LLM to a correct answer.
separator: Tells how the different snippets
are linked to each other. It was assigned a default separator for each LLM. For example, for ChatGPT, the default separator is ". "
.
language: A prompt can declare its language indivially of the language of the .prm
is in.
The snippets are the core of Impromptu. They are the "parts" that represent the different ideas that the generated prompt is wanted to have. There are 4 types of snippets:
-
Text plain. Just write a text that you want to be in the prompt
-
Input. Obviously, the inputs transmitted to the prompt can be referenced and be used it.
-
Another asset. You can use another asset from the same file (or that it were imported). For example, if you want to create a prompt to generate a poem about friendship, you may add a provious asset
generate_poem()
that generates a promptthat will create a poem. -
Traits. The most useful type of snippet are the traits. They work as reference to assets, but about general topics that usually appear in a well-formed prompt. For example, if in the previous example we want to ensure that the generated poem in the previos example is for children, we should add
audience("children")
. The whole list of the implemented traits, plus their options are documented in this document.
A Composer is a structure that allows to merge several snippets together. The difference with a Prompt is that not media is declared because each part of the composer is considered as an independent prompt (There is not any functional difference yet).
composer <name> ([<inputs>]):
<snippets>
[separator = <string>]
[language = <language>]
Not real utility right now
In addition to prompts, composer and chains, a .prm
can also contain imports. Similary to programming language such as java, the user can use other elements from a file located in build_files
by writing
import <name_1>,<name_2>,...,<name_n> from <file_location>
where <name_i>
are the names of the asset imported, and <file location>
is the relative path to the file from build_files
(but without the .prm
ending). For example, if the imported prompt is located in in the file build_files/libraries/evaluation_questions.prm
, <file location>
is libraries.evaluation_questions
.