GithubHelp home page GithubHelp logo

hwonyo / flask-clova Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 5.0 51 KB

python module for Clova Extension Kit

License: MIT License

Python 100.00%
cek clova flask-clova flask extension clova-extension-kit python-clova python-cek flask-cek cek-sdk

flask-clova's Introduction

flask_clova

PyPI PyPI

SDK of CEK (Clova Extension Kit) for Python

All the structure and ideas were copied after seeing flask-ask

About flask_clova

Table of Contents

Install

# setup requires will automatically installed in version >= 0.0.4
# pip install PyYAML
# pip install Flask

pip install flask_clova

Basics

from flask import Flask
from flask_clova import Clova, statement, question, say

app = Flask(__name__)
# must set CLOVA_VERIFY_REQUESTS False
# while testing wihtout application_id
# app.config['CLOVA_VERIFY_REQUESTS'] = False

clova = Clova(app, '/user_defined')

@clova.launch
def launch():
    return question(say.Korean('시작했습니다'))

@clova.intent('HelloIntent')
def play_game():
    speech = "안녕하세요"
    return statement(say.Korean(speech)).add_speech(say.English("Hello"))

if __name__ == "__main__":
    app.config['CLOVA_VERIFY_REQUESTS'] = False
    app.run(port='5000', debug=True)

Test

>> pip install -r requirements-dev.txt
>> python -m unittest discover test/

WorkToDO

Response

  • not in progress
    • card
    • directives

statement

  • support shouldEndSession true
    • SimpleSpeech
    • SpeechList
    • SpeechSet

question

  • support shouldEndSession false
    • SimpleSpeech
    • SpeechList
    • SpeechSet

repromt

  • support repromt message
    • SimpleSpeech
    • SpeechList
    • SpeechSet

Request

Verify

  • verify application id
    • verify

LaunchRequest

  • when extension launched
    • handler

SessionEndedRequest

  • when extension terminated
    • handler

IntentRequest

  • request with user intent
    • handler

Glboal Request Attr

  • Globalize variables in request
    • request
    • session
    • version
    • context

flask-clova's People

Contributors

hwonyo avatar jcooky avatar minkookbae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flask-clova's Issues

Basics 따라하고 있습니다.

안녕하세요. 분석으로만 파이썬 다루다가 clova앱을 만들일이 생겨 여기로 흘러들어온 초보입니다..
개발 초보라 웹, 서버 관련 지식이 전무해서 뭐가 뭔지...모르겠지만.. 그래도 질문하나 드리고자 합니다.

basics 코드 시도중인데, x.x.x.x:5000/user_defined에 POST로 request할때 디폴트 파라미터로 아무것도 입력 안해줘도 정상작동 해야하나요?
혹시 입력해야한다면 어떤 json 코드를 입력해야하나요? 예시가 있다면 부탁드릴게요.

postman으로 테스트하는데 아무것도 입력 안해주고 요청하면
json.decoder.JSONDecodeError
가 발생하고
대충 아무 json형식으로 딕트 하나 입력해서 요청하면
builtins.AttributeError
AttributeError: 'NoneType' object has no attribute 'sessionAttributes'
라는 에러가 발생하네요...

(참고로 aws에서 우분투 서버하나 파서 하고있는중이고, 5000번 포트는 열었습니다.
코드 마지막 app.run()에 host = '0.0.0.0', port = 5000 추가했습니다. )

Plans to support test mode

The session field is missing during the CEK console test.
It makes 500 error when user trying to use session attributes.
So it is better to support console testing mode in module level.

인증 방법

개발에 뛰어든지 얼마 안된 사람입니다.

코드를 살펴보던 중 app.confing 부분이 잘 못 되어 있는거 같은데 app.config 맞나요?

그리고 클로바 스피커랑 연동하려고 하는데 인증 부분을 어떻게 해결하는 건지 모르겠습니다.
도움말이 잘 안되어 있어서 설명 좀 부탁드려요

Method Not Allowed (405 Error)

README.md에 있는 Basic 보고 따라하는데 http://127.0.0.1:5000을 호출하면 계속 Method Not Allowed (405 Error) 에러가 뜹니다.
해결방법 좀 알려주세요.
그리고 코드에 app.run(port='5000' 에 적혀있는데
5000은 숫자형식으로 적는게 맞지 않나 싶어요. app.run(port=5000

MultiTurn Support

Since clova cek do not support DM(Dialog Management), it is difficult to solve multi turn case in user scenario.
So gonna support make follow-up intent and terminal intent.

Details

  • follow-up intent : only triggerd after parent intent matched.
  • terminal intent : clear all sessionAttributes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.