Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Solutions
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Cloud Functions
  • Getting started
    • Overview
    • Creating a function
      • Overview
      • Python
      • Node.js
      • PHP
      • Go
      • Bash
    • Creating a trigger
      • Overview
      • Timer
      • Trigger for Message Queue
      • Trigger for Object Storage
      • Trigger for Container Registry
      • Trigger for Cloud Logs
      • Trigger for Yandex IoT Core
  • Step-by-step instructions
    • All instructions
    • Using functions to get an IAM token for a service account
    • Managing rights to access functions
    • Managing functions
      • Creating a function
      • Managing function versions
      • Working in the code editor
      • Invoking a function
      • Updating a function
      • View monitoring charts
      • Viewing the execution log
      • Delete function
    • Managing triggers
      • Getting information about a trigger
      • Creating a timer
      • Creating a trigger for Message Queue
      • Creating a trigger for Object Storage
      • Creating a trigger for Container Registry
      • Creating a trigger for Cloud Logs
      • Creating a trigger for Yandex IoT Core
      • Updating a trigger
      • Deleting a trigger
  • Concepts
    • Overview
    • Function
    • Invoking a function
    • Runtime environment
      • Overview
      • Environment
      • Execution context
    • Builder
    • Trigger
      • Overview
      • Timer
      • Trigger for Message Queue
      • Trigger for Object Storage
      • Trigger for Container Registry
      • Trigger for Cloud Logs
      • Trigger for Yandex IoT Core
    • Dead Letter Queue
    • Log groups
    • Monitoring
    • Backups
    • Quotas and limits
  • Developing in Node.js
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in Python
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in Go
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in PHP
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
  • Developing in Bash
    • Overview
    • Request handler
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in Java
    • Overview
    • Programming model
      • Overview
      • Function interface
      • YcFunction interface
      • HttpServlet class
      • Spring Boot
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Developing in R
    • Overview
    • Programming model
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
  • Developing in C#
    • Overview
    • Programming model
      • Overview
      • Function interface
      • YcFunction interface
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Use cases
    • Creating skills for Alice
  • Pricing policy
  • Access management
  • API Functions reference
    • Authentication in the API
    • gRPC
      • Overview
      • FunctionService
      • OperationService
    • REST
      • Overview
      • Function
        • Overview
        • create
        • createVersion
        • delete
        • get
        • getVersion
        • getVersionByTag
        • list
        • listAccessBindings
        • listOperations
        • listRuntimes
        • listTagHistory
        • listVersions
        • removeTag
        • setAccessBindings
        • setTag
        • update
        • updateAccessBindings
  • API Triggers reference
    • Authentication in the API
    • gRPC
      • Overview
      • TriggerService
      • OperationService
    • REST
      • Overview
      • Trigger
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • pause
        • resume
        • update
  • Questions and answers
  1. Use cases
  2. Creating skills for Alice

Creating skills for Alice

  • Prepare the code for Alice's skill
  • Create a function
  • Create the version of the function
  • Add the function link to Alice's skill
  • Test the skill

As an example, we'll create a skill called Parrot, which repeats everything a user writes or says. We implement our example in two programming languages: Python and Node.js.

To add skills based on a function to Alice:

  1. Prepare the skill code.
  2. Create a function.
  3. Create a version of the function.
  4. Add the function link to Alice's skill.
  5. Test the skill.

More about developing Alice's skills.

Prepare the code for Alice's skill

To create versions of functions, you can use one of the code upload formats. As an example, we'll upload the code in a ZIP archive.

Python
Node.js
  1. Download a sample file from GitHub: parrot.py.
  2. Create a ZIP archive named parrot-py.zip with the parrot.py file.
  1. Download a sample file from GitHub: index.js.
  2. Create a ZIP archive named parrot-js.zip and add the index.js file.

Create a function

Once created, the function will only contain information about itself, like its name, description, and unique ID. The skill's code will be added to the function when you create a version.

  1. In management console, select the folder where you want to create your function.

  2. Click Create resource.

  3. Choose Function.

  4. Enter a function name.

    • Length — from 3 to 63 characters.
    • The name may contain lowercase Latin letters, numbers, and hyphens.
    • The first character must be a letter. The last character can't be a hyphen.
  5. Click Create.

Create the version of the function

Choose the programming language and create a version of the function.

Python
Node.js
  1. In the management console, open Cloud Functions in the folder where you want to create the function version.
  2. Select the function to create the version for.
  3. Under Latest version, click Create in editor.
  4. Set the version parameters:
    • Runtime environment: python37.
    • Timeout, seconds: 2.
    • RAM: 128 MB.
    • Service account: Not selected.
  5. Prepare the function code:
    • Method: ZIP archive.
    • File: parrot-py.zip.
    • Entry point: parrot.handler.
  6. Click Create version.
  1. In the management console, open Cloud Functions in the folder where you want to create the function version.
  2. Select the function to create the version for.
  3. Under Latest version, click Create in editor.
  4. Set the version parameters:
    • Runtime environment: nodejs12.
    • Timeout, seconds: 2.
    • RAM: 128 MB.
    • Service account: Not selected.
  5. Prepare the function code:
    • Method: ZIP archive.
    • File: parrot-js.zip.
    • Entry point: index.handler.
  6. Click Create version.

Add the function link to Alice's skill

  1. Go to Alice's skill page in your dashboard.

  2. Open the Settings tab.

  3. Under Backend, select Function in Yandex.Cloud.

  4. Select the desired function from the drop-down list.

    Warning

    The list shows the functions that you're allowed to view. To attach a function to a skill, you need permission to launch the function. This permission is part of the serverless.functions.invoker, editor, and higher roles.

  5. Click Save at the bottom of the page to save changes.

Test the skill

  1. Open the Testing tab on the skill page in your dashboard.
  2. If everything is set up correctly, the Chat section will display a message inviting you to start a conversation: Hello! I'll repeat anything you say to me..
  3. Send a message and make sure the response is the same.
In this article:
  • Prepare the code for Alice's skill
  • Create a function
  • Create the version of the function
  • Add the function link to Alice's skill
  • Test the skill
Language / Region
Careers
Privacy policy
Terms of use
Brandbook
© 2021 Yandex.Cloud LLC