AI
watsonx.ai
8min
with the watsonx ai app in {{product name}} , you can infer the next tokens using a selected model and set of parameters in your watsonx ai account requirements to use the watsonx ai app in {{product name}} , you must have an ibm watsonx ai account connect watsonx ai and {{product name}} to get started, you must first create a connection between watsonx ai and {{product name}} , allowing the two services to communicate to create the connection, you need to watsonx ai docid\ jdkzjwwosupf4myysjefj watsonx ai docid\ jdkzjwwosupf4myysjefj obtain your api key in watsonx ai before you create the connection in {{product name}} , you should first obtain an api key in your watsonx ai account to obtain the api key log in to your watsonx ai account using cloud ibm com http //cloud ibm com click manage > access (iam) > api keys enter a name and description for your api key and click create copy the api key value shown and store it in a safe place you will use this value in the api key field in {{product name}} create the connection in {{product name}} once you have your watsonx ai api key, you're ready to create the connection in {{product name}} to create the connection log in to your {{product name}} account, add a watsonx ai module to your {{scenario singular lowercase}} , and click create a connection optional in the connection name field, enter a name for the connection in the ibm cloud region field, select a region in the connection level field, select space or project if you selected space for your connection level , enter your space id if you selected project for your connection level , enter your project id your project id and space id can be found in your watsonx ai account project id select the 4 bar menu in the upper left corner, click projects , and then click view all projects select your project and click the manage tab your project id is listed in your project details space id the space id is shown in the model's url in your browser’s address bar copy the part of the url that follows \&space id= in the api key field, enter the api key copied from your watsonx ai account click save if prompted, authenticate your account and confirm access you've successfully created the connection and can now use the watsonx ai app in your {{scenario plural lowercase}} if you want to make changes to your connection in the future, follow the steps connect an application docid\ so88fm6pkt0g adkddfzz watsonx ai modules after connecting to the watsonx ai app, you can use the following types of modules to build your {{scenario plural lowercase}} text generation infer text infer the text with a selected model and a set of parameters connection watsonx ai docid\ jdkzjwwosupf4myysjefj model id select the model you want to use input enter the prompt to generate completions maximum new tokens enter the maximum number of new tokens to be generated the maximum supported value for this field depends on the model being used how the token is defined depends on the tokenizer and vocabulary size, which in turn depends on the model often the tokens are a mix of full words and sub words to learn more about tokenization, see here depending on the users plan, and on the model being used, there may be an enforced maximum number of new tokens minimum new tokens enter the minimum number of new tokens to be generated if stop sequences are given, they are ignored until minimum tokens are generated temperature enter a a value lower than or equal to 2 this value is used to modify the next token probabilities in sampling mode values less than 1 0 sharpen the probability distribution, resulting in less variability in output values greater than 1 0 flatten the probability distribution, resulting in greater variability in output decoding method select the decoding method you wish to use greedy decoding selects the token with the highest probability at each step of the decoding process sample decoding offers more variability in how tokens are selected length penalty this setting can help to shorten the answers provided decay factor represents the factor of exponential decay larger values correspond to more aggressive decay value must be higher than or equal to 1 start index a number of generated tokens after which this should take effect value must be higher than or equal to 0 random seed enter a value higher than or equal to 1 the random number generator seed is used in sampling mode for experimental repeatability to produce repeatable results, set the same random seed value every time time limit enter the time limit in milliseconds if not completed within this time, the generation will stop depending on your plan and on the model being used, there may be an enforced maximum time limit top k enter how many tokens to sample must be a number between 1 and 100 top p enter a value lower than or equal to 1 the top p value specifies the cumulative probability score threshold the tokens must read this is also known as nucleus sampling repetition penalty enter a value between 1 and 2 a higher value leads to more diverse and varied output a lower value will increase the probability of repeated text truncate input tokens enter a value to specify the maximum number of tokens accepted in the input a value of 0 means the input will not be truncated include stop sequence select yes or no stop sequences are one or more strings which will cause the text generation to stop if/when they are produced as part of the output stop sequences encountered prior to the minimum number of tokens being generated will be ignored return options input text select yes , no , or empty generated tokens select yes , no , or empty input tokens select yes , no , or empty token logprobs select yes , no , or empty token ranks select yes , no , or empty top n tokens a higher value allows for more options to be considered, while a lower value creates more focused responses other make an api call connection watsonx ai docid\ jdkzjwwosupf4myysjefj url enter a path relative to https //www example com/api , e g /v2/users method select the method type get to retrieve information for an entry post to create a new entry put to update/replace an existing entry patch to make a partial entry update delete to delete an entry headers enter the desired request headers query string enter the request query string body enter the body content for your api call templates you can look for watsonx ai templates in make's template gallery , where you'll find thousands of pre created {{scenario plural lowercase}} watsonx ai resources ibm watson ai api documentation https //cloud ibm com/apidocs/watsonx ai