Literal AI icon

Literal AI

Use the Literal AI API

Overview

This node integrates with the Literal AI API to perform various operations related to AI project management, including user handling, scoring, projects, steps, files, threads, datasets, experiments, and prompts. Specifically, for the Step resource and Create Generation operation, it allows users to create a new generation within a step by sending structured generation data to the API.

Common scenarios where this node is beneficial include:

  • Automating the creation of AI-generated content or results as part of a workflow.
  • Managing AI experiment outputs programmatically.
  • Integrating AI generation steps into larger automation pipelines.

For example, you might use this node to submit generation data (such as text completions, image generations, or other AI outputs) to the Literal AI platform as part of an automated content creation process.

Properties

Name Meaning
Generation JSON object containing the generation data to create. This should be structured according to the Literal AI API's expected format for a generation.

Output

The node outputs a single item with a json field containing a content property. This content holds the response from the Literal AI API after creating the generation. The structure of this response depends on the API but typically includes details about the newly created generation such as its ID, status, timestamps, and any generated content metadata.

If the node supports binary data output in other operations, it is not applicable here; this operation deals purely with JSON data.

Example output structure:

{
  "content": {
    "id": "string",
    "stepId": "string",
    "output": { /* generation output data */ },
    "status": "string",
    "createdAt": "timestamp",
    // ... other generation metadata
  }
}

Dependencies

  • Requires an API key credential for the Literal AI API to authenticate requests.
  • Uses the official @literalai/client library bundled with the node to interact with the API.
  • No additional environment variables are explicitly required beyond the API key credential.

Troubleshooting

  • Invalid JSON in Generation Property: Since the generation data must be provided as valid JSON, malformed JSON will cause parsing errors. Ensure the input is correctly formatted.
  • API Authentication Errors: If the API key is missing, invalid, or expired, the node will fail to authenticate. Verify that the API key credential is correctly configured.
  • API Response Errors: The API may return errors if required fields in the generation data are missing or invalid. Consult the Literal AI API documentation for required generation schema.
  • Network Issues: Connectivity problems can cause request failures. Check network access and proxy settings if applicable.
  • Continue On Fail Behavior: If enabled, the node will continue processing subsequent items even if one fails, returning error messages in the output JSON.

Links and References

Discussion