fix: solves agents auto refresh models setting real_time_refresh False (#5810)

* Update model_input_constants.py

* Update anthropic.py

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Edwin Jose 2025-01-20 14:52:26 -05:00 committed by GitHub
commit 03c5b31b71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 46 additions and 24 deletions

View file

@ -30,6 +30,14 @@ def process_inputs(component_data):
component_data.load_from_db = False
elif component_data.name in {"temperature", "tool_model_enabled", "base_url"}:
component_data = set_advanced_true(component_data)
elif component_data.name == "model_name":
component_data = set_real_time_refresh_false(component_data)
component_data = add_combobox_true(component_data)
component_data = add_info(
component_data,
"To see the model names, first choose a provider. Then, enter your API key and click the refresh button "
"next to the model name.",
)
return component_data
@ -38,6 +46,21 @@ def set_advanced_true(component_input):
return component_input
def set_real_time_refresh_false(component_input):
component_input.real_time_refresh = False
return component_input
def add_info(component_input, info_str: str):
component_input.info = info_str
return component_input
def add_combobox_true(component_input):
component_input.combobox = True
return component_input
def create_input_fields_dict(inputs, prefix):
return {f"{prefix}{input_.name}": input_ for input_ in inputs}

View file

@ -31,7 +31,6 @@ class AnthropicModelComponent(LCModelComponent):
display_name="Model Name",
options=[],
refresh_button=True,
real_time_refresh=True,
),
SecretStrInput(
name="api_key",

File diff suppressed because one or more lines are too long

View file

@ -1888,10 +1888,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",

View file

@ -1906,10 +1906,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",

View file

@ -2358,10 +2358,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",

View file

@ -944,10 +944,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",

View file

@ -879,10 +879,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",
@ -1455,10 +1455,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",
@ -3344,10 +3344,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",

View file

@ -411,10 +411,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",

View file

@ -1506,10 +1506,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",
@ -2082,10 +2082,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",
@ -2658,10 +2658,10 @@
"model_name": {
"_input_type": "DropdownInput",
"advanced": false,
"combobox": false,
"combobox": true,
"display_name": "Model Name",
"dynamic": false,
"info": "",
"info": "To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name.",
"name": "model_name",
"options": [
"gpt-4o-mini",