A Flatfile plugin that generates example records using AI
npm i @flatfile/plugin-import-llm-records
The @flatfile/plugin-import-llm-records
plugin automatically generates example records using an LLM of your choice, providing realistic and contextually relevant records for your Sheet by analyzing the Sheet's Field configuration.
Event Type:
job:ready
The importLLMRecords
function accepts a configuration object with the following properties:
llmSecretName
(string): The name of the secret that contains the LLM API key.model
(string): The name of the LLM to use.job
(string): The Sheet-level operation name to listen for in the job:ready event.numberOfRecords
(number): The number of example records to generate (default: 10)debug
(boolean): Whether to log debug information (default: false)To install the LLM Record Generator Plugin, run the following command in your project directory:
npm install @flatfile/plugin-import-llm-records
import type { FlatfileListener } from '@flatfile/listener';
import { importLLMRecords } from '@flatfile/plugin-import-llm-records';
export default function (listener: FlatfileListener) {
listener.use(
importLLMRecords({
llmSecretName: 'LLM_API_KEY',
model: 'gpt-4o',
job: 'generateExampleRecords',
numberOfRecords: 10
})
)
}
Contributions are welcome! Please feel free to submit a Pull Request.