Roleplay AI v0.2.0 icon

Roleplay AI v0.2.0

Interact with AI models for roleplaying scenarios

Overview

This node enables interaction with AI models specifically tailored for roleplaying chat scenarios. It allows users to simulate conversations with AI characters by defining character details, scenarios, and conversation context. The node is useful for creating immersive roleplay experiences, storytelling, game NPC dialogues, or testing conversational AI in a controlled setting.

Typical use cases include:

  • Roleplaying games where the AI acts as a character.
  • Story generation with interactive dialogue.
  • Testing AI behavior in custom conversational contexts.
  • Simulating customer support or training scenarios with predefined roles.

The node supports selecting from predefined AI models or specifying custom model identifiers, and it can incorporate detailed instructions, chat history, and formatting guidelines to shape the AI's responses.

Properties

Name Meaning
Use Custom Model Whether to specify a custom model identifier instead of choosing from a list.
Model Name or ID Select an AI model from a loaded list of available models.
Custom Model Identifier Enter a custom model identifier string (e.g., "gpt-4-turbo", "claude-3-opus").
Character Name Name of the AI character in the roleplay (required).
Include User Name Whether to include a custom user name in the conversation.
User Name Name of the user in the roleplay; defaults to "you" if not specified.
Character Description Description of the character’s role and personality (required).
First Message The initial message from the character to start the conversation (required).
Include Scenario Whether to include scenario details in the prompt.
Scenario Description of the roleplay scenario.
Include Message Example Whether to include example messages illustrating the conversation format.
Message Example Example conversation format text.
Include Model Preset Whether to include preset instructions for the model’s behavior.
Model Preset Instructions guiding the model’s behavior.
Include Format Guidelines Whether to include guidelines on how the response should be formatted.
Format Guidelines Formatting instructions for the AI responses.
Chat Summary Summary of the chat history inserted after the first message in the format {"system":"{chat_summary}"}; leave empty to omit.
Chat History JSON array representing previous chat messages with fields: role (user/assistant), content (message text), and optional name.
Include Other Pre-Message Whether to include additional pre-message instructions.
Other Pre-Message Additional instructions to include before the conversation starts.
User Message The message sent by the user to the chat model (required).
Include Raw Output Whether to include the raw message data in the output.
Include Request Log Whether to include the request configuration details in the output.
Temperature Sampling temperature controlling randomness of the AI output (e.g., 0.9).
Extra Body Whether to include extra body parameters for specific models.
Extra Body Content JSON-like content for extra model-specific settings (e.g., "enable_thinking": true, "thinking_budget": 50).
Additional Fields Collection of additional parameters such as frequency penalty, max tokens, presence penalty, and top-p sampling.

Output

The node outputs JSON objects containing the AI-generated response and optionally additional data:

  • response: The text generated by the AI model as the reply from the roleplay character.
  • raw_data (optional): The full array of messages including system, user, and assistant messages used in the conversation, if "Include Raw Output" is enabled.
  • log (optional): The HTTP request configuration used to call the AI API, if "Include Request Log" is enabled.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for the Roleplay AI service.
  • Supports multiple AI providers (e.g., OpenAI, Anthropic, Ollama) configured via the base URL and provider type in credentials.
  • Network access to the AI service endpoint is required.
  • Properly formatted JSON input for chat history and extra body content is necessary when used.

Troubleshooting

  • Invalid API Key: If no valid API key is provided, the node will throw an error. Ensure the API key credential is correctly set up.
  • Invalid Chat History Format: If the chat history JSON is malformed or incorrectly structured, an error will occur. Validate JSON format and structure before input.
  • Invalid Extra Body Content: Errors may arise if the extra body content is not valid JSON or uses incorrect boolean casing. Use lowercase true/false and ensure valid JSON syntax inside the braces.
  • Unexpected API Response Format: If the AI API returns unexpected data structures, errors like "Invalid response format" will be thrown. This might indicate changes in the API or misconfiguration.
  • Model Not Found: If no valid models are found during model loading, verify API connectivity and credentials.
  • Network Issues: Timeouts or connection errors can occur if the AI service is unreachable.

Links and References

Discussion