Creating Your First Hello World Workflow

In this section, we will guide you through the process of creating your first workflow in Brilliant. Leveraging Brilliant's prompt and workflow functionality, we will construct and execute a simple "Hello World" program.

Creating Your Prompt

1. Click the Create New Prompt button at the top of Brilliant's Prompts tab.

2. Specify your prompt's category, title, and description to your liking.

3. Define your user and system prompts to be included in your LLM request. While you could design your prompt to specifically generate a Hello World program, we'll design ours to be more flexible and easily iterated upon.

User prompt template:

Generate code satisfying the following user requirements:

{{input: Specify Code Requirements}}

Afterwards, generate a terminal command to be immediately run in a
standard linux shell. The terminal command should run the newly
created file.

System prompt template:

Always respond with two code blocks.

The first code block should always code, even when the user request
is nonsensical or seems to not require any code - your output will be
automatically written to a file and executed. If there is no code
required to satisfy the request, consider writing code that merely
prints a helpful message explaining why there's no actual code to run.

The second code block should only contain a terminal command that will
automatically be run to execute the code from the first code block.

Use the programming language implied by the filename {{arg:filename}}
if the user does not specify a language or runtime themselves. Assume
your code block will be written to a file as its entire contents, so
make sure it includes any necesary "imports" or the equivalent in your
chosen language.
   

4. Define your insertion parameters. Since we want to create a new file containing our Hello World program and automatically run it within our terminal, we can use the following parameters.

File Generation:

Insertion method

write to file

Prompt Response Block Number

1

File Path

{{arg:filename}}

Run Command:

Insertion method

run in terminal

Prompt Response Block Number

2

5. Once you're happy with your prompt, click the Save as New Prompt button. Your prompt will now appear within the collapsible catergory list you specified.

Running Your Prompt

You can now run your prompt by clicking it within Brilliant's Prompts tab. If you used the above specifications in your prompt, Brilliant will ask you to enter your desired filename and code requirements. To create our Hello World program, we'll use the following:

filename: HelloWorld.py

Specify Code Requirements: Print "Hello World"

From here, Brilliant will generate your new code, write it to a new file, generate a run command, and run your program within the terminal - all in a single step.