lfx-nightly 0.1.13.dev4__py3-none-any.whl → 0.1.13.dev6__py3-none-any.whl
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.
Potentially problematic release.
This version of lfx-nightly might be problematic. Click here for more details.
- lfx/_assets/component_index.json +1 -1
- lfx/base/models/watsonx_constants.py +12 -0
- lfx/components/models/embedding_model.py +85 -7
- lfx/io/schema.py +6 -0
- {lfx_nightly-0.1.13.dev4.dist-info → lfx_nightly-0.1.13.dev6.dist-info}/METADATA +1 -1
- {lfx_nightly-0.1.13.dev4.dist-info → lfx_nightly-0.1.13.dev6.dist-info}/RECORD +8 -7
- {lfx_nightly-0.1.13.dev4.dist-info → lfx_nightly-0.1.13.dev6.dist-info}/WHEEL +0 -0
- {lfx_nightly-0.1.13.dev4.dist-info → lfx_nightly-0.1.13.dev6.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from .model_metadata import create_model_metadata
|
|
2
|
+
|
|
3
|
+
# Granite Embedding models
|
|
4
|
+
WATSONX_EMBEDDING_MODELS_DETAILED = [
|
|
5
|
+
create_model_metadata(provider="IBM Watsonx", name="ibm/granite-embedding-125m-english", icon="IBMWatsonx"),
|
|
6
|
+
create_model_metadata(provider="IBM Watsonx", name="ibm/granite-embedding-278m-multilingual", icon="IBMWatsonx"),
|
|
7
|
+
create_model_metadata(provider="IBM Watsonx", name="ibm/granite-embedding-30m-english", icon="IBMWatsonx"),
|
|
8
|
+
create_model_metadata(provider="IBM Watsonx", name="ibm/granite-embedding-107m-multilingual", icon="IBMWatsonx"),
|
|
9
|
+
create_model_metadata(provider="IBM Watsonx", name="ibm/granite-embedding-30m-sparse", icon="IBMWatsonx"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
WATSONX_EMBEDDING_MODEL_NAMES = [metadata["name"] for metadata in WATSONX_EMBEDDING_MODELS_DETAILED]
|
|
@@ -3,7 +3,9 @@ from typing import Any
|
|
|
3
3
|
from langchain_openai import OpenAIEmbeddings
|
|
4
4
|
|
|
5
5
|
from lfx.base.embeddings.model import LCEmbeddingsModel
|
|
6
|
+
from lfx.base.models.ollama_constants import OLLAMA_EMBEDDING_MODELS
|
|
6
7
|
from lfx.base.models.openai_constants import OPENAI_EMBEDDING_MODEL_NAMES
|
|
8
|
+
from lfx.base.models.watsonx_constants import WATSONX_EMBEDDING_MODEL_NAMES
|
|
7
9
|
from lfx.field_typing import Embeddings
|
|
8
10
|
from lfx.io import (
|
|
9
11
|
BoolInput,
|
|
@@ -29,11 +31,11 @@ class EmbeddingModelComponent(LCEmbeddingsModel):
|
|
|
29
31
|
DropdownInput(
|
|
30
32
|
name="provider",
|
|
31
33
|
display_name="Model Provider",
|
|
32
|
-
options=["OpenAI"],
|
|
34
|
+
options=["OpenAI", "Ollama", "WatsonX"],
|
|
33
35
|
value="OpenAI",
|
|
34
36
|
info="Select the embedding model provider",
|
|
35
37
|
real_time_refresh=True,
|
|
36
|
-
options_metadata=[{"icon": "OpenAI"}],
|
|
38
|
+
options_metadata=[{"icon": "OpenAI"}, {"icon": "Ollama"}, {"icon": "WatsonxAI"}],
|
|
37
39
|
),
|
|
38
40
|
DropdownInput(
|
|
39
41
|
name="model",
|
|
@@ -56,6 +58,13 @@ class EmbeddingModelComponent(LCEmbeddingsModel):
|
|
|
56
58
|
info="Base URL for the API. Leave empty for default.",
|
|
57
59
|
advanced=True,
|
|
58
60
|
),
|
|
61
|
+
# Watson-specific inputs
|
|
62
|
+
MessageTextInput(
|
|
63
|
+
name="project_id",
|
|
64
|
+
display_name="Project ID",
|
|
65
|
+
info="Watson AI Project ID (required for WatsonX)",
|
|
66
|
+
show=False,
|
|
67
|
+
),
|
|
59
68
|
IntInput(
|
|
60
69
|
name="dimensions",
|
|
61
70
|
display_name="Dimensions",
|
|
@@ -102,13 +111,82 @@ class EmbeddingModelComponent(LCEmbeddingsModel):
|
|
|
102
111
|
show_progress_bar=show_progress_bar,
|
|
103
112
|
model_kwargs=model_kwargs,
|
|
104
113
|
)
|
|
114
|
+
|
|
115
|
+
if provider == "Ollama":
|
|
116
|
+
try:
|
|
117
|
+
from langchain_ollama import OllamaEmbeddings
|
|
118
|
+
except ImportError:
|
|
119
|
+
try:
|
|
120
|
+
from langchain_community.embeddings import OllamaEmbeddings
|
|
121
|
+
except ImportError:
|
|
122
|
+
msg = "Please install langchain-ollama: pip install langchain-ollama"
|
|
123
|
+
raise ImportError(msg) from None
|
|
124
|
+
|
|
125
|
+
return OllamaEmbeddings(
|
|
126
|
+
model=model,
|
|
127
|
+
base_url=api_base or "http://localhost:11434",
|
|
128
|
+
**model_kwargs,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
if provider == "WatsonX":
|
|
132
|
+
try:
|
|
133
|
+
from langchain_ibm import WatsonxEmbeddings
|
|
134
|
+
except ImportError:
|
|
135
|
+
msg = "Please install langchain-ibm: pip install langchain-ibm"
|
|
136
|
+
raise ImportError(msg) from None
|
|
137
|
+
|
|
138
|
+
if not api_key:
|
|
139
|
+
msg = "Watson AI API key is required when using WatsonX provider"
|
|
140
|
+
raise ValueError(msg)
|
|
141
|
+
|
|
142
|
+
project_id = self.project_id
|
|
143
|
+
|
|
144
|
+
if not project_id:
|
|
145
|
+
msg = "Project ID is required for WatsonX"
|
|
146
|
+
raise ValueError(msg)
|
|
147
|
+
|
|
148
|
+
params = {
|
|
149
|
+
"model_id": model,
|
|
150
|
+
"url": api_base or "https://us-south.ml.cloud.ibm.com",
|
|
151
|
+
"apikey": api_key,
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
params["project_id"] = project_id
|
|
155
|
+
|
|
156
|
+
return WatsonxEmbeddings(**params)
|
|
157
|
+
|
|
105
158
|
msg = f"Unknown provider: {provider}"
|
|
106
159
|
raise ValueError(msg)
|
|
107
160
|
|
|
108
161
|
def update_build_config(self, build_config: dotdict, field_value: Any, field_name: str | None = None) -> dotdict:
|
|
109
|
-
if field_name == "provider"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
162
|
+
if field_name == "provider":
|
|
163
|
+
if field_value == "OpenAI":
|
|
164
|
+
build_config["model"]["options"] = OPENAI_EMBEDDING_MODEL_NAMES
|
|
165
|
+
build_config["model"]["value"] = OPENAI_EMBEDDING_MODEL_NAMES[0]
|
|
166
|
+
build_config["api_key"]["display_name"] = "OpenAI API Key"
|
|
167
|
+
build_config["api_key"]["required"] = True
|
|
168
|
+
build_config["api_key"]["show"] = True
|
|
169
|
+
build_config["api_base"]["display_name"] = "OpenAI API Base URL"
|
|
170
|
+
build_config["project_id"]["show"] = False
|
|
171
|
+
|
|
172
|
+
elif field_value == "Ollama":
|
|
173
|
+
build_config["model"]["options"] = OLLAMA_EMBEDDING_MODELS
|
|
174
|
+
build_config["model"]["value"] = OLLAMA_EMBEDDING_MODELS[0]
|
|
175
|
+
build_config["api_key"]["display_name"] = "API Key (Optional)"
|
|
176
|
+
build_config["api_key"]["required"] = False
|
|
177
|
+
build_config["api_key"]["show"] = False
|
|
178
|
+
build_config["api_base"]["display_name"] = "Ollama Base URL"
|
|
179
|
+
build_config["api_base"]["value"] = "http://localhost:11434"
|
|
180
|
+
build_config["project_id"]["show"] = False
|
|
181
|
+
|
|
182
|
+
elif field_value == "WatsonX":
|
|
183
|
+
build_config["model"]["options"] = WATSONX_EMBEDDING_MODEL_NAMES
|
|
184
|
+
build_config["model"]["value"] = WATSONX_EMBEDDING_MODEL_NAMES[0]
|
|
185
|
+
build_config["api_key"]["display_name"] = "Watson AI API Key"
|
|
186
|
+
build_config["api_key"]["required"] = True
|
|
187
|
+
build_config["api_key"]["show"] = True
|
|
188
|
+
build_config["api_base"]["display_name"] = "Watson AI URL"
|
|
189
|
+
build_config["api_base"]["value"] = "https://us-south.ml.cloud.ibm.com"
|
|
190
|
+
build_config["project_id"]["show"] = True
|
|
191
|
+
|
|
114
192
|
return build_config
|
lfx/io/schema.py
CHANGED
|
@@ -137,6 +137,12 @@ def schema_to_langflow_inputs(schema: type[BaseModel]) -> list[InputTypes]:
|
|
|
137
137
|
|
|
138
138
|
is_list = False
|
|
139
139
|
|
|
140
|
+
# Handle unparameterized list (e.g., coming from nullable array schemas)
|
|
141
|
+
# Treat it as a list of strings for input purposes
|
|
142
|
+
if ann is list:
|
|
143
|
+
is_list = True
|
|
144
|
+
ann = str
|
|
145
|
+
|
|
140
146
|
if get_origin(ann) is list:
|
|
141
147
|
is_list = True
|
|
142
148
|
ann = get_args(ann)[0]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lfx-nightly
|
|
3
|
-
Version: 0.1.13.
|
|
3
|
+
Version: 0.1.13.dev6
|
|
4
4
|
Summary: Langflow Executor - A lightweight CLI tool for executing and serving Langflow AI flows
|
|
5
5
|
Author-email: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
|
|
6
6
|
Requires-Python: <3.14,>=3.10
|
|
@@ -4,7 +4,7 @@ lfx/constants.py,sha256=Ert_SpwXhutgcTKEvtDArtkONXgyE5x68opMoQfukMA,203
|
|
|
4
4
|
lfx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
lfx/settings.py,sha256=wnx4zkOLQ8mvampYsnnvVV9GvEnRUuWQpKFSbFTCIp4,181
|
|
6
6
|
lfx/type_extraction.py,sha256=eCZNl9nAQivKdaPv_9BK71N0JV9Rtr--veAht0dnQ4A,2921
|
|
7
|
-
lfx/_assets/component_index.json,sha256=
|
|
7
|
+
lfx/_assets/component_index.json,sha256=2hSLAb9KQz76HrOJ6qanuKq_sdO7QBEROA6qTcrhocg,3525354
|
|
8
8
|
lfx/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
lfx/base/constants.py,sha256=v9vo0Ifg8RxDu__XqgGzIXHlsnUFyWM-SSux0uHHoz8,1187
|
|
10
10
|
lfx/base/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -76,6 +76,7 @@ lfx/base/models/novita_constants.py,sha256=_mgBYGwpddUw4CLhLKJl-psOUzA_SQGHrfZJU
|
|
|
76
76
|
lfx/base/models/ollama_constants.py,sha256=FM0BPEtuEmIoH2K1t6tTh5h_H2bK7-YSXe0x4-F4Mik,973
|
|
77
77
|
lfx/base/models/openai_constants.py,sha256=DSlnUjmtb6KXQNDifxop4VVQPvB1Y9vftK6ZmFiudf4,4798
|
|
78
78
|
lfx/base/models/sambanova_constants.py,sha256=mYPF7vUbMow9l4jQ2OJrIkAJhGs3fGWTCVNfG3oQZTc,519
|
|
79
|
+
lfx/base/models/watsonx_constants.py,sha256=lR0hOxcrQwHSMTH_49fmYlGJJb6KEeeyoUeXK8PUBf4,792
|
|
79
80
|
lfx/base/processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
80
81
|
lfx/base/prompts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
82
|
lfx/base/prompts/api_utils.py,sha256=f1LHI6w4sVrSXxfi8zE9bfdre73sFrGtxr96VoLJByU,8032
|
|
@@ -414,7 +415,7 @@ lfx/components/mistral/__init__.py,sha256=EABXqA45Tz50vZRmhEisbIIPEcRCvV9j-Y9Hf2
|
|
|
414
415
|
lfx/components/mistral/mistral.py,sha256=4heAlIFEeq_ljUZDPpNGyK_VRkWjwCfPbBaQK1mV4NY,3718
|
|
415
416
|
lfx/components/mistral/mistral_embeddings.py,sha256=QuqS_S3yHWCacs-Nc3qalpUsb-OACRWFZenUtCD_rLQ,1963
|
|
416
417
|
lfx/components/models/__init__.py,sha256=hhfj70MkcRATzAjJnntAg1A4E7kHlQn8GT0bizkB7L4,1113
|
|
417
|
-
lfx/components/models/embedding_model.py,sha256=
|
|
418
|
+
lfx/components/models/embedding_model.py,sha256=Tk-P9K5DanE0YuXauWMW_nOi08rnAaspiqJHbNYjoeA,7543
|
|
418
419
|
lfx/components/models/language_model.py,sha256=TA24DMAXrlruY3mNsfI9qGltfQ2h9cQpxe8DW8HLdeE,5992
|
|
419
420
|
lfx/components/mongodb/__init__.py,sha256=nFOQgiIvDnWGiWDSqZ0ERQme5DpA-cQgzybUiqXQtGw,953
|
|
420
421
|
lfx/components/mongodb/mongodb_atlas.py,sha256=OlAstNMToHuvGI-8djkiGr7kdGBr927O0SE5cnVd0O0,8594
|
|
@@ -627,7 +628,7 @@ lfx/interface/importing/utils.py,sha256=-3-M4MSzA_2zlwRWy1SdJHDsjeRkFvWZaTynITRj
|
|
|
627
628
|
lfx/interface/initialize/__init__.py,sha256=wxisnaYxjaqrjA_-By2oHmd4Fht5lAAJFYrotkPm7HA,45
|
|
628
629
|
lfx/interface/initialize/loading.py,sha256=WF6sp20wYvY52nKbAQpPDrzGKBHwW5xEz45qnGZBc_o,12229
|
|
629
630
|
lfx/io/__init__.py,sha256=hIH6GC2gKdupGZVyRqrbOIm9UyUhNqIga8z1jd4ri2w,1131
|
|
630
|
-
lfx/io/schema.py,sha256=
|
|
631
|
+
lfx/io/schema.py,sha256=aYkidiHBkD1AHUelj2UQpzIHLdIBEi0-NnzLucniufU,10618
|
|
631
632
|
lfx/load/__init__.py,sha256=y35GBUhVTOsG3GzL5UVL-RNAsu0D7T8MVPrNXoDMx7U,224
|
|
632
633
|
lfx/load/load.py,sha256=mpQG2RV2ZOysShEOguWKdnQI9TUub1Ds5j89ZbwiQhA,10451
|
|
633
634
|
lfx/load/utils.py,sha256=qa8aoMLW-X8FO8xVz3YVHQwjTSJYbYr_AOQAAp3smlc,3705
|
|
@@ -728,7 +729,7 @@ lfx/utils/schemas.py,sha256=NbOtVQBrn4d0BAu-0H_eCTZI2CXkKZlRY37XCSmuJwc,3865
|
|
|
728
729
|
lfx/utils/util.py,sha256=Ww85wbr1-vjh2pXVtmTqoUVr6MXAW8S7eDx_Ys6HpE8,20696
|
|
729
730
|
lfx/utils/util_strings.py,sha256=nU_IcdphNaj6bAPbjeL-c1cInQPfTBit8mp5Y57lwQk,1686
|
|
730
731
|
lfx/utils/version.py,sha256=cHpbO0OJD2JQAvVaTH_6ibYeFbHJV0QDHs_YXXZ-bT8,671
|
|
731
|
-
lfx_nightly-0.1.13.
|
|
732
|
-
lfx_nightly-0.1.13.
|
|
733
|
-
lfx_nightly-0.1.13.
|
|
734
|
-
lfx_nightly-0.1.13.
|
|
732
|
+
lfx_nightly-0.1.13.dev6.dist-info/METADATA,sha256=G8E7qLd-Yt5CTSxEj4UZfnKxu-68wkV1Xi2X5cdbCdM,8289
|
|
733
|
+
lfx_nightly-0.1.13.dev6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
734
|
+
lfx_nightly-0.1.13.dev6.dist-info/entry_points.txt,sha256=1724p3RHDQRT2CKx_QRzEIa7sFuSVO0Ux70YfXfoMT4,42
|
|
735
|
+
lfx_nightly-0.1.13.dev6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|