Submit Search
Upload
Use Kotlin scripts and Clova SDK to build your Clova extension
•
1 like
•
1,466 views
LINE Corporation
Follow
The session material for LINE Developer Meetup #49 in Kyoto at 2019/1/23
Read less
Read more
Technology
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 33
Download now
Download to read offline
Recommended
Zendcon 09
Zendcon 09
Wade Arnold
Tools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 Edition
Jesus Manuel Olivas
#Gophercon Talk by Smita Vijayakumar - Go's Context Library
#Gophercon Talk by Smita Vijayakumar - Go's Context Library
Exotel
Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard Interfaces
Thomas Weinert
Grails UI Primer
Grails UI Primer
Matthew Taylor
Exch test-mail flow
Exch test-mail flow
Tzahi Kolber
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwr
deimos
Building multi lingual and empatic bots - Sander van den Hoven - Codemotion A...
Building multi lingual and empatic bots - Sander van den Hoven - Codemotion A...
Codemotion
Recommended
Zendcon 09
Zendcon 09
Wade Arnold
Tools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 Edition
Jesus Manuel Olivas
#Gophercon Talk by Smita Vijayakumar - Go's Context Library
#Gophercon Talk by Smita Vijayakumar - Go's Context Library
Exotel
Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard Interfaces
Thomas Weinert
Grails UI Primer
Grails UI Primer
Matthew Taylor
Exch test-mail flow
Exch test-mail flow
Tzahi Kolber
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwr
deimos
Building multi lingual and empatic bots - Sander van den Hoven - Codemotion A...
Building multi lingual and empatic bots - Sander van den Hoven - Codemotion A...
Codemotion
Javascript - Beyond-jQuery
Javascript - Beyond-jQuery
Tanner Moushey ❖ Mission Lab - WordPress Agency
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Codemotion
History of jQuery
History of jQuery
jeresig
Phoenix + Reactで 社内システムを 密かに作ってる
Phoenix + Reactで 社内システムを 密かに作ってる
Takahiro Kobaru
Asynchronous I/O in PHP
Asynchronous I/O in PHP
Thomas Weinert
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
Tsuyoshi Yamamoto
Performance measurement and tuning
Performance measurement and tuning
AOE
The Open Web and what it means
The Open Web and what it means
Robert Nyman
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
Tsuyoshi Yamamoto
React PHP: the NodeJS challenger
React PHP: the NodeJS challenger
vanphp
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with Finagle
Vladimir Kostyukov
Introduction to Service Workers | Matteo Manchi
Introduction to Service Workers | Matteo Manchi
Codemotion
jQuery secrets
jQuery secrets
Bastian Feder
Multi tenant laravel
Multi tenant laravel
Peter Mein
A real-world Relay application in production - Stefano Masini - Codemotion Am...
A real-world Relay application in production - Stefano Masini - Codemotion Am...
Codemotion
FwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.js
Timur Shemsedinov
AngularJS - $http & $resource Services
AngularJS - $http & $resource Services
Eyal Vardi
JSON Schema: Your API's Secret Weapon
JSON Schema: Your API's Secret Weapon
Pete Gamache
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Tsuyoshi Yamamoto
The promise of asynchronous PHP
The promise of asynchronous PHP
Wim Godden
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
Shengyou Fan
Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010
Ismael Celis
More Related Content
What's hot
Javascript - Beyond-jQuery
Javascript - Beyond-jQuery
Tanner Moushey ❖ Mission Lab - WordPress Agency
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Codemotion
History of jQuery
History of jQuery
jeresig
Phoenix + Reactで 社内システムを 密かに作ってる
Phoenix + Reactで 社内システムを 密かに作ってる
Takahiro Kobaru
Asynchronous I/O in PHP
Asynchronous I/O in PHP
Thomas Weinert
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
Tsuyoshi Yamamoto
Performance measurement and tuning
Performance measurement and tuning
AOE
The Open Web and what it means
The Open Web and what it means
Robert Nyman
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
Tsuyoshi Yamamoto
React PHP: the NodeJS challenger
React PHP: the NodeJS challenger
vanphp
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with Finagle
Vladimir Kostyukov
Introduction to Service Workers | Matteo Manchi
Introduction to Service Workers | Matteo Manchi
Codemotion
jQuery secrets
jQuery secrets
Bastian Feder
Multi tenant laravel
Multi tenant laravel
Peter Mein
A real-world Relay application in production - Stefano Masini - Codemotion Am...
A real-world Relay application in production - Stefano Masini - Codemotion Am...
Codemotion
FwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.js
Timur Shemsedinov
AngularJS - $http & $resource Services
AngularJS - $http & $resource Services
Eyal Vardi
JSON Schema: Your API's Secret Weapon
JSON Schema: Your API's Secret Weapon
Pete Gamache
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Tsuyoshi Yamamoto
The promise of asynchronous PHP
The promise of asynchronous PHP
Wim Godden
What's hot
(20)
Javascript - Beyond-jQuery
Javascript - Beyond-jQuery
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
History of jQuery
History of jQuery
Phoenix + Reactで 社内システムを 密かに作ってる
Phoenix + Reactで 社内システムを 密かに作ってる
Asynchronous I/O in PHP
Asynchronous I/O in PHP
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
Performance measurement and tuning
Performance measurement and tuning
The Open Web and what it means
The Open Web and what it means
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
React PHP: the NodeJS challenger
React PHP: the NodeJS challenger
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with Finagle
Introduction to Service Workers | Matteo Manchi
Introduction to Service Workers | Matteo Manchi
jQuery secrets
jQuery secrets
Multi tenant laravel
Multi tenant laravel
A real-world Relay application in production - Stefano Masini - Codemotion Am...
A real-world Relay application in production - Stefano Masini - Codemotion Am...
FwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.js
AngularJS - $http & $resource Services
AngularJS - $http & $resource Services
JSON Schema: Your API's Secret Weapon
JSON Schema: Your API's Secret Weapon
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
The promise of asynchronous PHP
The promise of asynchronous PHP
Similar to Use Kotlin scripts and Clova SDK to build your Clova extension
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
Shengyou Fan
Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010
Ismael Celis
The IoC Hydra
The IoC Hydra
Kacper Gunia
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
Konstantin Kudryashov
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and Ops
Mykyta Protsenko
Doctrine For Beginners
Doctrine For Beginners
Jonathan Wage
AngularJs
AngularJs
Hossein Baghayi
kissy-past-now-future
kissy-past-now-future
yiming he
jQuery secrets
jQuery secrets
Bastian Feder
KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天
tblanlan
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
Kacper Gunia
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
Lindsay Holmwood
Flask patterns
Flask patterns
it-people
XQuery Rocks
XQuery Rocks
William Candillon
Not your Grandma's XQuery
Not your Grandma's XQuery
William Candillon
“SOLID principles in PHP – how to apply them in PHP and why should we care“ b...
“SOLID principles in PHP – how to apply them in PHP and why should we care“ b...
DevClub_lv
Symfony2 from the Trenches
Symfony2 from the Trenches
Jonathan Wage
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friends
Michael Peacock
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12
Jakub Zalas
Similar to Use Kotlin scripts and Clova SDK to build your Clova extension
(20)
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
Websockets talk at Rubyconf Uruguay 2010
Websockets talk at Rubyconf Uruguay 2010
The IoC Hydra
The IoC Hydra
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and Ops
Doctrine For Beginners
Doctrine For Beginners
AngularJs
AngularJs
kissy-past-now-future
kissy-past-now-future
jQuery secrets
jQuery secrets
KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
Flask patterns
Flask patterns
XQuery Rocks
XQuery Rocks
Not your Grandma's XQuery
Not your Grandma's XQuery
“SOLID principles in PHP – how to apply them in PHP and why should we care“ b...
“SOLID principles in PHP – how to apply them in PHP and why should we care“ b...
Symfony2 from the Trenches
Symfony2 from the Trenches
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friends
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12
More from LINE Corporation
JJUG CCC 2018 Fall 懇親会LT
JJUG CCC 2018 Fall 懇親会LT
LINE Corporation
Reduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin Coroutines
LINE Corporation
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
LINE Corporation
The Magic of LINE 購物 Testing
The Magic of LINE 購物 Testing
LINE Corporation
GA Test Automation
GA Test Automation
LINE Corporation
UI Automation Test with JUnit5
UI Automation Test with JUnit5
LINE Corporation
Feature Detection for UI Testing
Feature Detection for UI Testing
LINE Corporation
LINE 新星計劃介紹與新創團隊分享
LINE 新星計劃介紹與新創團隊分享
LINE Corporation
LINE 技術合作夥伴與應用分享
LINE 技術合作夥伴與應用分享
LINE Corporation
LINE 開發者社群經營與技術推廣
LINE 開發者社群經營與技術推廣
LINE Corporation
日本開發者大會短講分享
日本開發者大會短講分享
LINE Corporation
LINE Chatbot - 活動報名報到設計分享
LINE Chatbot - 活動報名報到設計分享
LINE Corporation
在 LINE 私有雲中使用 Managed Kubernetes
在 LINE 私有雲中使用 Managed Kubernetes
LINE Corporation
LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧
LINE Corporation
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE Corporation
LINE Things - LINE IoT平台新技術分享
LINE Things - LINE IoT平台新技術分享
LINE Corporation
LINE Pay - 一卡通支付新體驗
LINE Pay - 一卡通支付新體驗
LINE Corporation
LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Corporation
Keynote - LINE 的技術策略佈局與跨國產品開發
Keynote - LINE 的技術策略佈局與跨國產品開發
LINE Corporation
LINE Ads Platformの開発を支えるKafka
LINE Ads Platformの開発を支えるKafka
LINE Corporation
More from LINE Corporation
(20)
JJUG CCC 2018 Fall 懇親会LT
JJUG CCC 2018 Fall 懇親会LT
Reduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin Coroutines
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
The Magic of LINE 購物 Testing
The Magic of LINE 購物 Testing
GA Test Automation
GA Test Automation
UI Automation Test with JUnit5
UI Automation Test with JUnit5
Feature Detection for UI Testing
Feature Detection for UI Testing
LINE 新星計劃介紹與新創團隊分享
LINE 新星計劃介紹與新創團隊分享
LINE 技術合作夥伴與應用分享
LINE 技術合作夥伴與應用分享
LINE 開發者社群經營與技術推廣
LINE 開發者社群經營與技術推廣
日本開發者大會短講分享
日本開發者大會短講分享
LINE Chatbot - 活動報名報到設計分享
LINE Chatbot - 活動報名報到設計分享
在 LINE 私有雲中使用 Managed Kubernetes
在 LINE 私有雲中使用 Managed Kubernetes
LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE Things - LINE IoT平台新技術分享
LINE Things - LINE IoT平台新技術分享
LINE Pay - 一卡通支付新體驗
LINE Pay - 一卡通支付新體驗
LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Platform API Update - 打造一個更好的Chatbot服務
Keynote - LINE 的技術策略佈局與跨國產品開發
Keynote - LINE 的技術策略佈局與跨國產品開發
LINE Ads Platformの開発を支えるKafka
LINE Ads Platformの開発を支えるKafka
Recently uploaded
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Fwdays
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
UiPathCommunity
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
ScyllaDB
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Sergiu Bodiu
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Padma Pradeep
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
gvaughan
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Wonjun Hwang
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
SeasiaInfotech2
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
comworks
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
Zilliz
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Florian Wilhelm
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Memoori
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
RankYa
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Safe Software
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Fwdays
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
2toLead Limited
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Alex Barbosa Coqueiro
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
charlottematthew16
Recently uploaded
(20)
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
Use Kotlin scripts and Clova SDK to build your Clova extension
1.
/ F @
DE @D@ 3C @D C DC 9 @F 1 D@ E 9 @E @F D C @ 99 4 / 020 # #
2.
A E ) ) ( )(
3.
) (
4.
5.
• 1 .1
1 ) - - • 1 1 3 (- - 3 ( • 1 -2 1 )
6.
( ) )
) dependencies { implementation "org.jetbrains.kotlin:kotlin-script-util:$kotlinVersion" implementation "org.jetbrains.kotlin:kotlin-script-runtime:$kotlinVersion" implementation "org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlinVersion” } Add the dependencies
7.
( ) )
) org.jetbrains.kotlin.script.jsr223.KotlinJsr223JvmLocalScriptEngineFactory add a file javax.script.ScriptEngineFactory in “resources/META-INF/services/”
8.
( ) )
) private val scriptEngine: ScriptEngine = ScriptEngineManager().getEngineByExtension("kts")!! Get the ScriptEngine
9.
)( ( ( ( val
x = scriptEngine.eval( """ fun x(input: Int): Int = input + 3 """) x=?x=null
10.
)( ( ( ( val
y = scriptEngine.eval( """ fun x(input: Int): Int = input + 3 val y = x(2) """) y=?y=null
11.
)( ( ( ( val
x = scriptEngine.eval( """ fun x(input: Int): Int = input + 3 x(2) """) x=?x=5
12.
)( ( ( ( val
value = scriptEngine.eval( """ fun x(input: Int): Int = input + 3 val x = x(2) var y = x x y = x(7) """) value=?value=null
13.
)( ( ( ( val
value = scriptEngine.eval( """ fun x(input: Int): Int = input + 3 var x = x(2) var y = x x = 10 x y + 1 """) value=?value=6
14.
• , (
, ) (
15.
16.
/ . -
. . -
17.
val client: ClovaClient
= clovaClient(applicationId = "YOUR APPLICATION ID") { objectMapper = JacksonObjectMapper() //SDK only supports Jackson now launchHandler { request, session -> simpleResponse(message = " ") } intentHandler { request, session -> val value = request.intent.slots["number"]?.value simpleResponseWithReprompt( message = " ${value} ", repromptMessage = " ” ) } sessionEndedHandler { request, session -> simpleResponse(message = " ") } }
18.
val client: ClovaClient
= clovaClient(applicationId = "YOUR APPLICATION ID") { objectMapper = JacksonObjectMapper() launchHandler { request, session -> simpleResponse(message = “ ”) // Helper function } intentHandler { request, session -> val value = request.intent.slots["number"]?.value simpleResponseWithReprompt( message = " ${value} ", repromptMessage = " ” ) } sessionEndedHandler { request, session -> simpleResponse(message = " ") } }
19.
val client: ClovaClient
= clovaClient(applicationId = "YOUR APPLICATION ID") { objectMapper = JacksonObjectMapper() launchHandler { request, session -> simpleResponse(message = " ") } intentHandler { request, session -> val value = request.intent.slots["number"]?.value simpleResponseWithReprompt( message = " ${value} ", repromptMessage = " ” ) } sessionEndedHandler { request, session -> simpleResponse(message = " ") } }
20.
val client: ClovaClient
= clovaClient(applicationId = "YOUR APPLICATION ID") { objectMapper = JacksonObjectMapper() launchHandler { request, session -> simpleResponse(message = " ") } intentHandler { request, session -> val value = request.intent.slots["number"]?.value simpleResponseWithReprompt( message = " ${value} ", repromptMessage = " ” ) } sessionEndedHandler { request, session -> simpleResponse(message = " ") } }
21.
@Dsl fun ClovaClient.launchHandler(handler: RequestHandler<LaunchRequest>)
{ launchHandler = handler } @Dsl fun ClovaClient.intentHandler(handler: RequestHandler<IntentRequest>) { intentHandler = handler } @Dsl fun ClovaClient.sessionEndedHandler(handler: RequestHandler<SessionEndedRequest>) { sessionEndedHandler = handler }
22.
typealias RequestHandler<T> =
suspend (T, Session) -> ClovaExtensionResponse launchHandler { request, session -> simpleResponse(message = “ ”) ! // return ClovaExtensionResponse }
23.
//requestBody and response
are json strings val response = client.handleClovaRequest(requestBody, request.headers().asHttpHeaders())
24.
• • • - -
25.
Is it possible
to use Kotlin script to create ClovaClient??
26.
27.
val clovaClient =
scriptEngine.eval(""" clovaClient(applicationId = "APPLICATION_ID") { launchHandler { ... } intentHandler { ... } sessionEndedHandler { ... } } """)
28.
val clovaClient =
scriptEngine.eval(""" import com.linecorp.clova.extension.client.* import com.linecorp.clova.extension.model.util.* import com.linecorp.clova.extension.model.response.* import com.linecorp.clova.extension.converter.jackson.JacksonObjectMapper clovaClient(applicationId = "YOUR APPLICATION ID") { launchHandler { ...} intentHandler { ... } sessionEndedHandler { ... } } """)
29.
val clovaClient =
scriptEngine.eval( """ import … clovaClient(applicationId = "APPLICATION_ID") { … } """) … val response = client.handleClovaRequest(requestBody, request.headers().asHttpHeaders())
30.
val clovaClient =
scriptEngine.eval( """ import … clovaClient(applicationId = "APPLICATION_ID") { … } """) … val response = client.handleClovaRequest(requestBody, request.headers().asHttpHeaders()) ! Input the script from web
31.
/ .
32.
• : . •
-
33.
!
Download now