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:
parent
5266f23ad3
commit
423caf91f1
2 changed files with 59 additions and 5 deletions
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue