@fractal-solutions/qflow 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +504 -0
- package/README.md +182 -52
- package/dist/agent/tools.d.ts +3114 -181
- package/dist/agent/tools.js +492 -0
- package/dist/nodes/browser_control.d.ts +4 -0
- package/dist/nodes/browser_control.js +73 -0
- package/dist/nodes/data_validation.d.ts +9 -0
- package/dist/nodes/data_validation.js +48 -0
- package/dist/nodes/display_image.d.ts +4 -0
- package/dist/nodes/display_image.js +46 -0
- package/dist/nodes/gis.d.ts +37 -0
- package/dist/nodes/gis.js +106 -0
- package/dist/nodes/git.d.ts +4 -0
- package/dist/nodes/git.js +55 -0
- package/dist/nodes/hardware_interaction.d.ts +8 -0
- package/dist/nodes/hardware_interaction.js +97 -0
- package/dist/nodes/image_gallery.d.ts +8 -0
- package/dist/nodes/image_gallery.js +99 -0
- package/dist/nodes/index.d.ts +12 -0
- package/dist/nodes/index.js +12 -0
- package/dist/nodes/multimedia_processing.d.ts +10 -0
- package/dist/nodes/multimedia_processing.js +79 -0
- package/dist/nodes/pdf_processor.d.ts +4 -0
- package/dist/nodes/pdf_processor.js +75 -0
- package/dist/nodes/remote_execution.d.ts +4 -0
- package/dist/nodes/remote_execution.js +82 -0
- package/dist/nodes/scheduler.d.ts +20 -0
- package/dist/nodes/scheduler.js +97 -0
- package/dist/nodes/speech_synthesis.d.ts +45 -0
- package/dist/nodes/speech_synthesis.js +142 -0
- package/dist/nodes/spreadsheet.d.ts +10 -0
- package/dist/nodes/spreadsheet.js +241 -0
- package/dist/nodes/webhook.d.ts +15 -0
- package/dist/nodes/webhook.js +110 -0
- package/dist/nodes/websockets.d.ts +4 -0
- package/dist/nodes/websockets.js +73 -0
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
`qflow` is a lightweight and flexible JavaScript library designed for creating and managing complex workflows and autonomous agents. It provides a minimalist yet expressive API to define sequences of operations, manage data flow, and orchestrate execution, supporting both synchronous and asynchronous patterns.
|
|
4
4
|
|
|
5
|
-
With zero external dependencies for its core functionality, `qflow` is built for performance and seamless integration into any JavaScript environment, from Node.js backends to browser-based applications.
|
|
6
|
-
|
|
7
5
|
## Features
|
|
8
6
|
|
|
9
7
|
* **Modular & Extensible:** Easily define custom nodes and compose them into complex, reusable flows.
|
|
10
8
|
* **Synchronous & Asynchronous Flows:** Supports both blocking and non-blocking execution models.
|
|
11
9
|
* **Shared State Management:** Pass and manipulate data across nodes using a central, mutable `shared` object.
|
|
12
10
|
* **Batch Processing:** Efficiently process collections of data through dedicated batch nodes and flows, including parallel execution.
|
|
13
|
-
* **
|
|
14
|
-
* **
|
|
15
|
-
* **
|
|
11
|
+
* **Agents:** Built upon the `qflow` core functionality are plug and play agents with extensive tool integrations available.
|
|
12
|
+
* **Built-in Integrations:** Comes with pre-built nodes for multiple tasks like LLM interactions, browser use, pdf tools, webhooks, spreadsheet manipulation, code interpretation, media manipulation, web scraping, and popular API integrations (GitHub, Git, Open Router, HackerNews, Stripe, Maps).
|
|
13
|
+
* **Custom Agent Tools:** Build your own Agent tools using the flow registry pattern.
|
|
16
14
|
|
|
17
15
|
## Installation
|
|
18
16
|
|
|
@@ -57,7 +55,6 @@ The fundamental building block of any `qflow` workflow. A `Node` represents a si
|
|
|
57
55
|
* `post(shared, prepRes, execRes)`: Processes the result of `exec`. Receives the `shared` object.
|
|
58
56
|
* `setParams(params)`: Configures the node with specific parameters. Parameters are accessible via `this.params`.
|
|
59
57
|
* `next(node, action = "default")`: Chains this node to another, defining the next step in the flow.
|
|
60
|
-
* `transition(action)`: Initiates a conditional transition to another node, allowing for dynamic branching.
|
|
61
58
|
|
|
62
59
|
**Asynchronous Nodes (`AsyncNode`, `AsyncBatchNode`, `AsyncParallelBatchNode`)**
|
|
63
60
|
For operations that involve I/O or are inherently asynchronous, `qflow` provides `AsyncNode` and its variants. These nodes leverage `async`/`await` for non-blocking execution. When working within `AsyncFlow`s, it's crucial to implement the `async` versions of the lifecycle methods:
|
|
@@ -78,18 +75,11 @@ A `Flow` orchestrates the execution of a sequence of `Node`s. It defines the ove
|
|
|
78
75
|
**Batch Flows (`BatchFlow`, `AsyncBatchFlow`, `AsyncParallelBatchFlow`)**
|
|
79
76
|
These specialized flows are designed to process collections of items. They run a sub-flow for each item in the batch. `AsyncParallelBatchFlow` is particularly useful for concurrently processing batch items, significantly speeding up operations.
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
A helper class used in conjunction with `Node.transition()` to define conditional branching within your workflows.
|
|
84
|
-
|
|
85
|
-
* `to(targetNode)`: Specifies the target node for the transition based on the action returned by the preceding node.
|
|
86
|
-
|
|
78
|
+
## Agents
|
|
87
79
|
|
|
88
|
-
|
|
80
|
+
The introduction of the `AgentNode` is a game-changer for qflow. It shifts the paradigm from pre-defined, static workflows to dynamic, intelligent, and autonomous task execution.
|
|
89
81
|
|
|
90
|
-
|
|
91
|
-
The introduction of the `AgentNode` is a game-changer for qflow. It shifts the paradigm from
|
|
92
|
-
pre-defined, static workflows to dynamic, intelligent, and autonomous task execution.
|
|
82
|
+
### What Can We Do Now That We Have Agents?
|
|
93
83
|
|
|
94
84
|
Here are some key capabilities and applications unlocked by having agents:
|
|
95
85
|
|
|
@@ -114,14 +104,13 @@ A helper class used in conjunction with `Node.transition()` to define conditiona
|
|
|
114
104
|
interactive. They can ask clarifying questions, seek approval for critical actions, or
|
|
115
105
|
provide progress updates, making them more collaborative.
|
|
116
106
|
7. **Data Analysis and Reporting:** Agents can gather data from various sources (web, files,
|
|
117
|
-
APIs), process it
|
|
107
|
+
APIs), process it, and then synthesize
|
|
118
108
|
findings into structured reports or summaries.
|
|
119
109
|
8. **Research and Information Synthesis:** Agents can research topics, scrape relevant pages,
|
|
120
110
|
and synthesize information into comprehensive answers or documents, acting as automated
|
|
121
111
|
research assistants.
|
|
122
112
|
|
|
123
|
-
##
|
|
124
|
-
|
|
113
|
+
## Integrated Nodes and their Examples
|
|
125
114
|
|
|
126
115
|
The examples in [Basic Usage & Examples](#basic-usage--examples) below will cover the core functionalities of `qflow`. For more advanced and specific use cases involving the built-in integrations, please explore the [`examples/` folder](https://github.com/fractal-solutions/qflow/tree/main/examples) in the project's GitHub repository. There you will find detailed scripts demonstrating how to use nodes for:
|
|
127
116
|
|
|
@@ -139,14 +128,49 @@ The examples in [Basic Usage & Examples](#basic-usage--examples) below will cove
|
|
|
139
128
|
* [**Shell:**](#8-shell-command-example) For system-level interaction and execution.
|
|
140
129
|
* [**HTTP:**](#10-generic-http-request-example) For universal API access.
|
|
141
130
|
* [**FileSystem:**](#9-file-system-example) For reading and writing local data.
|
|
142
|
-
* **User Input:** For human-in-the-loop control.
|
|
143
131
|
* [**Web Search:**](#11-web-search-example) Discovering information on the web using either:
|
|
144
132
|
* `DuckDuckGoSearchNode`: API-key-free, using DuckDuckGo's HTML interface.
|
|
145
133
|
* `GoogleSearchNode`: Requires a Google API Key and Custom Search Engine ID for more robust results.
|
|
146
|
-
* **WebScraper:** For targeted web scraping.
|
|
134
|
+
* [**WebScraper:**](https://github.com/fractal-solutions/qflow/blob/main/examples/webscraper_test.js) For targeted web scraping.
|
|
135
|
+
* [**BrowserControl:**](https://github.com/fractal-solutions/qflow/blob/main/examples/browser_control_test.js) For controlling a web browser with Playwright.
|
|
136
|
+
* [**Git:**](https://github.com/fractal-solutions/qflow/blob/main/examples/git_example.js) For performing Git operations.
|
|
137
|
+
* [**WebSockets:**](https://github.com/fractal-solutions/qflow/blob/main/examples/websockets_test.js) For real-time, two-way communication with web services.
|
|
147
138
|
* [**DataExtractor:**](#13-data-extraction-example) For targeted data extraction.
|
|
148
|
-
* **
|
|
149
|
-
* **
|
|
139
|
+
* [**PDF Processor:**](https://github.com/fractal-solutions/qflow/blob/main/examples/pdf_processor_example.js) For extracting text and images from PDF documents.
|
|
140
|
+
* **Prerequisite:** Requires `poppler-utils` to be installed on your system.
|
|
141
|
+
* **Linux (Debian/Ubuntu):** `sudo apt-get install poppler-utils`
|
|
142
|
+
* **Linux (Arch/Manjaro):** `sudo pacman -S poppler`
|
|
143
|
+
* **macOS:** `brew install poppler`
|
|
144
|
+
* **Windows:** Install Poppler for Windows and add its executables to your system's PATH.
|
|
145
|
+
* [**GIS:**](https://github.com/fractal-solutions/qflow/blob/main/examples/gis_example.js) For Geographic Information System operations like geocoding and reverse geocoding. Supports multiple providers (OpenStreetMap, Google Maps).
|
|
146
|
+
* **OpenStreetMap:** Free and open-source. No API key required.
|
|
147
|
+
* **Google Maps:** Requires a `GOOGLE_MAPS_API_KEY` environment variable.
|
|
148
|
+
* [**Display Image:**](https://github.com/fractal-solutions/qflow/blob/main/examples/display_image_test.js) For opening image files using the system's default image viewer. Useful for agents to show generated plots or other visual output.
|
|
149
|
+
* [**Image Gallery:**](https://github.com/fractal-solutions/qflow/blob/main/examples/image_gallery_example.js) Generates an HTML gallery from multiple image files and opens it in a web browser. Useful for displaying multiple plots or images in a single view.
|
|
150
|
+
* [**Hardware Interaction:**](https://github.com/fractal-solutions/qflow/blob/main/examples/hardware_interaction_example.js) For communicating with local hardware via serial port (UART).
|
|
151
|
+
* **Prerequisite:** Uses the `serialport` library. This library has native components and may require build tools (Python, C/C++ compiler).
|
|
152
|
+
* **Permissions:** On Linux, your user might need to be added to the `dialout` group (`sudo usermod -a -G dialout $USER`, then log out and back in).
|
|
153
|
+
* [**Speech Synthesis:**](https://github.com/fractal-solutions/qflow/blob/main/examples/speech_synthesis_example.js) Converts text to spoken audio using OS capabilities or cloud APIs.
|
|
154
|
+
* **Prerequisites:**
|
|
155
|
+
* **macOS:** Built-in (`say` command).
|
|
156
|
+
* **Linux:** `espeak` (`sudo apt install espeak` or `sudo pacman -S alsa-utils`).
|
|
157
|
+
* **Google Cloud TTS:** Requires `GOOGLE_TTS_API_KEY` environment variable.
|
|
158
|
+
* [**Multimedia Processing:**](https://github.com/fractal-solutions/qflow/blob/main/examples/multimedia_processing_example.js) Performs various operations on audio and video files using `ffmpeg` (e.g., convert formats, trim, extract audio/frames).
|
|
159
|
+
* **Prerequisite:** Requires `ffmpeg` to be installed on your system.
|
|
160
|
+
* **Linux (Debian/Ubuntu):** `sudo apt install ffmpeg`
|
|
161
|
+
* **Linux (Arch/Manjaro):** `sudo pacman -S ffmpeg`
|
|
162
|
+
* **macOS:** `brew install ffmpeg`
|
|
163
|
+
* **Windows:** Download and install `ffmpeg` and add it to your system's PATH.
|
|
164
|
+
* [**Remote Execution:**](https://github.com/fractal-solutions/qflow/blob/main/examples/remote_execution_example.js) Executes commands on remote machines via SSH.
|
|
165
|
+
* **Prerequisite:** Uses the `ssh2` library. This library has native components and may require build tools (Python, C/C++ compiler).
|
|
166
|
+
* [**Data Validation:**](https://github.com/fractal-solutions/qflow/blob/main/examples/data_validation_example.js) Validates structured data against JSON Schemas.
|
|
167
|
+
* **Prerequisite:** Uses the `ajv` library.
|
|
168
|
+
* [**WebHook:**](https://github.com/fractal-solutions/qflow/blob/main/examples/webhook_example.js) Exposes an HTTP endpoint to receive webhooks, enabling event-driven flows.
|
|
169
|
+
* [**Scheduler:**](https://github.com/fractal-solutions/qflow/blob/main/examples/scheduler_example.js) Schedules `qflow` flows for future or recurring execution.
|
|
170
|
+
* **Prerequisite:** Uses the `node-cron` library.
|
|
171
|
+
* [**System Notification:**](https://github.com/fractal-solutions/qflow/blob/main/examples/system_notification_test.js) For displaying system-level notifications across different operating systems.
|
|
172
|
+
* [**Interactive Input:**](https://github.com/fractal-solutions/qflow/blob/main/examples/interactive_input_test.js) For getting user input via a GUI popup (cross-platform).
|
|
173
|
+
* [**User Input:**](https://github.com/fractal-solutions/qflow/blob/main/examples/user_input_test.js) For human-in-the-loop control.
|
|
150
174
|
* **GitHub:** Creating and managing issues.
|
|
151
175
|
* **HackerNews:** Fetching top stories and item details.
|
|
152
176
|
* **Stripe:** Creating charges and retrieving account balances.
|
|
@@ -1337,6 +1361,10 @@ The `AgentNode` can be equipped with a variety of tools to perform a wide range
|
|
|
1337
1361
|
* `output`: A summary of the final result or the reason for stopping.
|
|
1338
1362
|
* **user_input**: Prompts the user for input and waits for their response.
|
|
1339
1363
|
* `prompt`: The message to display to the user.
|
|
1364
|
+
* **interactive_input**: Prompts the user for input via a GUI popup (cross-platform).
|
|
1365
|
+
* `prompt`: The message to display in the input dialog.
|
|
1366
|
+
* `title`: Optional. The title of the input dialog. Defaults to 'QFlow Input'.
|
|
1367
|
+
* `defaultValue`: Optional. The default value to pre-fill in the input field.
|
|
1340
1368
|
|
|
1341
1369
|
### File System
|
|
1342
1370
|
|
|
@@ -1367,6 +1395,12 @@ The `AgentNode` can be equipped with a variety of tools to perform a wide range
|
|
|
1367
1395
|
* `auth`: Authentication configuration.
|
|
1368
1396
|
* **web_scraper**: Fetches the HTML content of a given URL.
|
|
1369
1397
|
* `url`: The URL to scrape.
|
|
1398
|
+
* **browser_control**: Controls a web browser to navigate pages, interact with elements, and take screenshots.
|
|
1399
|
+
* `action`: The browser action to perform.
|
|
1400
|
+
* `url`: The URL to navigate to (for 'goto' action).
|
|
1401
|
+
* `selector`: A CSS selector to target an element (for 'click' and 'type' actions).
|
|
1402
|
+
* `text`: The text to type into an input field (for 'type' action).
|
|
1403
|
+
* `path`: The file path to save a screenshot (for 'screenshot' action).
|
|
1370
1404
|
|
|
1371
1405
|
### Data & Code
|
|
1372
1406
|
|
|
@@ -1385,52 +1419,148 @@ The `AgentNode` can be equipped with a variety of tools to perform a wide range
|
|
|
1385
1419
|
* **transform_node**: Transforms input data using a provided JavaScript function.
|
|
1386
1420
|
* `input`: The data to be transformed.
|
|
1387
1421
|
* `transformFunction`: A JavaScript function string that takes 'data' as an argument and returns the transformed result.
|
|
1422
|
+
* **pdf_processor**: Extracts text or images from PDF documents.
|
|
1423
|
+
* `filePath`: The absolute path to the PDF file.
|
|
1424
|
+
* `action`: The action to perform: 'extract_text' or 'extract_images'.
|
|
1425
|
+
* `outputDir`: Optional. Directory to save extracted files. If not provided, a temporary directory will be used.
|
|
1426
|
+
* `pageRange`: Optional. Page range to process (e.g., {start: 1, end: 5}).
|
|
1427
|
+
* `password`: Optional. Password for encrypted PDFs.
|
|
1428
|
+
* **spreadsheet**: Reads from and writes to spreadsheet files (.xlsx, .xls, .csv) with advanced manipulation.
|
|
1429
|
+
* `action`: The action to perform.
|
|
1430
|
+
* `filePath`: The absolute path to the spreadsheet file.
|
|
1431
|
+
* `sheetName`: Required for .xlsx/.xls files and sheet-specific actions. The name of the sheet.
|
|
1432
|
+
* `data`: Required for 'write', 'write_range', 'append_rows'. The data to write (array of arrays or array of objects).
|
|
1433
|
+
* `headerRow`: Optional. True if the first row is a header. Defaults to true.
|
|
1434
|
+
* `range`: Required for 'read_range', 'write_range', 'format_cells'. A1 notation (e.g., 'Sheet1!A1:C10').
|
|
1435
|
+
* `startRow`: Required for 'delete_rows', 'insert_rows'. The 1-indexed starting row.
|
|
1436
|
+
* `numRows`: Required for 'delete_rows', 'insert_rows'. The number of rows to delete/insert.
|
|
1437
|
+
* `newSheetName`: Required for 'add_sheet', 'rename_sheet'. The name of the new sheet.
|
|
1438
|
+
* `formats`: Required for 'format_cells'. Formatting options (conceptual, basic XLSX.js has limited styling).
|
|
1439
|
+
* **data_validation**: Validates structured data against a JSON Schema.
|
|
1440
|
+
* `data`: The data to be validated.
|
|
1441
|
+
* `schema`: The JSON Schema object directly.
|
|
1442
|
+
* `schemaPath`: Optional. Path to a JSON Schema file. If provided, 'schema' parameter is ignored.
|
|
1443
|
+
* `action`: The action to perform. Currently only 'validate' is supported.
|
|
1388
1444
|
|
|
1389
1445
|
### Memory & Embeddings
|
|
1390
1446
|
|
|
1391
|
-
* **memory_node**: Stores and retrieves text
|
|
1447
|
+
* **memory_node**: Stores and retrieves text memories (keyword-based).
|
|
1392
1448
|
* `action`: The action to perform: 'store' or 'retrieve'.
|
|
1393
|
-
* `content`: The text content of the memory to store.
|
|
1394
|
-
* `query`: Keywords to search for within stored memories.
|
|
1395
|
-
* `id`: A unique identifier for the memory.
|
|
1396
|
-
* `memoryPath`: The directory path where memories are stored.
|
|
1397
|
-
* **semantic_memory_node**: Stores and retrieves text
|
|
1449
|
+
* `content`: Required for 'store' action. The text content of the memory to store.
|
|
1450
|
+
* `query`: Required for 'retrieve' action. Keywords to search for within stored memories.
|
|
1451
|
+
* `id`: Optional for 'store' action. A unique identifier for the memory. If not provided, one will be generated.
|
|
1452
|
+
* `memoryPath`: Optional. The directory path where memories are stored. Defaults to './agent_memories'.
|
|
1453
|
+
* **semantic_memory_node**: Stores and retrieves text memories via semantic search (requires Ollama).
|
|
1398
1454
|
* `action`: The action to perform: 'store' or 'retrieve'.
|
|
1399
|
-
* `content`: The text content of the memory to store.
|
|
1400
|
-
* `query`: The text query for semantic search.
|
|
1401
|
-
* `id`: A unique identifier for the memory.
|
|
1402
|
-
* `metadata`: Key-value pairs to store alongside the memory.
|
|
1403
|
-
* `memoryPath`: The directory path where memories and the index are stored.
|
|
1404
|
-
* `embeddingModel`: The Ollama embedding model name to use.
|
|
1405
|
-
* `embeddingBaseUrl`: The base URL of the Ollama API for embeddings.
|
|
1406
|
-
* `topK`: The number of top similar results to retrieve.
|
|
1407
|
-
* **generate_embedding**: Generates
|
|
1455
|
+
* `content`: Required for 'store' action. The text content of the memory to store.
|
|
1456
|
+
* `query`: Required for 'retrieve' action. The text query for semantic search.
|
|
1457
|
+
* `id`: Optional for 'store' action. A unique identifier for the memory. If not provided, one will be generated.
|
|
1458
|
+
* `metadata`: Optional for 'store' action. Key-value pairs to store alongside the memory.
|
|
1459
|
+
* `memoryPath`: Optional. The directory path where memories and the index are stored. Defaults to './semantic_memories'.
|
|
1460
|
+
* `embeddingModel`: Optional. The Ollama embedding model name to use (e.g., 'nomic-embed-text'). Defaults to 'nomic-embed-text'.
|
|
1461
|
+
* `embeddingBaseUrl`: Optional. The base URL of the Ollama API for embeddings. Defaults to 'http://localhost:11434'.
|
|
1462
|
+
* `topK`: Optional for 'retrieve' action. The number of top similar results to retrieve. Defaults to 5.
|
|
1463
|
+
* **generate_embedding**: Generates vector embeddings for text (requires Ollama).
|
|
1408
1464
|
* `text`: The text string to generate an embedding for.
|
|
1409
|
-
* `model`: The Ollama embedding model name to use.
|
|
1410
|
-
* `baseUrl`: The base URL of the Ollama API.
|
|
1465
|
+
* `model`: Optional. The Ollama embedding model name to use (e.g., 'nomic-embed-text'). Defaults to 'nomic-embed-text'.
|
|
1466
|
+
* `baseUrl`: Optional. The base URL of the Ollama API (e.g., 'http://localhost:11434'). Defaults to 'http://localhost:11434'.
|
|
1411
1467
|
|
|
1412
1468
|
### Flow Control
|
|
1413
1469
|
|
|
1414
1470
|
* **sub_flow**: Executes a sub-flow.
|
|
1415
|
-
* `flow`: The flow to execute.
|
|
1471
|
+
* `flow`: The name of the flow to execute, as registered in the flow registry.
|
|
1416
1472
|
* `shared`: The shared object to pass to the sub-flow.
|
|
1417
|
-
* **iterator**: Iterates
|
|
1473
|
+
* **iterator**: Iterates items, executes sub-flow for each.
|
|
1418
1474
|
* `items`: The list of items to iterate over.
|
|
1419
|
-
* `flow`: The flow to execute for each item.
|
|
1475
|
+
* `flow`: The name of the flow to execute for each item, as registered in the flow registry.
|
|
1476
|
+
* **scheduler**: Schedules qflow flows for future or recurring execution using cron syntax or a delay.
|
|
1477
|
+
* `action`: The action to perform: 'start' a new schedule or 'stop' an existing one.
|
|
1478
|
+
* `schedule`: Required for 'start'. A cron string (e.g., '0 3 * * *') or a number in milliseconds for a one-time delay.
|
|
1479
|
+
* `flow`: Required for 'start'. The name of the qflow AsyncFlow instance to trigger.
|
|
1480
|
+
* `flowParams`: Optional. Parameters (shared object) to pass to the triggered flow's runAsync.
|
|
1481
|
+
* `id`: Optional. A unique ID for the scheduled task (required for 'stop' action). If not provided for 'start', a random one will be generated.
|
|
1420
1482
|
|
|
1421
1483
|
### LLM Reasoning
|
|
1422
1484
|
|
|
1423
|
-
* **huggingface_llm_reasoning**:
|
|
1485
|
+
* **huggingface_llm_reasoning**: Generates human-like text, reasons, and plans. Not for external actions.
|
|
1424
1486
|
* `prompt`: The prompt or question to send to the language model.
|
|
1425
|
-
* `model`: The Hugging Face model ID.
|
|
1487
|
+
* `model`: The Hugging Face model ID (e.g., 'HuggingFaceH4/zephyr-7b-beta', 'openai/gpt-oss-20b:novita').
|
|
1426
1488
|
* `hfToken`: Your Hugging Face API token.
|
|
1427
|
-
* `temperature`: Controls randomness.
|
|
1428
|
-
* `max_new_tokens`: Maximum number of tokens to generate.
|
|
1429
|
-
* `baseUrl`: The base URL of the Hugging Face router API.
|
|
1430
|
-
* **llm_reasoning**:
|
|
1489
|
+
* `temperature`: Optional. Controls randomness. Defaults to 0.7.
|
|
1490
|
+
* `max_new_tokens`: Optional. Maximum number of tokens to generate. Defaults to 500.
|
|
1491
|
+
* `baseUrl`: Optional. The base URL of the Hugging Face router API. Defaults to 'https://router.huggingface.co/v1'.
|
|
1492
|
+
* **llm_reasoning**: Generates human-like text, reasons, and plans. Not for external actions.
|
|
1493
|
+
* `prompt`: The prompt or question to send to the language model.
|
|
1494
|
+
* **openrouter_llm_reasoning**: Generates human-like text, reasons, and plans via OpenRouter. Not for external actions.
|
|
1431
1495
|
* `prompt`: The prompt or question to send to the language model.
|
|
1432
|
-
*
|
|
1496
|
+
* `model`: The OpenRouter model ID (e.g., 'openai/gpt-4o', 'mistralai/mistral-7b-instruct').
|
|
1497
|
+
* `apiKey`: Your OpenRouter API key.
|
|
1498
|
+
* `siteUrl`: Optional. Site URL for rankings on openrouter.ai.
|
|
1499
|
+
* `siteTitle`: Optional. Site title for rankings on openrouter.ai.
|
|
1500
|
+
* **ollama_llm_reasoning**: Generates human-like text, reasons, and plans locally via Ollama. Not for external actions.
|
|
1433
1501
|
* `prompt`: The prompt or question to send to the local Ollama language model.
|
|
1434
|
-
* `model`: The Ollama model name to use.
|
|
1435
|
-
* `baseUrl`: The base URL of the Ollama API.
|
|
1502
|
+
* `model`: The Ollama model name to use (e.g., 'llama2', 'gemma:2b'). Defaults to 'llama2'.
|
|
1503
|
+
* `baseUrl`: The base URL of the Ollama API (e.g., 'http://localhost:11434'). Defaults to 'http://localhost:11434'.
|
|
1504
|
+
|
|
1505
|
+
### System & Hardware
|
|
1506
|
+
|
|
1507
|
+
* **shell_command**: Executes shell commands.
|
|
1508
|
+
* `command`: The full shell command to execute (e.g., 'ls -l', 'npm install cheerio').
|
|
1509
|
+
* **system_notification**: Displays a system-level notification across OSs.
|
|
1510
|
+
* `message`: The main message content of the notification.
|
|
1511
|
+
* `title`: Optional. The title of the notification. Defaults to 'QFlow Notification'.
|
|
1512
|
+
* `icon`: Optional. Path to an icon file or a system icon name (Linux specific). Ignored on macOS/Windows.
|
|
1513
|
+
* **display_image**: Displays an image file using the system's default image viewer.
|
|
1514
|
+
* `imagePath`: The absolute path to the image file to display.
|
|
1515
|
+
* **hardware_interaction**: Communicates with local hardware via serial port (UART).
|
|
1516
|
+
* `action`: The action to perform: 'write', 'read_line', 'list_ports'.
|
|
1517
|
+
* `portPath`: Required for 'write'/'read_line'. The path to the serial port (e.g., '/dev/ttyUSB0', 'COM1').
|
|
1518
|
+
* `baudRate`: Optional. The baud rate for serial communication. Defaults to 9600.
|
|
1519
|
+
* `dataToWrite`: Required for 'write'. The data string to send to the serial port.
|
|
1520
|
+
* `timeout`: Optional. Timeout in milliseconds for 'read_line' action. Defaults to 5000.
|
|
1521
|
+
* **image_gallery**: Generates an HTML gallery from multiple image files and opens it in a web browser.
|
|
1522
|
+
* `imagePaths`: An array of absolute paths to the image files to display in the gallery.
|
|
1523
|
+
* `title`: Optional. The title of the HTML gallery page. Defaults to 'Image Gallery'.
|
|
1524
|
+
* `description`: Optional. A short description to display on the gallery page. Defaults to 'Generated by QFlow Agent'.
|
|
1525
|
+
* `outputDir`: Optional. Directory to save the generated HTML file and copied images. Defaults to a temporary directory.
|
|
1526
|
+
* **speech_synthesis**: Converts text to spoken audio using OS capabilities or cloud APIs.
|
|
1527
|
+
* `text`: The text to convert to speech.
|
|
1528
|
+
* `provider`: Optional. The speech synthesis provider to use. Defaults to OS-specific. 'google' requires GOOGLE_TTS_API_KEY.
|
|
1529
|
+
* `voice`: Optional. The specific voice to use (e.g., 'Alex' for macOS, 'en-us' for espeak, 'en-US-Wavenet-D' for Google).
|
|
1530
|
+
* `outputFilePath`: Optional. If provided, saves the audio to this file path instead of playing it directly.
|
|
1531
|
+
* **multimedia_processing**: Performs various multimedia operations on audio and video files using ffmpeg.
|
|
1532
|
+
* `action`: The multimedia operation to perform.
|
|
1533
|
+
* `inputPath`: Path to the input multimedia file.
|
|
1534
|
+
* `outputPath`: Path for the output file.
|
|
1535
|
+
* `format`: Required for 'convert' and 'extract_audio'. The output format (e.g., 'mp4', 'mp3', 'gif', 'wav').
|
|
1536
|
+
* `startTime`: Required for 'trim'. Start time in HH:MM:SS or seconds (e.g., '00:00:10', '10').
|
|
1537
|
+
* `duration`: Required for 'trim'. Duration in HH:MM:SS or seconds (e.g., '00:00:05', '5').
|
|
1538
|
+
* `resolution`: Optional for video 'convert'. Resolution (e.g., '1280x720').
|
|
1539
|
+
* `frameTime`: Required for 'extract_frame'. Time to extract frame from in HH:MM:SS or seconds (e.g., '00:00:05').
|
|
1540
|
+
* `ffmpegArgs`: Required for 'custom'. Raw ffmpeg arguments to execute directly.
|
|
1541
|
+
* **remote_execution**: Executes commands on remote machines via SSH.
|
|
1542
|
+
* `host`: The hostname or IP address of the remote machine.
|
|
1543
|
+
* `port`: Optional. The SSH port. Defaults to 22.
|
|
1544
|
+
* `username`: The username for SSH authentication.
|
|
1545
|
+
* `password`: Optional. The password for SSH authentication (use with caution, prefer privateKey).
|
|
1546
|
+
* `privateKey`: Optional. The content of the private SSH key or its absolute path.
|
|
1547
|
+
* `passphrase`: Optional. The passphrase for an encrypted private key.
|
|
1548
|
+
* `action`: The action to perform. Currently only 'execute_command' is supported.
|
|
1549
|
+
* `command`: The command string to execute on the remote machine.
|
|
1550
|
+
* `timeout`: Optional. Timeout in milliseconds for the command execution. Defaults to 30000 (30 seconds).
|
|
1551
|
+
* **webhook**: Exposes an HTTP endpoint to receive webhooks, triggering a specified qflow flow.
|
|
1552
|
+
* `port`: Optional. The port number to listen on. Defaults to 3000.
|
|
1553
|
+
* `path`: Optional. The URL path for the webhook endpoint. Defaults to '/webhook'.
|
|
1554
|
+
* `flow`: The name of the qflow AsyncFlow instance to trigger when a webhook is received.
|
|
1555
|
+
* `sharedSecret`: Optional. A shared secret for HMAC verification of incoming webhooks.
|
|
1556
|
+
* `responseStatus`: Optional. The HTTP status code to send back to the webhook sender. Defaults to 200.
|
|
1557
|
+
* `responseBody`: Optional. The JSON body to send back to the webhook sender. Defaults to { status: 'received' }.
|
|
1558
|
+
* **git**: Performs Git operations like clone, add, commit, and push.
|
|
1559
|
+
* `action`: The Git action to perform.
|
|
1560
|
+
* `repoPath`: The local path to the repository.
|
|
1561
|
+
* `remoteUrl`: The URL of the remote repository (for 'clone' action).
|
|
1562
|
+
* `files`: An array of file paths to add to the staging area (for 'add' action).
|
|
1563
|
+
* `message`: The commit message (for 'commit' action).
|
|
1564
|
+
* `branch`: The branch to push to or pull from.
|
|
1565
|
+
* `remote`: The name of the remote (e.g., 'origin').
|
|
1436
1566
|
|