Literal AI icon

Literal AI

Use the Literal AI API

Overview

This node integrates with the Literal AI API to manage various resources, including scores. Specifically, the "Score" resource with the "Create Many" operation allows users to create multiple score entries in bulk by providing an array of score objects. This is useful when you need to submit or log several scores at once, for example, after processing a batch of AI model outputs or evaluation metrics.

Practical examples:

  • Bulk uploading evaluation scores for multiple AI model steps.
  • Creating many feedback scores simultaneously from a dataset.
  • Automating score creation as part of a larger AI workflow where multiple results are generated and scored.

Properties

Name Meaning
Scores An array of score objects to create. Each object should contain the necessary fields as expected by the Literal AI API's score creation endpoint. The input must be provided as a JSON array.

Output

The node outputs a single item containing a json field with a content property. This content holds the response from the Literal AI API after creating the scores. The structure of this response depends on the API but typically includes details about the created scores such as their IDs, values, types, and associated metadata.

No binary data output is indicated for this operation.

Example output structure (conceptual):

{
  "content": [
    {
      "id": "score1",
      "name": "...",
      "type": "...",
      "value": "...",
      "stepId": "...",
      "comment": "..."
    },
    {
      "id": "score2",
      "name": "...",
      "type": "...",
      "value": "...",
      "stepId": "...",
      "comment": "..."
    }
  ]
}

Dependencies

  • Requires an API key credential for the Literal AI API to authenticate requests.
  • The node uses the official Literal AI client library (@literalai/client) to interact with the API.
  • Proper configuration of the API key credential within n8n is necessary before using this node.

Troubleshooting

  • Invalid JSON in Scores Property: Since the "Scores" input expects a JSON array, malformed JSON will cause parsing errors. Ensure the JSON syntax is correct.
  • 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 set up.
  • API Rate Limits or Quotas: Bulk creation might hit API rate limits. If errors related to rate limiting occur, consider reducing batch size or adding delays.
  • Unexpected API Response: If the API changes or returns unexpected data, the node may not handle it gracefully. Check the API documentation and update the node or inputs accordingly.
  • Continue On Fail Behavior: If enabled, the node will continue processing other items even if one fails, returning error messages in the output JSON under an error property.

Links and References

Discussion