Manage scenarios
    • PDF

    Manage scenarios

    • PDF

    Article Summary

    The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.

    Available in Classic and VPC

    A scenario is the process through which the model thinks and examines to provide appropriate answers to the user's questions. Through collecting scenarios and reviewing data, you can edit your model's thought process.

    Scenario screen

    NCP scenario1.png

    ItemDescription
    ① Scenario collection areaArea where you set data to collect scenarios
    • Skill set: select skill set to collect scenarios
    • Included skills: a list of skills included in the selected skill set is displayed. Only skills with a task status of "task completed" can be used.
    • Engine and version: select a language model or version to use. The default language model is selected as the default value.
    • Call option (optional): enter a fixed value when calling user query.
    • User query: a field to enter query. It will not be until you select a skill set that the field will be enabled.
    • [Execute] button: a button to execute scenario collection
    ② Planning data areaThe area where all data of the ongoing model thinking process is exposed
    • Thought: the thought of the model
    • Action: the type of action required to proceed with the current step
    • Action input: an input value necessary for calling the action
    • Result: the result of performing an action
    ③ Skill data areaThe area where the skill call data is exposed
    • Thought: the thought of the model
    • Action: the type of action required to proceed with the current step
    • Action input: an input value necessary for calling the action
    • Observation: API spec and API call results that should be used according to the model's judgment
    ④ Function button
    • [Load] button: a button to recall the previously tasked scenario
    • [Temporary save] button: a button to save what has been done until now
    • [Complete task] button: a button to complete the work done to date. Only activated when the final response data is created
    Note
    • Step 1 shows the results of the skill call, and the remaining steps show the results of the entire model's generation.
    • Even after the final answer is created, if you click the [Save draft] button, the task status changes to "In progress."

    Collect scenarios

    To collect scenarios, follow these steps:

    1. On the NAVER Cloud Platform console, click Services > AI Services > CLOVA Studio in order.
    2. Click the My Product menu, and then click the [Go to CLOVA Studio] button.
    3. On CLOVA Studio, click the Skill trainer menu.
    4. Click the [Collect scenario] button at the top of the screen.
    5. Select the skill set and engine from the left of the screen, and enter the user query.
      • Skill set: select a skill set in which to collect scenarios
      • Included skills: a list of skills included in the selected skill set. You can only use skills whose task status is "completed"
      • Engine and version: select the language model to use. The default language model is selected by default
      • Call option (optional): enter a fixed value when calling a user query. For more information on writing a call option, see Write call option.
      • User query: the field for entering user queries. You need to select a skill set to activate this field
    6. Click the [Run] button.
    Note

    After running scenario collection, you cannot edit your skill set, engine, or user query. If you need to edit the content, click the [Initialize] button to restart the task. The [Initialize] button is activated once scenario collection is completed.

    Edit scenario data

    To review and edit the collected scenario data, follow these steps:

    1. Run Collect scenario.
    2. Review the model's thoughts in the planning data area.
    3. To edit one of the steps in the planning data area, click each relevant field.
      • For more information on how to edit content in the planning data area, see Planning data.
    4. Once the step is edited, click the [Apply] button.
      • The step is regenerated.
    5. To edit data in the skill data area, click each relevant field.
      • For more information on how to edit content in the skill data area, see Single skill data.
    6. When you are finished with editing, click the [Apply] button.
      • The skill data will be rerun.
    7. When the final response field is activated in the planning data area, click the [Complete task] button on the bottom right.
      • To save a draft and reload later, click the [Save draft] button.
    Note

    If unnecessary data is created in the skill data area, click the [End step] button in the skill data area. All steps created between that step and the final response step are deleted. Only after the final response step is generated can the [End step] button be activated.

    Planning data

    The planning data area shows all data of the model's ongoing thought process. You can check the thought process of the planning model that plans and executes the skills to use and their order when running user queries. The planning data area consists of 3 steps.

    Step 1: planning step

    This is the step to decide which skill to use.

    2.png

    ItemDescription
    ThoughtModel's thought about user query
    ActionsType of action you need to proceed with the current step
    Action inputInput value for calling actions. The user query is displayed in the query field of the action input area, and the skill to be used is displayed in the skill field.
    If you need 2 or more skills, the queries are entered separately as "Recommend a good restaurant near Gangnam Station" and "Recommend a car rental near Gangnam Station," instead of "Recommend a good restaurant and a car rental near Gangnam Station"
    ResultsThe result of the planning step is entered in the
  • Result field format: [{"tool_name": "사용할 스킬 이름1","input":{"query":"스킬에 해당하는 쿼리"}}, {"tool_name": "사용할 스킬 이름2","input":{"query":"스킬에 해당하는 쿼리"}}]
  • Step 2: skill execution step

    This is the step to call the skills. You cannot edit any of the fields.

    Step 3: final response step

    This is the step to decide the response to deliver to the user. Click the [Complete task] button to save all and finish creating the scenario.

    Single skill data

    The skill data area shows the skill data you want to call. The planning data area determines which skill to use for the user query, while the skill data area shows detailed data about the skill to be called and allows you to edit the data directly. The skill data area consists of 3 steps.

    Step 1: search API

    The first step for single skill data is to query an API.

    3.png

    ItemDescription
    ThoughtModel's judgment. Must include the skill's API name
    ActionsAction name
    Action inputMust display "None"
    ObservationAPI specifications to use depending on the model's determination

    Step 2: call API

    The second step for single skill data is to call an API. The second step for skill data is to call an API. You can click each field to edit the value. When you edit the value of a field, the [Apply] button is activated. When you click the [Apply] button, the skill data is rerun, and the edited result is applied to the planning data area as well.

    The following screen shows skill data that uses the GET method in the API call step.

    4.png

    ItemDescription
    ThoughtThought process for API calls. You can improve performance by entering specific parameters and queries
    \<writing example> "Based on the API document, the required parameter is {required parameter name}. To do a {query}, you can use {parameter 1 value} as the value of {use parameter 1} and {parameter 2 value} as the value of {use parameter 2}."
    ActionsApply requests_get
    Action inputEnter address and parameters required for API calls
    ObservationModel's determination

    When using the POST method, the field for entering the URL and parameters is activated in the action input area.
    The following screen shows skill data that uses the POST method in the API call step.

    5.png

    ItemDescription
    ThoughtThought process for API calls. You can improve performance by entering specific parameters and queries
    \<writing example> "Based on the API document, the required parameter is {required parameter name}. To do a {query}, you can use {parameter 1 value} as the value of {use parameter 1} and {parameter 2 value} as the value of {use parameter 2}."
    ActionsApply "requests_post"
    Action inputApply API call address and parameters
    • [Add field] button: add new parameter field
    • i-clovastudio_reset: delete parameter field
    ObservationModel's determination
    Note

    When creating a new parameter, make sure it is not redundant with the key of an existing parameter. If there are duplicate keys, the API may not be called.

    Step 3: skill response

    This is the step to decide the response to be delivered to the user after querying and calling the API.

    Scenario configuration method

    Depending on the number of skills used, you can configure either a single skill scenario or a multi skill scenario.

    Single skill scenario

    A single skill scenario is a scenario that uses just 1 skill. The scenario sequence is as follows:

    Scenario sequence

    1. User query: recommend travel destinations in Busan
    2. Planning data Step 1: plan skill to use
    3. Planning data Step 2: execute skill
      1. Single skill data Step 2-1: search API for travel destinations
      2. Single skill data Step 2-2: check API parameters for travel destinations, and call by using Busan as a keyword
      3. Skill data Step 2-3: return the result about travel destinations in Busan
    4. Planning data Step 3: provide final response to user

    Scenario description

    In response to the user query "Recommend travel destinations in Busan," the model determines which skill to use. If the model determines that it needs to call the travel destination search API, it queries the API, checks the necessary parameters, and then calls the required information. Finally, the model decides in what form the result should be delivered to the user and then presents the response.

    Multi skill scenario

    A multi skill scenario is a scenario that uses 2 skills. The scenario sequence is as follows:

    Scenario sequence

    1. User query: recommend restaurants and car rentals near Gangnam Station
    2. Planning data Step 1: plan skill to use
    3. Planning data Step 2: execute skill
      1. Single skill data Step 2-1: search API for restaurants near Gangnam Station
      2. Single skill data Step 2-2: call API for restaurants near Gangnam Station
      3. Skill data Step 2-3: return the result about restaurants near Gangnam Station
    4. Planning data Step 3: execute skill
      1. Single skill data Step 3-1: search API for car rentals
      2. Single skill data Step 3-2: call API for car rentals
      3. Skill data Step 3-3: return the result about car rentals
    5. Planning data Step 4: provide final response to user

    Scenario description
    The model determines which skill to use in response to the user query that goes "Recommend restaurants and car rentals near Gangnam Station." Since search is needed for both restaurants and car rentals, the model determines that it needs to call 2 APIs. In the second step, the API that searches for popular restaurants near Gangnam Station is queried and called, and in the third step, the API that searches for car rentals is queried and called. Finally, the model decides in what form the information should be delivered to the user and then presents the response.

    Note
    • The action field of the skill execution step must include the "Name for model" value of the skill to be called.
    • When editing the value of the action input field in the skill execution step, include the query entered in the result field of Step 1.

    Load scenario

    You can load, review, and edit scenarios you previously worked on.
    To load a scenario, follow these steps:

    1. On the NAVER Cloud Platform console, click Services > AI Services > CLOVA Studio in order.
    2. Click the My Product menu, and then click the [Go to CLOVA Studio] button.
    3. On CLOVA Studio, click the Skill trainer menu.
    4. Click the [Collect scenario] button at the top of the screen.
    5. Click the [Load] button on the bottom left of the scenario collection screen.
      • You can see the list of scenarios you are working on.
    6. Check the previous query list.
      • You can search for user queries from the top right of the Load window.
      • To view the model result, click the [View] button of the relevant data item.
      • To delete a user query, click View more i_clovastudio-more > [Delete] on the right of the list.
      • The task status shows "completed" only when you click the [Complete task] button on the scenario task screen.
    7. To edit the previous query task from the scenario collection screen, click the [Open] button.
      • The scenario collection screen appears, and you can continue to work on the previous queries.

    Create call option

    Through the call option, you can configure settings to fix specific values of header and body parameters in response to the operation ID of the API spec. To create a call option, follow these steps:

    1. Click [Setting icon] of the call option on the left side of the screen during the Collect scenarios process.
      • The call option settings window appears.
    2. Enter the call option in JSON type in the call value input area. Create it referring to the example format above.
    3. Once the call value input is completed, click the [Apply] button.
      • If it fails to be applied, an error message will be displayed. Edit the call value again.
    Note

    Even if you click the [Initialize] button after applying the call option to collect scenarios, the call option remains the same. However, the call option is initialized in the following cases:

    • If you restarted by clicking the [Collect scenarios] button in the skill set list or skill list after leaving the scenario collection screen
    • If you change the skill set in the scenario collection screen

    In this case, you can click scenario [Load] to recall the previously used call option.

    Detailed call option

    It is information on the fields that can be written in the call option.

    FieldData typeDescription
    baseOperationobjectThe call option is applied to all APIs registered within the skill set.
    baseOperation.headermap<string, string>The value you want to add and fix in the HTTP Header of all APIs
    baseOperation.querymap<string, string>The value to be added and fixed in HTTP Query Parameters of all APIs
    baseOperation.requestBodymap<string, object>The value you want to add and fix in the HTTP Request Body of all APIs
    operationslistThe call option is applied only to the specified Operation ID among the APIs registered within the skill set.
    operations[].operationIdstringSpecify the Operation ID to which you want to apply the call option.
    operations[].headermap<string, string>The value you want to add and fix in the HTTP Header of the API mapped to the specified Operation ID
    operations[].querymap<string, string>The value you want to add and fix in the HTTP Query Parameters of the API mapped to the specified Operation ID
    operations[].requestBodymap<string, object>The value you want to add and fix in the HTTP Request Body of the API mapped to the specified Operation ID

    Example of writing a call value

    You can use the baseOperation field when you want to apply a call option to all APIs registered within the skill set. The following shows how to write it.

    {
      "baseOperation": {
        "query": {
          "serviceKey": "value"
        }
      }
    }
    

    You can use the operations field when you want to apply a call option only to a specific Operation ID. The following shows how to write it.

    {
      "operations": [
        {
          "operationId": "filterBakeryProducts",
          "query": {
            "serviceKey": "value"
          }
        }
      ]
    }
    

    It is also possible to apply the baseOperation field and the operations field together. The following shows how to write it.

    {
      "baseOperation": {
        "header": {
          "baseHeader": "baseHeaderValue"
        },
        "query": {
          "baseQuery": "baseQueryValue"
        },
        "requestBody": {
          "baseBody": "baseBodyValue"
        }
      },
      "operations": [
        {
          "operationId": "testOperationId1",
          "header": {
            "header1": "headerValue1"
          },
          "query": {
            "query1": "queryValue1"
          },
          "requestBody": {
            "body1": "bodyValue1"
          }
        },
        {
          "operationId": "testOperationId2",
          "header": {
            "header2": "headerValue2"
          },
          "query": {
            "query2": "queryValue2"
          },
          "requestBody": {
            "body2": "bodyValue2"
          }
        }
      ]
    }
    
    Note

    The call options are applied in the order of operations field, baseOperation field, and then the user query.


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.