Skip to content

fix: watsonx models in Agent Component#1151

Merged
lucaseduoli merged 2 commits into
mainfrom
fix_watsonx_agents
Mar 13, 2026
Merged

fix: watsonx models in Agent Component#1151
lucaseduoli merged 2 commits into
mainfrom
fix_watsonx_agents

Conversation

@edwinjosechittilappilly

Copy link
Copy Markdown
Collaborator

This pull request updates the way provider-specific fields are mapped to global variable names for various AI providers in the flows_service.py file. The main focus is on making the field mappings more explicit and consistent, especially for providers like Ollama, OpenAI, Anthropic, and WatsonX.

Provider-specific field mapping improvements:

  • Expanded the field_mappings dictionary to include explicit mappings for api_key fields for OpenAI, WatsonX, and Anthropic, ensuring consistent handling of API keys across providers.
  • Clarified and separated the mapping of Ollama and WatsonX URL fields by introducing api_base, ollama_base_url, and base_url_ibm_watsonx to better reflect their usage in different components.

Fixes:

Failed to initialize IBM WatsonX model: Attempt of authenticating connection to service failed, please validate your credentials. Error: {"errorCode":"BXNIM0415E","errorMessage":"Provided API key could not be found.","context":{"requestId":"Z210dHY-34ae0426ab1144539aa9710cabd4efa1","requestType":"incoming.Identity_Token","userAgent":"python-httpx/0.28.1","url":"https://iam.cloud.ibm.com","instanceId":"iamid-11-3-5336-ea99e4a-5b77d5c758-gmttv","threadId":"11b88","host":"iamid-11-3-5336-ea99e4a-5b77d5c758-gmttv","startTime":"13.03.2026 21:16:14:340 UTC","endTime":"13.03.2026 21:16:14:342 UTC","elapsedTime":"2","locale":"en_US","clusterName":"iam-id-prod-us-south-dal13"}}

Copilot AI review requested due to automatic review settings March 13, 2026 22:58
@github-actions github-actions Bot added backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. labels Mar 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates FlowsService._update_component_fields() to map provider-specific component inputs (API keys and base URLs) to the correct Langflow global variable names, with a focus on fixing IBM watsonx model initialization in Agent/LLM components.

Changes:

  • Adds explicit api_key mappings for OpenAI, Anthropic, and WatsonX to their Langflow global variable names.
  • Separates Ollama URL field handling between api_base (Embedding Model) and ollama_base_url (Language Model), and moves WatsonX URL mapping to base_url_ibm_watsonx.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

# Update provider-specific fields
# Update provider-specific fields using Langflow global variable names.
# "api_base" is the Ollama URL field on the Embedding Model component;
# "ollama_base_url" is the equivalent field on the Language Model / Agent component.

@lucaseduoli lucaseduoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions Bot added the lgtm label Mar 13, 2026
@lucaseduoli lucaseduoli merged commit 097c383 into main Mar 13, 2026
16 checks passed
@github-actions github-actions Bot deleted the fix_watsonx_agents branch March 13, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants