Skip to content

Commit

Permalink
docs(free-apis): update watsonx-ai instructions and reference (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElioDiNino authored Feb 29, 2024
1 parent f3a91f2 commit f57f4ef
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions docs/labs/free-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Learners will have access to these APIs within their:

Learners will _not_ have free access to these APIs within their:
- Code Engine projects
- JupyterLite
- Kubernetes cluster namespaces
- OpenShift cluster namespaces

Expand All @@ -34,28 +35,30 @@ Learners will _not_ have free access to these APIs within their:

#### Versioning

It is recommended that authors follow the instructions below using the default `ibm-watson-machine-learning` version installed with pip. However, after doing so, please pin the version you used for your learners. If you encounter an error with the latest package version and the following instructions, please let us know!
It is recommended that authors follow the instructions below using the default `ibm-watsonx-ai` version installed with pip. However, after doing so, please pin the version you used for your learners. If you encounter an error with the latest package version and the following instructions, please let us know!

For example:
```shell
$ pip install ibm-watson-machine-learning
Collecting ibm-watson-machine-learning
Downloading ibm_watson_machine_learning-1.0.344-py3-none-any.whl.metadata (8.6 kB)
pip install ibm-watsonx-ai
```
```
Collecting ibm-watsonx-ai
Downloading ibm_watsonx_ai-0.2.0-py3-none-any.whl.metadata (8.1 kB)
...
```

Your lab instructions would state:
```shell
pip install ibm-watson-machine-learning==1.0.344
pip install ibm-watsonx-ai==0.2.0
```

#### Usage

To use the free Skills Network-provided watsonx.ai project, specify the `"url"` and `project_id = "skills-network"` (make sure to **leave out** `"token"` and `"apikey"`). For example, you can modify [the example from the official documentation for the ibm_watson_machine_learning library](https://www.ibm.com/docs/en/watsonx-as-a-service?topic=models-python-library#example-prompt-a-foundation-model-with-default-parameters) as follows:
To use the free Skills Network-provided watsonx.ai project, specify the `"url"` and `project_id = "skills-network"` (make sure to **leave out** `"token"` and `"apikey"`). For example, you can modify [the example from the official documentation for the ibm_watson_machine_learning library](https://www.ibm.com/docs/en/watsonx-as-a-service?topic=library-inferencing-foundation-model-notebook#example-prompt-a-foundation-model-with-default-parameters) as follows:

```python
from ibm_watson_machine_learning.foundation_models.utils.enums import ModelTypes
from ibm_watson_machine_learning.foundation_models import Model
from ibm_watsonx_ai.foundation_models.utils.enums import ModelTypes
from ibm_watsonx_ai.foundation_models import Model
import json

my_credentials = {
Expand Down

0 comments on commit f57f4ef

Please sign in to comment.