mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Update block docs for: iteration.md
This commit is contained in:
45
docs/content/platform/blocks/update/iteration.md
Normal file
45
docs/content/platform/blocks/update/iteration.md
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
|
||||
## Calculator Block
|
||||
|
||||
### What it is
|
||||
A mathematical calculation tool that performs basic arithmetic operations between two numbers.
|
||||
|
||||
### What it does
|
||||
Performs one of five mathematical operations (addition, subtraction, multiplication, division, or power) on two numbers and provides the result. It can also optionally round the result to the nearest whole number.
|
||||
|
||||
### How it works
|
||||
The block takes two numbers and a selected operation, processes them according to the chosen mathematical operation, and returns the result. It includes safety features to handle special cases like division by zero.
|
||||
|
||||
### Inputs
|
||||
- Operation: Choose from Add, Subtract, Multiply, Divide, or Power operations
|
||||
- First Number (A): The first number in the calculation
|
||||
- Second Number (B): The second number in the calculation
|
||||
- Round Result: Option to round the final answer to the nearest whole number
|
||||
|
||||
### Outputs
|
||||
- Result: The numerical outcome of the mathematical operation
|
||||
|
||||
### Possible use case
|
||||
A budgeting application where users need to perform various calculations, such as adding expenses, calculating percentage increases, or dividing costs among multiple people.
|
||||
|
||||
## Count Items Block
|
||||
|
||||
### What it is
|
||||
A counting tool that determines the number of items in various types of collections.
|
||||
|
||||
### What it does
|
||||
Counts the total number of elements in a given collection, whether it's a list of items, characters in a text, or key-value pairs in a dictionary.
|
||||
|
||||
### How it works
|
||||
The block analyzes the provided collection and counts its elements. It can handle various types of collections including lists, strings, dictionaries, and other iterable objects. If it encounters an invalid input, it returns -1 to indicate an error.
|
||||
|
||||
### Inputs
|
||||
- Collection: The group of items you want to count (can be a list, dictionary, string, or any other collection of items)
|
||||
|
||||
### Outputs
|
||||
- Count: The total number of items found in the collection
|
||||
|
||||
### Possible use case
|
||||
An inventory management system where users need to quickly count items in different categories, or a text analysis tool that needs to count elements like words in a sentence or items in a shopping cart.
|
||||
|
||||
Reference in New Issue
Block a user