> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-ai-for-service-dev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the OpenAI Action Templates

<Badge icon="arrow-left" color="gray">[Back to Actions Integrations](/ai-for-service/integrations/overview#actions)</Badge>

Use prebuilt OpenAI action templates to auto-create dialog tasks for generating answers and extracting skills.

**To access templates:**

1. Go to **Automation AI** > **Use Cases** > **Dialogs** and click **Create a Dialog Task**.

2. Under **Integration**, select **OpenAI**.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img2.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=1765a9f02c4a9933b452432d133e67a2" alt="Integration -- OpenAI" width="1075" height="910" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img2.png" />

3. If no integration is configured, click **Explore Integrations** to set one up. See [Actions Overview](/ai-for-service/integrations/overview#actions).

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img3.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=98641d526ec65250ac4e068dc44ec80c" alt="Explore Integrations" width="899" height="913" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img3.png" />

***

## Supported Actions

| Task                          | Description                                                 | Method |
| ----------------------------- | ----------------------------------------------------------- | ------ |
| Generate Answers from Context | Generates answers for questions based on the given context. | POST   |
| Extract Skills from Resume    | Extracts skills from resume content provided as input.      | POST   |

***

### Generate Answers from Context

1. Install the template from [OpenAI Action Templates](/ai-for-service/integrations/actions/configuring-the-openai-action#step-2-install-the-openai-action-templates).

2. The **Generate answers from context** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img4.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=a85a583d410e210be2512b195ea7783e" alt="Generate answers from context dialog task is added" width="1600" height="819" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img4.png" />

   * **answerGeneration** - User intent to generate answers.

   * **paragraph** and **question** - Entity nodes for the required details.

   * **answerGenerationService** - Bot action service to generate answers. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img5.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=14b82492693f6b46161664f5262b77da" alt="Edit request" width="1600" height="718" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img5.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "model": "text-davinci-003",
       "prompt": "Context: <your context text> Q: <your question>",
       "temperature": 0,
       "max_tokens": 256,
       "top_p": 1,
       "frequency_penalty": 0,
       "presence_penalty": 0
     }
     ```

     <Note>You can enter a maximum of 1500 words with no line breaks, single or double quotes in the content.</Note>

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img6.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=d393f9d7f8991b64e5020659736ec78a" alt="Add response" width="1600" height="610" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img6.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "cmpl-6f2Q0ZeQIOoSpX428wUr3rp7T7zgc",
       "object": "text_completion",
       "created": 1675238764,
       "model": "text-davinci-003",
       "choices": [
         {
           "text": "\n\nA: Under this policy, you can avail a maximum relocation reimbursement of up to $20,000, inclusive of tax gross-up.",
           "index": 0,
           "logprobs": null,
           "finish_reason": "stop"
         }
       ],
       "usage": {
         "prompt_tokens": 396,
         "completion_tokens": 30,
         "total_tokens": 426
       }
     }
     ```

   * **answerGenerationMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img7.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=76a5d5f68ea6ac0cc276bdfd2e5b7d84" alt="VA prompt to generate answer from context" width="593" height="837" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img7.png" />

4. Enter a question based on context when prompted:

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img8.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=c5954e6f7d3f3566a8ca72b83e19fe17" alt="Enter question" width="582" height="828" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img8.png" />

***

### Extract Skills from Resume

1. Install the template from [OpenAI Action Templates](/ai-for-service/integrations/actions/configuring-the-openai-action#step-2-install-the-openai-action-templates).

2. The **Extract Skills from resume** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img9.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=309c05d0026751c969ff84a6e4a8df57" alt="Extract Skills from resume dialog task is added" width="1600" height="841" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img9.png" />

   * **extractSkills** - User intent to extract skills from resume content.

   * **resume** - Entity node for extracting skills.

   * **extractSkillsService** - Bot action service to extract skills. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img10.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=801b9f0a4c873113b9e88899ed9ee35c" alt="Edit request" width="1600" height="711" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img10.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "model": "text-davinci-002",
       "prompt": "<resume content>",
       "temperature": 0.7,
       "stop": "Q:"
     }
     ```

     <Note>You can enter a maximum of 1500 words with no line breaks, single or double quotes in the content.</Note>

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img11.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=0b9c4163222f8a401a71df98664f3c8f" alt="Add response" width="1600" height="695" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img11.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "cmpl-6U8OZ4pJmLgGliKfCgfBjzgUgEV5Q",
       "object": "text_completion",
       "created": 1672640131,
       "model": "text-davinci-002",
       "choices": [
         {
           "text": "\n\n-Advanced automated aerated system-Wi-Fi technology-ESP8266 Wi-Fi module",
           "index": 0,
           "logprobs": null,
           "finish_reason": "stop"
         }
       ],
       "usage": {
         "prompt_tokens": 163,
         "completion_tokens": 27,
         "total_tokens": 190
       }
     }
     ```

   * **extractSkillsMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test.

4. Enter resume content when prompted:

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img12.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=be1894493954344f642a2b4f23bf80db" alt="Enter resume content" width="596" height="680" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img12.png" />

5. The VA extracts skills from the resume content:

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-tem-img13.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=107fc0399be4c8ea3a3e35cb77bd01af" alt="Extracted Skills from resume content" width="591" height="679" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img13.png" />
