By adding data using the SDK, you can:

  • Create new datasets programmatically.
  • Add structured data efficiently.
  • Automate dataset updates.
  • Seamlessly integrate with Future AGI’s data processing pipeline.

1. Accessing the SDK Integration Panel

To add data using the SDK:

  1. Go to the “Datasets & Experiments” Section
    • Navigate to the Datasets page from the main dashboard.
    • Click on the “Add Dataset” button.
  2. Select “Add Data Using SDK”
    • A pop-up will appear with various dataset creation methods.
    • Choose “Add Data Using SDK” to proceed.

2. Creating a Dataset

  1. Enter a Dataset Name
    • A prompt appears asking for the dataset name.
    • Enter a clear, descriptive name
    • Click “Next” to proceed.
  2. Review Dataset Creation Settings
    • The interface confirms the dataset setup before proceeding.
    • Click “Next” to generate the SDK integration code.

3. Generating SDK Integration Code

  1. View Pre-Generated Code
    • The system generates ready-to-use SDK code in multiple languages:
      • Python
      • TypeScript
      • cURL
    • The code includes:
      • API key authentication.
      • Dataset creation command.
      • Methods for adding data.

Adding Data using SDK

# pip install futureagi

import os
os.environ["FI_API_KEY"] = "YOUR_FI_API_KEY"  # Replace with your actual API key
os.environ["FI_SECRET_KEY"] = "YOUR_FI_SECRET_KEY" # Replace with your actual secret key
os.environ["FI_BASE_URL"] = "https://api.futureagi.com"

from fi.datasets import DatasetClient

columns = [
    {
        "name": "text",
        "data_type": "text"
    },
    {
        "name": "label",
        "data_type": "integer"
    }
]

rows = [
    {
        "cells": [
            {
                "column_name": "text",
                "value": "Hello, world!"
            },
            {
                "column_name": "label",
                "value": 0
            }
        ]
    }
]

try:
    DatasetClient.add_dataset_columns(dataset_name="dataset-1", columns=columns)
    DatasetClient.add_dataset_rows(dataset_name="dataset-1", rows=rows)

except Exception as e:
    print(f"Failed to add data: {e}")

4. Adding Data to the Dataset

  1. Use the SDK Code to Add Data
    • Paste the copied SDK code into your development environment.
    • Replace any placeholder values if necessary.
    • Execute the script to send data to the dataset.
  2. Confirm Data Upload
    • After execution, the dataset will be populated with the provided data.
    • The dataset will appear in the Datasets & Experiments list.

5. Viewing the Dataset

  1. Navigate to the Dataset List
    • The newly created dataset is now visible in the Datasets panel.
    • Displays dataset details such as:
      • Name
      • Type (e.g., Generative)
      • Number of data points
      • Associated experiments and evaluations
  2. Verify Data Entries
    • Click on the dataset name to inspect the added rows.
    • Check for correct formatting and structure.

Using the SDK, you can efficiently create and manage datasets in Future AGI. This method provides a scalable way to ingest, update, and automate data handling, making it suitable for AI-driven workflows and large-scale applications.