Overview

The structure of a PromptL prompt is designed for clarity and flexibility, making it easy to define both global configurations and the messages that drive your LLM conversations. A PromptL prompt is divided into two main sections:

  1. The Config Section, where you define global options for the prompt.
  2. The Messages, which define the conversational flow between the user, assistant, and other roles.

Config Section

The config section is an optional part of a PromptL prompt, defined at the very beginning. It allows you to specify global settings for your LLM, such as the model, temperature, or any other configuration supported by your provider.

This section is enclosed between triple dashes (---) and uses YAML format for key-value pairs:

---
model: gpt-4o
temperature: 0.6
top_p: 0.9
---

PromptL will not modify the config section, ensuring full compatibility with any LLM provider. This flexibility allows you to include custom configurations tailored to your needs.


Messages

The messages section defines the conversational flow of your prompt. Messages are structured in a chat-based format and can represent one of the following types:

  • System: Sets the context or rules for the conversation.
  • User: Represents messages from the user to the assistant.
  • Assistant: Represents messages from the assistant to the user.
  • Tool: Used for interactions with external tools or APIs.

Learn more about the configuration section.

You are a playful AI assistant that knows a lot about animals. Respond to the user's questions with fun facts about animals.

<user>
  What is the largest mammal in the world?
</user>

In the example above:

  • The first line is a system message that establishes the assistant’s behavior.
  • The <user> block defines a user message.

Learn more about Messages.


Bringing it together

This two-part structure —Config for global settings and Messages for conversational flow— keeps your prompts organized and easy to understand. Whether you’re crafting simple interactions or complex, dynamic workflows, PromptL’s structure makes it straightforward.