# Prompt ($)

> Learn how to use the tagged template literal for dynamic prompt generation in GenAI scripts.

The `$` is a JavaScript [tagged template](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) that expands the string into the final prompt.

example.genai.mjs

```js
$`You are a helpful assistant.`
```

<!-- genaiscript output start -->

👤 user

```markdown
You are a helpful assistant.
```

<!-- genaiscript output end -->

## Inline expressions

[Section titled “Inline expressions”](#inline-expressions)

You can weave expressions in the template using `${...}`. Expressions can be promises and will be awaited when rendering the final prompt.

example.genai.mjs

```js
$`Today is ${new Date().toDateString()}.`
```

<!-- genaiscript output start -->

👤 user

```markdown
Today is Thu Jun 13 2024.
```

<!-- genaiscript output end -->

## String templating

[Section titled “String templating”](#string-templating)

The output of the `$` can be further processed by running popular [jinja](https://www.npmjs.com/package/@huggingface/jinja) or [mustache](https://mustache.github.io/) template engines.

```js
$`What is the capital of {{ country }}?`.jinja(env.vars)
```

```js
$`What is the capital of {{ country }}?`.mustache(env.vars)
```

## Inline prompts

[Section titled “Inline prompts”](#inline-prompts)

When running an [inline prompt](/genaiscript/reference/scripts/inline-prompts), you can use the `$` to generate the prompt dynamically but you need to call it on the generation context.

example.genai.mjs

```js
const res = await runPrompt(ctx => {
  ctx.$`What is the capital of France?`
})
```