deargui-vpl/docs/llm/blocks.md
2026-02-03 18:25:25 +01:00

94 lines
3.2 KiB
Markdown

# Block Reference
This document provides a brief overview of the available blocks, their purpose, and their parameters. For a guide on how to create and connect these blocks programmatically, see [Creating Blocks Programmatically](./create-blocks.md).
## Logic Blocks
### [`Logic.Test`](./applications/nodehub/blocks/logic_blocks.cpp)
Compares two input values (`A` and `B`) based on a configurable operator and triggers a `True` or `False` flow output.
- **Flow Inputs**:
- `Execute`
- **Parameter Inputs**:
- `A` (Bool, Int, Float, or String): The first value for comparison.
- `B` (Bool, Int, Float, or String): The second value for comparison.
- **Flow Outputs**:
- `True`: Executed if the comparison is true.
- `False`: Executed if the comparison is false.
- **Configurable**:
- **Parameter Type**: Can be set to Bool, Int, Float, or String.
- **Operator**: Can be set to Equal, Not Equal, Less, Less or Equal, Greater, or Greater or Equal.
## Math Blocks
### [`Math.Add`](./applications/nodehub/blocks/math_blocks.cpp)
Adds two integer values (`A` and `B`) and outputs the sum.
- **Flow Inputs**:
- `Execute`
- **Parameter Inputs**:
- `A` (Int): The first integer.
- `B` (Int): The second integer.
- **Flow Outputs**:
- `Done`
- **Parameter Outputs**:
- `Result` (Int): The sum of `A` and `B`.
### [`Math.Multiply`](./applications/nodehub/blocks/math_blocks.cpp)
Multiplies two integer values (`A` and `B`) and outputs the product.
- **Flow Inputs**:
- `Execute`
- **Parameter Inputs**:
- `A` (Int): The first integer.
- `B` (Int): The second integer.
- **Flow Outputs**:
- `Done`
- **Parameter Outputs**:
- `Result` (Int): The product of `A` and `B`.
### [`Math.Compare`](./applications/nodehub/blocks/math_blocks.cpp)
Compares two integer values (`A` and `B`) and provides boolean outputs for equality, less than, and greater than.
- **Flow Inputs**:
- `Execute`
- **Parameter Inputs**:
- `A` (Int): The first integer.
- `B` (Int): The second integer.
- **Flow Outputs**:
- `Done`
- **Parameter Outputs**:
- `==` (Bool): True if `A` is equal to `B`.
- `<` (Bool): True if `A` is less than `B`.
- `>` (Bool): True if `A` is greater than `B`.
## Utility Blocks
### [`Log`](./applications/nodehub/blocks/log_block.cpp)
Writes a timestamped log entry to a JSON file. It has one fixed input for the file path and can be configured with additional variable parameters to be included in the log.
- **Flow Inputs**:
- `Execute`
- **Parameter Inputs**:
- `FilePath` (String): The path to the output JSON file.
- *(Variable Parameters)*: Additional parameters of type Bool, Int, Float, or String can be added via the context menu.
- **Flow Outputs**:
- `Done`
- **Configurable**:
- Can add/remove variable input parameters.
- Settings for appending to the file vs. overwriting, and for logging to the console.
### [`Start`](./applications/nodehub/blocks/start_block.cpp)
Acts as an entry point for the graph execution. It has no inputs and a single flow output.
- **Flow Inputs**:
- *(None)*
- **Flow Outputs**:
- `Start`