HumanFirst icon

HumanFirst

Call HumanFirst playbook API

Create Package

AI-generated

Overview

This node operation creates a new package (referred to as a 'prompt' in the API) within a specified playbook in the HumanFirst platform. It allows users to define various parameters for the package, such as its name, contents, natural language generation (NLG) model parameters (temperature, top-p, max tokens, stop sequences, frequency penalty, presence penalty), post-processing options, run mode, parent package ID, position, metadata, source information, additional parameters, and an optional NLG timeout. This operation is useful for automating the creation of customized packages in a playbook, which can be used for tasks like generating text completions or managing conversational AI workflows.

Use Case Examples

  1. Creating a new prompt package in a playbook with specific NLG parameters and metadata.
  2. Automating the addition of a package to a playbook with custom post-processing and run mode settings.

Properties

Name Meaning
Namespace The namespace under which the playbook exists, required to identify the playbook context.
Playbook ID The unique identifier of the playbook where the package will be created.
Name The name of the package to be created. Defaults to 'Package' with a timestamp suffix if not changed.
Contents The main content or body of the package.
Temperature NLG model parameter controlling randomness in text generation.
Top-P NLG model parameter controlling nucleus sampling for text generation.
Max Tokens Maximum number of tokens to generate in the output.
Stop Sequences (JSON Array) JSON array of strings that define stop sequences for the text generation.
Frequency Penalty NLG model parameter to penalize new tokens based on their existing frequency in the text so far.
Presence Penalty NLG model parameter to penalize new tokens based on whether they appear in the text so far.
Post-Processing Option to specify how the generated text should be post-processed (e.g., none, newlines, conversations, key-value, delimiter).
Delimiter (if Post-Processing = Delimiter) Custom delimiter string used if post-processing is set to 'Delimiter'.
Run Mode Determines whether the package runs once merging all items or runs on each item individually.
Parent Package ID Optional ID of a parent package to establish hierarchy.
Position Position index of the package within the playbook.
Metadata (JSON) Additional metadata for the package in JSON format.
Source (JSON) Source information for the package in JSON format.
Parameters (JSON Array) Array of parameters for the package in JSON format.
NLG Timeout (ISO Duration) Optional timeout duration for natural language generation in ISO format.

Output

JSON

  • json - The JSON response from the HumanFirst API containing details of the created package.

Dependencies

  • HumanFirst API key credential required for authentication.

Troubleshooting

  • Ensure that the 'namespace' and 'playbookId' parameters are correctly set and correspond to existing entities in the HumanFirst platform.
  • Verify that JSON inputs such as 'stop_sequences', 'metadata', 'source', and 'parameters' are valid JSON strings to avoid parsing errors.
  • If the package name is left as default 'Package', a timestamp suffix is automatically added to avoid naming conflicts.
  • API request failures may occur due to network issues or invalid API keys; check credentials and network connectivity.
  • Timeouts or errors during package creation might be related to large input sizes or server-side issues; consider adjusting the 'NLG Timeout' parameter or retrying later.

Discussion