Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:FlowiseAI Flowise CreateDataset

From Leeroopedia
Property Value
Implementation Name CreateDataset
Implements Principle:FlowiseAI_Flowise_Evaluation_Dataset_Creation
Source packages/ui/src/api/dataset.js
Repository FlowiseAI/Flowise
Domain API Client, Dataset Management
Last Updated 2026-02-12 14:00 GMT

Code Reference

Source Location

The dataset creation API functions are defined in packages/ui/src/api/dataset.js. The createDataset function is at line 7, and createDatasetRow is at line 12.

Signature

// packages/ui/src/api/dataset.js:L7
const createDataset = (body) => client.post(`/datasets/set`, body)

// packages/ui/src/api/dataset.js:L12
const createDatasetRow = (body) => client.post(`/datasets/rows`, body)

The API client is configured at packages/ui/src/api/client.js with a base URL of ${baseURL}/api/v1, making the full endpoints:

  • POST /api/v1/datasets/set for dataset creation
  • POST /api/v1/datasets/rows for row creation

Import

import datasetApi from '@/api/dataset'

I/O Contract

createDataset

Inputs:

  • body (Object):
    • name (string, required): The display name of the dataset
    • description (string, optional): A description of the dataset purpose
    • firstRowHeaders (boolean, optional): Whether the CSV file's first row contains column headers
    • csvFile (File, optional): A CSV file for bulk import of rows

Outputs:

  • Promise<{data: {id: string}}>: Resolves with the created dataset's unique identifier

createDatasetRow

Inputs:

  • body (Object):
    • datasetId (string, required): The ID of the dataset to add the row to
    • input (string, required): The input prompt text for the test case
    • output (string, required): The expected output text for the test case

Outputs:

  • Promise<{data: {id: string}}>: Resolves with the created row's unique identifier

Usage Examples

Creating a New Dataset

import datasetApi from '@/api/dataset'

// Create a new evaluation dataset
const response = await datasetApi.createDataset({
    name: 'Customer Support QA',
    description: 'Test cases for customer support chatflow evaluation'
})
const datasetId = response.data.id

Adding Individual Rows

import datasetApi from '@/api/dataset'

// Add a test case row to an existing dataset
await datasetApi.createDatasetRow({
    datasetId: 'dataset-abc-123',
    input: 'What are your business hours?',
    output: 'Our business hours are Monday to Friday, 9 AM to 5 PM EST.'
})

Bulk CSV Upload

import datasetApi from '@/api/dataset'

// Create a dataset with CSV upload
const formData = new FormData()
formData.append('name', 'Product FAQ Tests')
formData.append('firstRowHeaders', true)
formData.append('csvFile', csvFileObject)

await datasetApi.createDataset(formData)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment