# Import Template

> Learn how to import prompt templates into GenAIScript using `importTemplate` with support for mustache variable interpolation and file globs.

Various LLM tools allow storing prompts in text or markdown files. You can use `importTemplate` to import these files into a prompt.

cot.md

```markdown
Explain your answer step by step.
```

tool.genai.mjs

```js
importTemplate("cot.md")
```

## Variable interpolation

[Section titled “Variable interpolation”](#variable-interpolation)

`importTemplate` supports [mustache](https://mustache.github.io/) (default), [Jinja](https://www.npmjs.com/package/@huggingface/jinja) variable interpolation and the [Prompty](https://prompty.ai/) file format. You can use variables in the imported template and pass them as arguments to the `importTemplate` function.

time.md

```markdown
The current time is {{time}}.
```

tool.genai.mjs

```js
importTemplate("time.md", { time: "12:00" })
```

Mustache supports arguments as functions. This allows you to pass dynamic values to the template.

tool.genai.mjs

```js
importTemplate("time.md", { time: () => Date.now() })
```

## More way to specify files

[Section titled “More way to specify files”](#more-way-to-specify-files)

You can use the results of `workspace.readText`.

tool.genai.mjs

```js
const file = await workspace.readText("time.md")
importTemplate(time, { time: "12:00" })
```

You can specify an array of files or glob patterns.

```js
importTemplate("*.prompt")
```

## Prompty

[Section titled “Prompty”](#prompty)

[Prompty](https://prompty.ai/) provides a simple markdown-based format for prompts. It adds the concept of role sections to the markdown format.

```markdown
---
name: Basic Prompt
description: A basic prompt that uses the chat API to answer questions
---


inputs:
question:
type: string
sample:
"question": "Who is the most famous person in the world?"


---


system:
You are an AI assistant who helps people find information.
As the assistant, you answer questions briefly, succinctly.


user:
{{question}}
```

tool.genai.mjs

```js
importTemplate("basic.prompty", { question: "what is the capital of France?" })
```