@datatechsolutions/ui 2.7.112 → 2.7.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1308,13 +1308,13 @@ var FRAMEWORK_ALLOWED_PROVIDERS = {
1308
1308
  };
1309
1309
  function isModelCompatibleWithFramework(modelId, framework) {
1310
1310
  const allowed = FRAMEWORK_ALLOWED_PROVIDERS[framework];
1311
- if (allowed === "all") return true;
1311
+ if (!allowed || allowed === "all") return true;
1312
1312
  const provider = modelId.split(".")[0];
1313
1313
  return allowed.includes(provider);
1314
1314
  }
1315
1315
  function getCompatibleModels(models, framework) {
1316
1316
  const allowed = FRAMEWORK_ALLOWED_PROVIDERS[framework];
1317
- if (allowed === "all") return models;
1317
+ if (!allowed || allowed === "all") return models;
1318
1318
  return models.filter((model) => {
1319
1319
  const provider = model.id.split(".")[0];
1320
1320
  return allowed.includes(provider);
@@ -10966,6 +10966,16 @@ function AgentDrawer({ agent, models, open, isCreateMode = false, onClose, onSav
10966
10966
  const [temperature, setTemperature] = React8.useState(agent?.temperature ?? 0);
10967
10967
  const [elo, setElo] = React8.useState(Number(agent?.elo ?? 0));
10968
10968
  const [saved, setSaved] = React8.useState(!isCreateMode);
10969
+ const agentId = agent?.agentId ?? agent?.id ?? "";
10970
+ React8.useEffect(() => {
10971
+ if (!agent) return;
10972
+ setSelectedModelId(agent.modelId ?? "");
10973
+ setSelectedFramework(String(agent.framework ?? "custom"));
10974
+ setTemperature(agent.temperature ?? 0.7);
10975
+ setElo(Number(agent.elo ?? 1e3));
10976
+ setSaved(!isCreateMode);
10977
+ setActiveTab("config");
10978
+ }, [agentId]);
10969
10979
  const dirty = !saved;
10970
10980
  const markDirty = React8.useCallback(() => setSaved(false), []);
10971
10981
  const markSaved = React8.useCallback(() => setSaved(true), []);