Skip to content

Commit f5ae540

Browse files
committed
add description to groq
1 parent ccc150a commit f5ae540

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

  • src/lfx/src/lfx/components/groq

src/lfx/src/lfx/components/groq/groq.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class GroqModel(LCModelComponent):
5252
DropdownInput(
5353
name="model_name",
5454
display_name="Model",
55-
info="The name of the model to use.",
55+
info="The name of the model to use. Add your Groq API key to access additional available models.",
5656
options=GROQ_MODELS,
5757
value=GROQ_MODELS[0],
5858
refresh_button=True,
@@ -101,27 +101,26 @@ def get_models(self, *, tool_model_enabled: bool | None = None) -> list[str]:
101101
logger.info(f"Loaded {len(model_ids)} Groq models with tool calling support")
102102
else:
103103
logger.info(f"Loaded {len(model_ids)} Groq models")
104-
105-
return model_ids
106-
107-
except Exception as e:
104+
except (ValueError, KeyError, TypeError, ImportError) as e:
108105
logger.exception(f"Error getting model names: {e}")
109106
# Fallback to hardcoded list from groq_constants.py
110107
return GROQ_MODELS
108+
else:
109+
return model_ids
111110

112111
def update_build_config(self, build_config: dict, field_value: str, field_name: str | None = None):
113112
if field_name in {"base_url", "model_name", "tool_model_enabled", "api_key"} and field_value:
114113
try:
115114
if len(self.api_key) != 0:
116115
try:
117116
ids = self.get_models(tool_model_enabled=self.tool_model_enabled)
118-
except Exception as e:
117+
except (ValueError, KeyError, TypeError, ImportError) as e:
119118
logger.exception(f"Error getting model names: {e}")
120119
ids = GROQ_MODELS
121120
build_config.setdefault("model_name", {})
122121
build_config["model_name"]["options"] = ids
123122
build_config["model_name"].setdefault("value", ids[0])
124-
except Exception as e:
123+
except (ValueError, KeyError, TypeError, AttributeError) as e:
125124
msg = f"Error getting model names: {e}"
126125
raise ValueError(msg) from e
127126
return build_config

0 commit comments

Comments
 (0)