VLM Result Collector:
The VLMResultCollector is a specialized node designed to efficiently gather and manage results from various processes without duplicating data. Its primary purpose is to streamline the collection of results by using weak references, which helps in minimizing memory usage and avoiding unnecessary data retention. This node is particularly beneficial in scenarios where you need to handle multiple result sets simultaneously, as it allows for the dynamic creation and management of collectors. By providing mechanisms to reset, clear, and limit the number of collectors, it ensures that only the most relevant data is retained, thus optimizing performance and resource utilization.
VLM Result Collector Input Parameters:
results
This parameter represents the data to be collected, typically in the form of VLM results. It is essential for the node's operation as it provides the actual content that will be stored and managed by the collectors.
collector_id
The collector_id is a string identifier used to specify which collector should be used or created for storing the results. By default, it is set to "default". This parameter allows you to manage multiple collectors by assigning unique identifiers to each, facilitating organized data handling.
reset
The reset parameter is a boolean that determines whether the specified collector should be reset before adding new results. When set to True, it clears the existing data in the collector, ensuring that only the new results are stored. The default value is False.
clear_all
This boolean parameter, when set to True, clears all existing collectors, effectively resetting the node's state. It is useful for starting fresh without any residual data from previous operations. The default value is False.
max_collectors
The max_collectors parameter is an integer that limits the number of collectors that can be maintained simultaneously. It helps in managing memory usage by ensuring that only a specified number of the most recent collectors are kept. The default value is 2, with a minimum of 1 and a maximum of 10.
VLM Result Collector Output Parameters:
collection
This output represents the collected data in the form of a VLM collection. It includes the responses and metadata gathered by the specified collector, providing a comprehensive view of the collected results.
count
The count output is an integer indicating the total number of responses stored in the collector. It provides a quick reference to the volume of data collected, which can be useful for assessing the completeness of the collection process.
text_list
The text_list is a list of responses that have been collected. It serves as a direct reference to the actual content stored in the collector, allowing for easy access and manipulation of the collected data.
VLM Result Collector Usage Tips:
- Use the
collector_idto manage multiple collections simultaneously, allowing for organized and efficient data handling across different processes. - Regularly utilize the
clear_allparameter to reset the node's state and prevent memory bloat from unused collectors, especially in long-running applications. - Adjust the
max_collectorsparameter based on your application's memory constraints and data retention needs to optimize performance.
VLM Result Collector Common Errors and Solutions:
Collector limit exceeded
- Explanation: This error occurs when the number of collectors exceeds the specified
max_collectorslimit. - Solution: Increase the
max_collectorslimit if more collectors are needed, or ensure that unused collectors are cleared to stay within the limit.
Collector not found
- Explanation: This error happens when a specified
collector_iddoes not exist, possibly due to a typo or because it was cleared. - Solution: Verify the
collector_idfor accuracy and ensure that it has not been cleared or reset before attempting to access it.
