Conversational prompt
Overview
Conversational prompting supports multi-turn conversation testing in LLM Labs. It allows prompts and responses to be evaluated across multiple interactions, helping assess how well a language model maintains context and coherence throughout a conversation. This feature can be used to test and analyze model behavior in conversational workflows.
Get started
Navigate to your Sandbox.
Click the three-dot menu in a prompt.

Choose your method:
Add conversation: Manually input a new conversation directly into the prompt. Learn more on how to write the conversation.

Upload conversation file: Upload a
.jsonconversation file for testing. Learn more about the JSON file format.
Execute the conversation and observe how the language model performs, maintaining context and coherence across turns.

Understanding roles
Roles are used to represent the conversational input from the user and the assistant.
User: Represents input from the user, such as a request or question sent to the model.
Assistant: Represents the model's response, either as a reply or part of the conversation history in a prompt.
You can manually change the roles via the dropdown when writing the conversational prompt to define the prompt input. This flexibility allows you to simulate various conversational dynamics and test how the model responds to different types of interactions.

Write conversation manually
In the Add conversation dialog:

Write the prompt to represent the input based on your needs, whether it is for the assistant or user roles.
Use the role dropdown to specify the role for each message (user or assistant).
Enter the content of the message in the provided text area.
Add more messages to the conversation:
You can also add more messages in this dialog. To add a message, hover to the text input, and there will be 3 buttons:
Add above: When clicked, a new text input will appear above the current text input that you are hovering.
Add below: When clicked, a new text input will appear under the current text input that you are hovering.
Delete: When clicked, it will delete the message.
Reorder the conversation: You can drag and drop each message to reorder the conversation.

Attach files and URLs:
You can attach files or URLs to messages with the User role. This capability is useful for simulating real-world scenarios where users might share documents or links. Learn more about file attachment.

Create the JSON file format
Structure:
The core structure is an array of objects:
Fields:
content:This field holds the actual message or interaction data.
It can be a simple string for plain text messages.
Alternatively, it can be an array of objects to include attachments like URLs or images.
This field cannot be empty. Every conversation turn must contain content.
role:This field indicates the speaker's role in the conversation.
It can be either
"user"or"assistant".
Attachments (URLs and files):
To include attachments, the content field should be an array of objects. Each object within this array can represent text, a file URL, or a website URL.
Text:
Use
{"type": "text", "text": "Your text here"}.
File URL:
Use
{"type": "image_url", "image_url": {"url": "<https://example.com/image.jpg>"}}.
URL (Website link):
Use
{"type": "image_url", "url": "<https://example.com>"}.
Sample JSON file:
Conversational vs basic prompt

Conversational prompt
Maintains and understands the full history of the conversation.
Handles back-and-forth dialogue naturally.
Generates replies based on accumulated context.
Basic prompt
Treats each input as an independent request.
Has no memory of previous interactions.
Generates replies based solely on the immediate input.
Last updated