fix: templated did not auto update the model and api key fields (#8697)

* update model

* update financial template

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
This commit is contained in:
Yuqi Tang 2025-06-24 00:44:37 -07:00 committed by GitHub
commit a1188e039b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 27 deletions

View file

@ -43,4 +43,4 @@ FIELD_FORMAT_ATTRIBUTES = [
]
SKIPPED_FIELD_ATTRIBUTES = ["advanced"]
ORJSON_OPTIONS = orjson.OPT_INDENT_2 | orjson.OPT_SORT_KEYS | orjson.OPT_OMIT_MICROSECONDS
SKIPPED_COMPONENTS = {"LanguageModelComponent"}
SKIPPED_COMPONENTS = {"LanguageModelComponent", "Agent"}

View file

@ -67,7 +67,7 @@ def update_projects_components_with_latest_component_versions(project_data, all_
node_data["template"]["code"] = latest_template["code"]
# skip components that are having dynamic values that need to be persisted for templates
if node_data.get("key") in SKIPPED_COMPONENTS:
if node_type in SKIPPED_COMPONENTS:
continue
is_tool_or_agent = node_data.get("tool_mode", False) or node_data.get("key") in {

View file

@ -2483,9 +2483,9 @@
"api_key": {
"_input_type": "SecretStrInput",
"advanced": false,
"display_name": "OpenAI API Key",
"display_name": "SambaNova API Key",
"dynamic": false,
"info": "The OpenAI API Key to use for the OpenAI model.",
"info": "The SambaNova API Key to use for the SambaNova model.",
"input_types": [],
"load_from_db": true,
"name": "api_key",
@ -2726,17 +2726,20 @@
"input_types": [],
"name": "model_name",
"options": [
"gpt-4o-mini",
"gpt-4o",
"gpt-4.1",
"gpt-4.1-mini",
"gpt-4.1-nano",
"gpt-4.5-preview",
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-4",
"gpt-3.5-turbo",
"o1"
"Meta-Llama-3.3-70B-Instruct",
"Meta-Llama-3.1-8B-Instruct",
"Meta-Llama-3.1-70B-Instruct",
"Meta-Llama-3.1-405B-Instruct",
"DeepSeek-R1-Distill-Llama-70B",
"DeepSeek-R1",
"Meta-Llama-3.2-1B-Instruct",
"Meta-Llama-3.2-3B-Instruct",
"Llama-3.2-11B-Vision-Instruct",
"Llama-3.2-90B-Vision-Instruct",
"Qwen2.5-Coder-32B-Instruct",
"Qwen2.5-72B-Instruct",
"QwQ-32B-Preview",
"Qwen2-Audio-7B-Instruct"
],
"options_metadata": [],
"placeholder": "",
@ -3261,9 +3264,9 @@
"api_key": {
"_input_type": "SecretStrInput",
"advanced": false,
"display_name": "OpenAI API Key",
"display_name": "Sambanova API Key",
"dynamic": false,
"info": "The OpenAI API Key to use for the OpenAI model.",
"info": "The SambaNova API Key to use for the SambaNova model.",
"input_types": [],
"load_from_db": true,
"name": "api_key",

View file

@ -1587,16 +1587,13 @@
"info": "Select the model to use",
"name": "model_name",
"options": [
"gpt-4o-mini",
"gpt-4o",
"gpt-4.1",
"gpt-4.1-mini",
"gpt-4.1-nano",
"gpt-4.5-preview",
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-4",
"gpt-3.5-turbo"
"claude-opus-4-20250514",
"claude-sonnet-4-20250514",
"claude-3-7-sonnet-latest",
"claude-3-5-sonnet-latest",
"claude-3-5-haiku-latest",
"claude-3-opus-latest",
"claude-3-sonnet-20240229"
],
"options_metadata": [],
"placeholder": "",