-
Notifications
You must be signed in to change notification settings - Fork 8.2k
fix: changed embedding model to have api base and watsonx api endpoint #10524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2231903
40e9d75
32c8154
5f86e16
eb43a70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1921,7 +1921,7 @@ | |
| }, | ||
| { | ||
| "name": "google", | ||
| "version": "0.6.15" | ||
| "version": "0.8.5" | ||
| }, | ||
| { | ||
| "name": "googleapiclient", | ||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,3 +10,12 @@ | |||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| WATSONX_EMBEDDING_MODEL_NAMES = [metadata["name"] for metadata in WATSONX_EMBEDDING_MODELS_DETAILED] | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| IBM_WATSONX_URLS = [ | ||||||||||||||||||||||||||||||||||||
| "https://us-south.ml.cloud.ibm.com", | ||||||||||||||||||||||||||||||||||||
| "https://eu-de.ml.cloud.ibm.com", | ||||||||||||||||||||||||||||||||||||
| "https://eu-gb.ml.cloud.ibm.com", | ||||||||||||||||||||||||||||||||||||
| "https://au-syd.ml.cloud.ibm.com", | ||||||||||||||||||||||||||||||||||||
| "https://jp-tok.ml.cloud.ibm.com", | ||||||||||||||||||||||||||||||||||||
| "https://ca-tor.ml.cloud.ibm.com", | ||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add the Mumbai watsonx.ai endpoint IBM’s current watsonx.ai endpoint list includes the Mumbai (ap-south-1) region. Omitting it means users in that region can’t configure embeddings with this dropdown, even though the service is available there.(cloud.ibm.com) Apply this diff to include the missing endpoint: IBM_WATSONX_URLS = [
"https://us-south.ml.cloud.ibm.com",
"https://eu-de.ml.cloud.ibm.com",
"https://eu-gb.ml.cloud.ibm.com",
"https://au-syd.ml.cloud.ibm.com",
"https://jp-tok.ml.cloud.ibm.com",
"https://ca-tor.ml.cloud.ibm.com",
+ "https://ap-south-1.aws.wxai.ibm.com",
]📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Provider logic looks solid; make
project_idrequired for IBM to match runtime check.Build raises if
project_idis missing, but the UI doesn’t mark it required when IBM watsonx.ai is selected.Apply inside the Python code string’s
update_build_configIBM branch:elif field_value == "IBM watsonx.ai": build_config["model"]["options"] = WATSONX_EMBEDDING_MODEL_NAMES build_config["model"]["value"] = WATSONX_EMBEDDING_MODEL_NAMES[0] build_config["api_key"]["display_name"] = "IBM watsonx.ai API Key" build_config["api_key"]["required"] = True build_config["api_key"]["show"] = True build_config["api_base"]["show"] = False build_config["base_url_ibm_watsonx"]["show"] = True build_config["project_id"]["show"] = True + build_config["project_id"]["required"] = TrueAlso, consider passing
request_timeout/max_retriesto Ollama if supported by the version in use. Low priority.🌐 Web query:
💡 Result:
Yes.
langchain_ibm==0.3.19 — WatsonxEmbeddings constructor accepts model_id, url, apikey (and optional project_id/space_id). [1][2]
langchain_openai==0.3.23 — OpenAIEmbeddings accepts a request_timeout / timeout parameter and a show_progress_bar boolean. [3][4]
Sources:
Mark
project_idrequired in UI for IBM watsonx.ai to match runtime validation.The
build_embeddings()method raisesValueErrorifproject_idis missing for IBM watsonx.ai, butupdate_build_config()only setsshow=Truewithout marking itrequired=True.Apply inside the Python code string's
update_build_configIBM branch:elif field_value == "IBM watsonx.ai": build_config["model"]["options"] = WATSONX_EMBEDDING_MODEL_NAMES build_config["model"]["value"] = WATSONX_EMBEDDING_MODEL_NAMES[0] build_config["api_key"]["display_name"] = "IBM watsonx.ai API Key" build_config["api_key"]["required"] = True build_config["api_key"]["show"] = True build_config["api_base"]["show"] = False build_config["base_url_ibm_watsonx"]["show"] = True build_config["project_id"]["show"] = True + build_config["project_id"]["required"] = TrueWatsonxEmbeddings constructor accepts
model_id,url,apikey, and optionallyproject_id, and OpenAIEmbeddings accepts bothtimeoutandshow_progress_barparameters—the code passes these correctly.📝 Committable suggestion
🤖 Prompt for AI Agents