garak.generators.watsonx

class garak.generators.watsonx.WatsonXGenerator(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

Bases: Generator

This is a generator for watsonx.ai.

Make sure that you initialize the environment variables:

‘WATSONX_TOKEN’, ‘WATSONX_URL’, ‘WATSONX_PROJECTID’ OR ‘WATSONX_DEPLOYID’.

To use a model that is in the “project” stage initialize the WATSONX_PROJECTID variable with the Project ID of the model. To use a tuned model that is deployed, simply initialize the WATSONX_DEPLOYID variable with the Deployment ID of the model.

DEFAULT_PARAMS = {'bearer_token': '', 'context_len': None, 'deployment_id': '', 'max_tokens': 900, 'project_id': '', 'prompt_variable': 'input', 'skip_seq_end': None, 'skip_seq_start': None, 'temperature': None, 'top_k': None, 'uri': None, 'version': '2023-05-29'}
DID_ENV_VAR = 'WATSONX_DEPLOYID'
ENV_VAR = 'WATSONX_TOKEN'
PID_ENV_VAR = 'WATSONX_PROJECTID'
URI_ENV_VAR = 'WATSONX_URL'
generator_family_name = 'watsonx'