A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://ibm.github.io/watsonx-ai-python-sdk/setup_cpd.html below:

IBM watsonx.ai software - IBM watsonx.ai

Toggle table of contents sidebar

IBM watsonx.ai software Requirements

For information on how to start working with IBM watsonx.ai software, refer to Getting started with IBM Cloud Pak® for Data 5.2.

Supported machine learning frameworks
For a list of supported machine learning frameworks (models) of IBM watsonx.ai software, refer to watsonx.ai documentation:
Authentication

Starting with IBM Cloud Pak® for Data version 4.8, users of IBM watsonx.ai software can initialize an IBM watsonx.ai Python client either by providing their credentials or by utilizing a token:

Note

To determine your <APIKEY>, refer to Generating API keys.

The base URL for ibm_watsonx_ai comes from the cluster and add-on service instance. The URL follows this pattern:

https://{cpd_cluster}

{cpd_cluster} represents the name or IP address of your deployed cluster. For the Cloud Pak for Data system, use a hostname that resolves to an IP address in the cluster.

To find the base URL, view the details for the service instance from the Cloud Pak for Data web client. Use that URL in your requests to watsonx.ai software.

Note

from ibm_watsonx_ai import APIClient, Credentials

credentials = Credentials(
                   url = "<URL>",
                   token = access_token,
                   instance_id = "openshift"
                  )
client = APIClient(credentials)

Example of creating the client using username and password credentials:

from ibm_watsonx_ai import APIClient
from ibm_watsonx_ai import Credentials

credentials = Credentials(
                   url = "<URL>",
                   username = "<USERNAME>",
                   password = "<PASSWORD>",
                   instance_id = "openshift",
                   version = "5.2"
                  )

client = APIClient(credentials)

Example of creating the client using username and apikey credentials:

from ibm_watsonx_ai import APIClient
from ibm_watsonx_ai import Credentials

credentials = Credentials(
                   url = "<URL>",
                   username = "<USERNAME>",
                   api_key = IAM_API_KEY,
                   instance_id = "openshift",
                   version = "5.2"
                  )

client = APIClient(credentials)

Example of creating the client using a token:

Note

Beginning with IBM Cloud Pak® for Data version 4.8, IBM watsonx.ai software enables authentication using a token set directly within the notebook environment.

access_token = os.environ['USER_ACCESS_TOKEN']
from ibm_watsonx_ai import APIClient
from ibm_watsonx_ai import Credentials

credentials = Credentials(
                   url = "<URL>",
                   token = access_token,
                   instance_id = "openshift"
                   version = "5.2"
                  )
client = APIClient(credentials)
Note for IBM watsonx.ai software with IBM Cloud Pak® for Data 4.8 and later:

If the following error appears during authentication:

Attempt of generating `bedrock_url` automatically failed.
If iamintegration=True, please provide `bedrock_url` in wml_credentials.
If iamintegration=False, please validate your credentials.

There are two possible causes:

  1. If you chose iamintegration=False (default configuration) during installation, the credentials might be invalid or the service is temporary unavailable.

  2. If you chose iamintegration=True during installation, the autogeneration of bedrock_url wasn’t successful. Provide the IBM Cloud Pak foundational services URL as the bedrock_url param in the wml_credentials.

    To get the IBM Cloud Pak foundational services URL, refer to Authenticating for programmatic access.

watsonx.ai lightweight engines

For a watsonx.ai lightweight engine, you do not need to authenticate with a WML service and do not need to provide a project_id or space_id.

Example of creating the client with only lightweight engine support:

from ibm_watsonx_ai import APIClient
from ibm_watsonx_ai import Credentials


credentials = Credentials(
                   username="username",
                   password="***********",
                   url="<URL>",
                   instance_id="openshift",
                   version="5.2"
                  )

client = APIClient(credentials=credentials)

Note: Do not use methods such as client.set.default_space() and client.set.default_project() when you are using a watsonx.ai lightweight engine.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4