Using Datasets in PromptMixer
Overview
Datasets in PromptMixer are designed to help you test and evaluate the performance of your prompts with multiple variations of input data efficiently. By leveraging datasets, you can run a prompt once for each row in your dataset, which is especially useful for large datasets with thousands of entries. Additionally, you'll find guidance on how to use and handle CSV files as a single context using tools like the Llamaindex Connector.
Understanding the Intended Use of Datasets
When you run a prompt in PromptMixer with a dataset, the system processes each row individually. This means that if your dataset contains, for example, 1000 rows, clicking "Run" on the prompt will generate 1000 requests—one for each row.
Example of Using Datasets
Consider you have a dataset with three columns: "Name", "Topic", and "Context". Your prompt could be structured as follows:
Write a response for [[Dataset Name.Name]] about [[Dataset Name.Topic]]. Here is the context: [[Dataset Name.Context]]
In this setup, the PromptMixer will execute the prompt for each row in the dataset, replacing the placeholders with the actual values from the respective columns. This allows you to test the prompt with a variety of names, topics, and contexts simultaneously in a single click.
Sample Dataset Structure
Name | Topic | Context |
---|---|---|
Alice | AI and Machine Learning | AI is transforming industries. |
Bob | Sustainable Energy | Renewable sources like wind and solar. |
Charlie | Blockchain | Blockchain technology and its applications. |
Using the above Dataset in PromptMixer
For the above dataset, the prompt:
Write a response for [[Dataset Name.Name]] about [[Dataset Name.Topic]]. Here is the context: [[Dataset Name.Context]]
will generate three different prompts, each with a unique combination of Name, Topic, and Context. The system will run the prompt three times, once for each row in the dataset:
- Write a response for Alice about AI and Machine Learning. Here is the context: AI is transforming industries.
- Write a response for Bob about Sustainable Energy. Here is the context: Renewable sources like wind and solar.
- Write a response for Charlie about Blockchain. Here is the context: Blockchain technology and its applications.
This provides a quick and efficient way to validate and adjust your prompts as necessary.
Using a CSV File as a Single Context
If you prefer to use a CSV file as a single context for your prompt, an alternative approach involves a tool like the Llamaindex Connector. This tool allows you to pass the CSV file as a link, so the prompt will use the entire file as the context, rather than iterating through each row.
Llamaindex Connector
Using the Llamaindex Connector can be particularly useful when you need the whole CSV file contextually rather than breaking it down row by row. You can find more information and repository details here: PromptMixer Llamaindex Connector.
Specific Use Cases and Custom Connectors
If you have a unique use case that isn't adequately addressed by the methods described above, please reach out to us with more details at [email protected]. We are happy to provide guidance or develop a custom connector to meet your specific requirements.
Summary
The datasets feature in PromptMixer is designed to allow you to test your prompts with multiple variations of input data efficiently. For scenarios where you need to use a CSV file as a single context, considering tools like the Llamaindex Connector is advisable. Remember, for any unique needs or further assistance, feel free to reach out to us directly.