Compute Node
Functionality
The compute node is a very flexible and practical node. You can use the compute node to accomplish many tasks that cannot be handled solely by large language models, such as:
- Logical Calculations: As we know, large language models are not good at mathematical operations and logical reasoning. For example, they might often get wrong answers to simple questions like "which is bigger, 9.11 or 9.9?" The compute node can fill this gap.
- Implementing Strict Business Logic: When the required process is already clearly and rigorously defined, it can be implemented using a compute node to avoid the errors and instability caused by the hallucinations of large models.
- Processing Large Amounts of Structured Data: When there is a need to process a large amount of structured data, the compute node is often the better choice.
- Integration with Existing Systems: The compute node can flexibly integrate with various existing business systems, whether it’s unified identity authentication, complex authorization, or API call logic.
Even better, the compute node supports large language models to automatically write and execute code. Therefore, you can simply write a few lines of prompts and let the large language model generate hundreds of lines of code to implement a complex function. While large language models are not good at directly performing logical calculations, they are very skilled at writing code (thanks to the vast amount of open-source community code they were trained on). Of course, after validating the accuracy and usability of the code generated by the large language model, you can copy the code into the compute node as “manual coding,” which will save time on generating code every time and avoid the instability of large language models.
Here are the properties of the compute node:
Programming Language
You can choose from two programming languages:
- python
- javascript
Coding Method
You can choose from two coding methods:
- Manual Coding: The user writes the code for execution.
- AI Generation: The user writes prompts, and the large language model generates the AI code based on those prompts and executes it.
Retry on Error
When the coding method is "AI Generation," you can enable the retry option. If the code generated by the large language model fails, it can modify the code based on the error message and try again.
Retry Count
The number of retry attempts for the large language model to regenerate the code, with a maximum of 3 attempts.
Need AI to process the result
Set whether the large language model needs to process the results of the code execution. This is useful when you need to return the results in natural language to the user or extract specific fields from the results to save in output variables.
Result Processing Prompt
The prompt used when processing the results.
Send the result directly to the user
Set whether the result of code execution needs to be sent to the user.
Show code
You can choose to display the code generated by the large language model for debugging purposes or to copy the code and solidify it as "manual coding."
Code Execution Security
The platform has fully considered the security of code execution, ensuring that all code runs in a controlled sandbox environment to prevent errors or malicious code from causing harm. Here are the security controls for running the code:
- Cannot read or write to the file system
- Resource usage is limited (e.g., CPU and memory)
- The maximum execution time for a single code node is 10 minutes, and it will be forcibly terminated if it exceeds this time.