refactor(model_input_constants): update process_inputs logic and docstring (#8470)

* Update model_input_constants.py

* 📝 Add docstrings to `lfoss-676` (#8471)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* Update model_input_constants.py

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Edwin Jose 2025-06-12 10:49:38 -05:00 • committed by GitHub
commit 423caf91f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 59 additions and 5 deletions

View file

@ -29,10 +29,25 @@ def get_filtered_inputs(component_class):
def process_inputs(component_data: Input):
"""Processes and modifies an input configuration based on its type or name.
Adjusts properties such as value, advanced status, real-time refresh, and additional information for specific
input types or names to ensure correct behavior in the UI and provider integration.
Args:
component_data: The input configuration to process.
Returns:
The modified input configuration.
"""
if isinstance(component_data, SecretStrInput):
component_data.value = ""
component_data.load_from_db = False
elif component_data.name in {"temperature", "tool_model_enabled", "base_url"}:
component_data.real_time_refresh = True
elif component_data.name == "tool_model_enabled":
component_data.advanced = True
component_data.value = True
elif component_data.name in {"temperature", "base_url"}:
component_data = set_advanced_true(component_data)
elif component_data.name == "model_name":
component_data = set_real_time_refresh_false(component_data)

File diff suppressed because one or more lines are too long