Skip to content

Commit 5769953

Browse files
committed
chore: refresh BurnCloud models and fix lint
1 parent 62d3bbc commit 5769953

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/lfx/src/lfx/components/BurnCloud/burncloud.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
from __future__ import annotations
22

3+
from typing import TYPE_CHECKING
4+
35
import httpx
46
from langchain_openai import ChatOpenAI
57
from pydantic.v1 import SecretStr
68

79
from lfx.base.models.model import LCModelComponent
8-
from lfx.field_typing import LanguageModel
910
from lfx.field_typing.range_spec import RangeSpec
11+
12+
if TYPE_CHECKING:
13+
from lfx.field_typing import LanguageModel
1014
from lfx.inputs.inputs import DropdownInput, IntInput, MessageTextInput, SecretStrInput, SliderInput
1115

1216
DEFAULT_BURNCLOUD_BASE_URL = "https://ai.burncloud.com"
@@ -120,11 +124,7 @@ def get_models(self) -> list[str]:
120124

121125
def update_build_config(self, build_config: dict, field_value: str, field_name: str | None = None):
122126
if field_name in {"api_key", "base_url", "model_name"} and field_value:
123-
try:
124-
model_options = self.get_models()
125-
except Exception as exc: # pragma: no cover - defensive
126-
self.log(f"Error while updating BurnCloud models: {exc}", "warning")
127-
model_options = DEFAULT_BURNCLOUD_MODELS.copy()
127+
model_options = self.get_models()
128128
build_config.setdefault("model_name", {})
129129
build_config["model_name"]["options"] = model_options
130130
if model_options:

src/lfx/src/lfx/components/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# These imports are only for type checking and match _dynamic_imports
99
from lfx.components import (
1010
FAISS,
11+
BurnCloud,
1112
Notion,
1213
agentql,
1314
agents,
@@ -20,7 +21,6 @@
2021
azure,
2122
baidu,
2223
bing,
23-
BurnCloud,
2424
cassandra,
2525
chains,
2626
chroma,
@@ -242,6 +242,7 @@ def _discover_components_from_module(module_name):
242242
# Static base __all__ with module names
243243
__all__ = [
244244
"FAISS",
245+
"BurnCloud",
245246
"Notion",
246247
"agentql",
247248
"agents",
@@ -254,7 +255,6 @@ def _discover_components_from_module(module_name):
254255
"azure",
255256
"baidu",
256257
"bing",
257-
"BurnCloud",
258258
"cassandra",
259259
"chains",
260260
"chroma",

0 commit comments

Comments
 (0)