RasaHost
1.0.0
봇 개발을 단순화하는 Rasa NLU 및 Rasa Core용 사용자 인터페이스입니다.
https://pypi.org/project/rasa-host
pip install rasa - host
Rasa-Host는 Rasa에 대한 종속성이 없으며(실제로 Rasa 패키지 종속성이 없음) 모든 버전에서 작동합니다.
from rasa_core . interpreter import RasaNLUInterpreter
from rasa_core . agent import Agent
interpreter = RasaNLUInterpreter ( 'models/current/nlu' )
agent = Agent . load ( "models/current/dialogue" , interpreter = interpreter )
from RasaHost import host
host . nlu_path = os . path . join ( current_dir , "data/nlu/" )
host . stories_path = os . path . join ( current_dir , "data/stories/" )
host . domain_path = os . path . join ( current_dir , "data/domain.yml" )
host . agent = agent
if __name__ == '__main__' :
host . run ()
# werkzeug - * Running on http://0.0.0.0:5005/ (Press CTRL+C to quit)
# GET http://localhost:5005/conversations/daniel/respond?q={{message}}
from RasaHost import host
host . nlu_path = os . path . join ( current_dir , "data/nlu/" )
if __name__ == '__main__' :
host . run ()
from RasaHost import host
host . stories_path = os . path . join ( current_dir , "data/stories/" )
if __name__ == '__main__' :
host . run ()
from RasaHost import host
host . domain_path = os . path . join ( current_dir , "data/domain.yml" )
if __name__ == '__main__' :
host . run ()
Rasa 테스트를 위한 채팅 인터페이스. 기본적으로 GET http://{{host}}/conversations/{{sender_id}}/respond?q={{message}}
from RasaHost import host
host . agent = agent
if __name__ == '__main__' :
host . run ()
대화는 SQLite에 저장됩니다.
from RasaHost import host
host . agent = agent
if __name__ == '__main__' :
host . run ()
로그는 SQLite에 저장됩니다.
from RasaHost import host
host . agent = agent
if __name__ == '__main__' :
host . run ()
의도, 스토리, 도메인을 분석합니다. 경고와 제안을 표시합니다.
from RasaHost import host
host . nlu_path = os . path . join ( current_dir , "data/nlu/" )
host . stories_path = os . path . join ( current_dir , "data/stories/" )
host . domain_path = os . path . join ( current_dir , "data/domain.yml" )
if __name__ == '__main__' :
host . run ()
메모이제이션 정책 데이터를 디코딩합니다.
from RasaHost import host
host . memoization_policy_path = os . path . join ( current_dir , "modelscurrentdialoguepolicy_1_MemoizationPolicy" )
if __name__ == '__main__' :
host . run ()
에이전트 유무에 관계없이 작업을 호스트할 수도 있습니다.
from rasa_core_sdk . executor import ActionExecutor
actionExecutor = ActionExecutor ()
actionExecutor . register_package ( 'actions' )
from RasaHost import host
host . actionExecutor = actionExecutor
if __name__ == '__main__' :
host . run ()
# werkzeug - * Running on http://0.0.0.0:5005/ (Press CTRL+C to quit)
# POST http://localhost:5005/actions
에이전트 및 사용자 지정 작업을 사용하여 앱을 실행하는 예입니다.
from rasa_core . interpreter import RasaNLUInterpreter
from rasa_core . agent import Agent
from rasa_core import utils , server
from rasa_core_sdk . executor import ActionExecutor
# #rasa-host.endpoints.yml
# action_endpoint:
# url: "http://localhost:5005/actions"
action_endpoint_conf = utils . read_endpoint_config ( "rasa-host.endpoints.yml" , endpoint_type = "action_endpoint" )
interpreter = RasaNLUInterpreter ( 'models/current/nlu' )
agent = Agent . load ( "models/current/dialogue" , interpreter = interpreter , action_endpoint = action_endpoint_conf )
actionExecutor = ActionExecutor ()
actionExecutor . register_package ( 'actions' )
from RasaHost import host
host . nlu_path = os . path . join ( current_dir , "data/nlu/" )
host . stories_path = os . path . join ( current_dir , "data/stories/" )
host . domain_path = os . path . join ( current_dir , "data/domain.yml" )
host . agent = agent
host . actionExecutor = actionExecutor
if __name__ == '__main__' :
host . run ()
# werkzeug - * Running on http://0.0.0.0:5005/ (Press CTRL+C to quit)
# GET http://localhost:5005/conversations/daniel/respond?q={{message}}
# POST http://localhost:5005/actions
채널을 지원합니다. 모든 대화가 기록됩니다.
from rasa_core . channels . botframework import BotFrameworkInput
input_channel = BotFrameworkInput (
app_id = "" ,
app_password = ""
)
from RasaHost import host
host . agent = agent
host . channels = [ input_channel ]
if __name__ == '__main__' :
host . run ()