Using the Prompt library in IBM watsonx Code Assistant

Use the Prompt library in watsonx Code Assistantâ„¢.

Before you begin

  1. Read about watsonx Code Assistant as described in Using IBM watsonx Code Assistant in the IBM App Connect Enterprise Toolkit.
  2. Open the watsonx Code Assistant chat view as described in Opening the IBM watsonx Code Assistant view in the IBM App Connect Enterprise Toolkit.
  3. Set up watsonx Code Assistant on IBM Cloud and create an API key as described in Setting up watsonx Code Assistant on IBM Cloud and creating an API key.
  4. Log in to IBM watsonx Code Assistant as described in Logging in to IBM watsonx Code Assistant in the IBM App Connect Enterprise Toolkit with your API key.

About this task

You can use the Prompt library in the watsonx Code Assistant to submit predefined prompts from the Prompt Library, or to submit code-related questions.

Procedure

  1. In the watsonx Code Assistant view in the IBM App Connect Enterprise Toolkit, click Open menu.
    A menu is displayed with the menu items Chat sessions and Prompt library.
  2. Select Prompt library to open the Prompt library.

If you want to submit a predefined prompt from the Prompt Library, complete step 3 to step 6 inclusive.

  1. Choose a prompt and click Copy to clipboard.
  2. Click >to open the last chat session that you created.
  3. Paste the prompt that you copied into the dialog box.
  4. Click >to run the predefined prompt.
    Your prompt is displayed in the Chat session under the participant You.
    The response is displayed under the participant watsonx.

If you want to submit a code-related question, complete step 7 and step 8.

  1. Submit a code-related question into the dialog box. For example, "Generate Java code to do a linear search."
  2. Click >to run the prompt.
    The response to your prompt question is displayed in the Chat session under the participant You. The response is displayed under the participant watsonx.

What to do next

When you finish using the Prompt library, you can use the Chat sessions as described in Using the Chat sessions in IBM watsonx Code Assistant or log out as described in Logging out of IBM watsonx Code Assistant in the IBM App Connect Enterprise Toolkit.