Font Size:

BeanShell Prompt

Introduction

The BeanShell Prompt allows you to run custom Java code within your AI agent or application. This is useful for performing advanced logic, manipulating data, or preparing inputs dynamically before passing them to the AI or other components.

With BeanShell, developers can write powerful scripts that interact with form data, session variables, external APIs, and more, giving full control over the flow and behavior of the AI agent.

Use Beanshell when you need custom calculations, conditional processing, or any logic that goes beyond simple configuration.

Get started

How to use it

To use the BeanShell Element, add the Beanshell prompt:

  1. Locate the BeanShell element under the Prompts section of the palette.
  2. Drag and drop the File element into the Drop a prompt here section.

Configure Form Properties

To properly integrate and configure the Beanshell, set the following fields:

  • Script: The script is where you define how the Beanshell interacts with the OpenAI API and other form data. You can write custom Java-based Beanshell code to manipulate inputs, format prompts, or dynamically retrieve content before sending it to OpenAI.

  • Purpose: This is a short, human-readable description of what the OpenAI element is being used for. It helps the AI agent understand the context of the request and tailor its response more effectively.

 

Created by Gabriel Last modified by Gabriel on Jun 24, 2025