> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img2.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=14257a2485938db41382835aff99a147" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img3.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=a0491100f6fc7603b452bf84ad727c7e" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img4.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=233e694a89aeca05b482f86f119e3fb5" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img5.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=85ab036b3263bcc7089e81c7ec8eb83d" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img6.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=86539391d9909539f100319a01df23f7" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img7.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=67fd4b934c14dd127bbcce8761c902d2" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img8.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=e1feef0466cf11355ac8fc0a20699960" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img9.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=deddc2872e32e0ec7f89808ae8a7be59" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img10.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=ff0b83908dc13913e367fee6f013d7d0" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img11.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=f7ad9857f3f5232303ae28f2f3be332a" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img12.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=fa67fd214c24d0b16e19b1a03f35f41e" 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/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/open-ai-tem-img13.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=c686c3e17916c9231a5d686783bb4b01" alt="Extracted Skills from resume content" width="591" height="679" data-path="ai-for-service/integrations/actions/images/open-ai-tem-img13.png" />
