prompt2bpmn

1.0.1 • Public • Published

promt2bpmn

prompt to BPMN 2 diagram nodejs module

description

This module allows you to generate a BPMN 2 diagram from a prompt using the Vertex AI API from Google Cloud.

Returns a string with the BPMN 2 diagram, or some guidelines if the prompt is not enough to generate the diagram.

prerequisites

You have to set the enviroment variables:

GOOGLE_APPLICATION_CREDENTIALS = path to the json file with the credentials
VERTEX_PROJECT = project id
VERTEX_LOCATION = location

usage example

const { promptToBpmn } = require('prompt2bpmn');

async function generateBpmn() {
    try {
        // Set environment variables
        process.env.GOOGLE_APPLICATION_CREDENTIALS = '/path/to/credentials.json';
        process.env.VERTEX_PROJECT = 'your-project-id';
        process.env.VERTEX_LOCATION = 'your-location';

        // Call promptToBpmn function
        const bpmn = await promptToBpmn('Enter your prompt here');

        // Print the generated BPMN diagram
        console.log(bpmn);
    } catch (error) {
        console.error('Error:', error);
    }
}

generateBpmn();

Readme

Keywords

none

Package Sidebar

Install

npm i prompt2bpmn

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

20.1 kB

Total Files

21

Last publish

Collaborators

  • sl45sms