wiki.ziemers.de

ziemer's informatik Wiki

Benutzer-Werkzeuge

Webseiten-Werkzeuge


wiki:software:beuthbot:gateway

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
wiki:software:beuthbot:gateway [13.12.2019 10:20]
Christopher Lehmann
wiki:software:beuthbot:gateway [24.01.2020 15:18] (aktuell)
Tolga Karaoglu [Overview]
Zeile 40: Zeile 40:
  
 [//Appendum:// We decided to establish the server using [[https://nodejs.org/en/|node.js]]. That's why an installation of node and npm is necessary.] [//Appendum:// We decided to establish the server using [[https://nodejs.org/en/|node.js]]. That's why an installation of node and npm is necessary.]
 +
 +
  
 === Telegram Bot === === Telegram Bot ===
Zeile 59: Zeile 61:
 During the implementation of the **gateway** we used [[https://www.sohamkamani.com/blog/2016/09/21/making-a-telegram-bot/|this manual]] as a kind of orientation. During the implementation of the **gateway** we used [[https://www.sohamkamani.com/blog/2016/09/21/making-a-telegram-bot/|this manual]] as a kind of orientation.
  
 +
 +<WRAP pagebreak></WRAP>
 ==== Overview ==== ==== Overview ====
  
Zeile 100: Zeile 104:
 </uml> </uml>
  
 +This class diagram shows the structure around the gateway. Here it is important that there is a StandardizationLayer beforehand, which standsardize the incoming messages. The gateway then directs the message to an NLU service where we get the evaluated object back and compare the scores. The best evaluated message is then forwarded to the registry.
 ==== Functionalities ==== ==== Functionalities ====
  
 === Variables === === Variables ===
  
-<code>+The defined variables are based on ''express'', ''body-parser'' and ''axios'': 
 + 
 +<code javascript>
 var express = require('express') var express = require('express')
 var app = express() var app = express()
Zeile 113: Zeile 120:
 === API-Call === === API-Call ===
  
-<code>+Each time our bot is mesaged in the chat, the message will be passed on to the gateway. This is mapped via ''cURL''. All incoming messages use the route ''\message-in''. If the message has no content, the response is empty. The code for the described behaviour looks as follows: 
 + 
 +<code javascript>
 app.post('/message-in', function(req, res) { // This is the route the API will call app.post('/message-in', function(req, res) { // This is the route the API will call
     const { message } = req.body     const { message } = req.body
Zeile 123: Zeile 132:
 === Microsoft Azure - Cognitive Services - Headers === === Microsoft Azure - Cognitive Services - Headers ===
  
-<code>+Microsot Azure predetermines its specific header that should be used for ''HTTP-POST''. The header looks like this: 
 + 
 +<code javascript>
     const options = {     const options = {
         headers: {         headers: {
Zeile 135: Zeile 146:
 === HTTP-POST === === HTTP-POST ===
  
-<code>+This section of code shows a request to the Azure service and generates a response which is sent directly to the bot. The code is shaded like this because Axios processes the messages asyncronous and we have to ensure a response has already been received. The following code snippet shows this more in detail: 
 + 
 +<code javascript>
     axios.post('https://northeurope.api.cognitive.microsoft.com/text/analytics/v2.1/sentiment', {     axios.post('https://northeurope.api.cognitive.microsoft.com/text/analytics/v2.1/sentiment', {
         "documents": [{         "documents": [{
Zeile 158: Zeile 171:
 === Server === === Server ===
  
-<code>+The server is listening on port ''3000'': 
 + 
 +<code javascript>
 // Finally, start our server // Finally, start our server
 app.listen(3000, function() { app.listen(3000, function() {
Zeile 167: Zeile 182:
 ==== Further Development ==== ==== Further Development ====
  
-- Adapter +In the short term, we are considering replacing Azure with Rasa to test the modular requirements. It is later considered that we will connect an NLU adapter that compares the two services and takes the best results.
-- Rasa Azure+
  
 ==== Further Reading ==== ==== Further Reading ====
Zeile 188: Zeile 202:
 ==== Versioning ==== ==== Versioning ====
  
-We use [[https://git.ziemers.de/|GitLab]] for versioning.+We use [[https://github.com/|GitHub]] for versioning.
  
 ==== Authors ==== ==== Authors ====
  
-- **Christopher Lehmann** - //Development// & //Documentation//\\+- **Christopher Lehmann** - //Development// & //Documentation// [[https://github.com/Chr1ssy|GitHub]]\\
 \\ \\
-- **Timo Bruns** - //Development//\\ +- **Timo Bruns** - //Development// [[https://github.com/Tarry93|GitHub]] \\\\ 
 +  
 +See also the list of [[https://github.com/beuthbot/gateway/graphs/contributors|contributors]] who participated in this project. 
 +<WRAP pagebreak></WRAP>
wiki/software/beuthbot/gateway.1576228837.txt.gz · Zuletzt geändert: 13.12.2019 10:20 von Christopher Lehmann