Literal AI icon

Literal AI

Use the Literal AI API

Overview

This node integrates with the Literal AI API to manage datasets within the Literal AI platform. Specifically, the Update Dataset operation allows users to modify existing datasets by updating their metadata such as description, type, and additional JSON metadata.

Common scenarios where this node is beneficial include:

  • Keeping dataset information up-to-date as project requirements evolve.
  • Adding or refining metadata to improve dataset organization and searchability.
  • Changing the dataset type (e.g., from evaluation to training) to reflect its current use case.

Practical example:

  • A user has a dataset initially created for evaluation but now wants to repurpose it for training. Using this node, they can update the dataset's type property accordingly without recreating the dataset.

Properties

Name Meaning
Dataset ID The unique identifier of the dataset to update.
Additional Fields Optional fields to update on the dataset:
- Description Text description providing details about the dataset.
- Metadata Additional metadata in JSON format to store custom key-value pairs related to the dataset.
- Type The category of the dataset; options are evaluation or training.

Output

The node outputs a JSON object under the content field containing the response from the Literal AI API after updating the dataset. This typically includes the updated dataset details such as its ID, name, description, metadata, and type.

Example output structure:

{
  "content": {
    "id": "string",
    "name": "string",
    "description": "string",
    "metadata": { /* JSON object */ },
    "type": "evaluation" | "training",
    // other dataset properties returned by the API
  }
}

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for the Literal AI API configured in n8n.
  • The node uses the official Literal AI client library (@literalai/client) to interact with the API.
  • Proper network access to Literal AI endpoints is necessary.

Troubleshooting

  • Invalid Dataset ID: If the provided Dataset ID does not exist or is malformed, the API will return an error. Verify the Dataset ID is correct.
  • Malformed JSON in Metadata: The metadata field must be valid JSON. Invalid JSON syntax will cause parsing errors. Use proper JSON formatting.
  • Missing Required Fields: The Dataset ID is required. Omitting it will cause the node to fail.
  • API Authentication Errors: Ensure the API key credential is correctly set up and has sufficient permissions.
  • Network Issues: Connectivity problems to the Literal AI API endpoint will result in request failures.

If the node is set to continue on failure, errors will be returned in the output JSON under an error field.

Links and References

Discussion