Code Monkey home page Code Monkey logo

Comments (16)

btotharye avatar btotharye commented on May 27, 2024 1

@rafaelariad I just basically modified https://github.com/paschmann/rasa-ui/blob/master/Dockerfile#L47 to include my rasa server address then did docker build -t rasa-ui . to build it and docker run -itd -p 5001:5001 rasa-ui to spin it up

from rasa-ui.

paschmann avatar paschmann commented on May 27, 2024

Hi @btotharye - could you check this: https://github.com/paschmann/rasa-ui/wiki/Using-Rasa-UI-as-Middleware and see if it solves your problem?

from rasa-ui.

btotharye avatar btotharye commented on May 27, 2024

Sure also is what I'm doing the right process to have this interact with a external Rasa server I already have setup? Sorry didn't know about that in the wiki I'll check it out.

Thanks

from rasa-ui.

paschmann avatar paschmann commented on May 27, 2024

Yes, what you are doing is correct. Are you able to use the Rasa UI? Are you able to use the sidebar chat dialog to interact with the Rasa NLU backend successfully?

from rasa-ui.

jr4c avatar jr4c commented on May 27, 2024

hey @btotharye i know that this is another question, but, can you share the coe that you use to change the rasanluendpioint and how you run the dockerfile (i have been trying doing this too)

from rasa-ui.

btotharye avatar btotharye commented on May 27, 2024

@paschmann just to make sure should the payload look like this after I have my token:

url = "http://192.168.99.100:5001/api/v2/rasa/parse"
question = 'hello'
headers = {
    'Accept': 'application/json',
    'Authorization': 'Bearer {}'.format(token)
    }
params = {"q": question, "project": "chatbot"}
r = requests.get(url, headers=headers, params=params)

This is how I do my other api calls but I'm still getting cannot get /api/v2/rasa/parse as the error atm. I can definitely see the redirect is happening cause I see the requests coming into my Rasa server.

from rasa-ui.

paschmann avatar paschmann commented on May 27, 2024

@btotharye - the method should be a POST, something like this:

var request = require("request");

var options = { method: 'POST',
  url: 'http://localhost:5001/api/v2/rasa/parse',
  headers: 
   { 'Postman-Token': 'fc7b3022-70c4-bdf8-5eff-425c0d7b55b1',
     'Cache-Control': 'no-cache',
     Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MjA0Nzk3NjJ9.nSCzx1V-bS_S77G8uICZgFJub_5q4sukByiq6f_sgY4',
     'Content-Type': 'application/json' },
  body: 
   { q: 'resturants in new york',
     project: 'Dining Out',
     model: 'model_20180307-131724' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

from rasa-ui.

btotharye avatar btotharye commented on May 27, 2024

Ok sorry getting closer what does this mean?

{'message': {'data': {'type': 'undefined'},
  'errorcode': 'EKEYTYPE',
  'message': 'The key argument has to be of type `string` or `number`. Found: `undefined`',
  'name': 'EKEYTYPE'},
 'status': 'error'}

I wasn't sure if I had to send it the actual model or if just the project is enough and in this case the project is the Project in Rasa UI or my project in my Rasa server?

from rasa-ui.

paschmann avatar paschmann commented on May 27, 2024

I am not entirely sure to be honest - not a very descriptive error ...

You would need to send the project name on the Rasa Server.

from rasa-ui.

btotharye avatar btotharye commented on May 27, 2024

interesting thats what I'm doing but its failing I tried inside postman and this is the response back:

{
    "status": "error",
    "message": {
        "expose": true,
        "statusCode": 400,
        "status": 400,
        "body": "{ q: 'hello',\r\nproject: 'Cisco Chatbot',\r\nmodel: 'chatbot*model_20180326-185644' },\r\njson: true };",
        "type": "entity.parse.failed"
    }
}

I'll have to keep messing around to figure out what is up

from rasa-ui.

paschmann avatar paschmann commented on May 27, 2024

Could you check if you have a Agent in Rasa UI called "Cisco Chatbot"?

from rasa-ui.

paschmann avatar paschmann commented on May 27, 2024

Lets also move the conversation here: https://gitter.im/rasa-ui/Lobby

from rasa-ui.

btotharye avatar btotharye commented on May 27, 2024

I created it manually wasn't sure if that had to be there or not, I already have on my rasa server a model trained called chatbot which is what I'm trying to proxy this stuff to. All I did so far was modify the https://github.com/paschmann/rasa-ui/blob/master/Dockerfile#L47 to be my ip address of my rasa server and spun it up, wasn't sure if there were other steps required or not.

from rasa-ui.

pradeepmvn avatar pradeepmvn commented on May 27, 2024

@btotharye Rasa UI needs to have Agent information in its database. There is logging and webhook information tied to an agent that gets pulled for every request. There are multiple ways you can get to it

  • Either manually create an agent and start adding intents, entities, utterance details.
  • or by uploading an existing rasa_nlu domain data in JSON format

The later one would be more suitable in your case since you already have domain data from nlu. Also remember that Project name in NLU servers should be same as the Agent name in Rasa-ui.

from rasa-ui.

btotharye avatar btotharye commented on May 27, 2024

I was working with @paschmann on this in gitter it actually appears to be an issue with https://github.com/paschmann/rasa-ui/blob/master/server/routes/middleware.js#L43 through 45 because once I commented that out everything started working the way it should with my remote NLU server I already have setup.

I'm gonna work on it a bit and see if I can see what is causing all the issues.

from rasa-ui.

btotharye avatar btotharye commented on May 27, 2024

actually it wasn't a bug after all in those lines I just tested now and its working I think part of it was how I was issuing the output so for documentation purposes this is how I have it working:

url = "http://192.168.99.100:5001/api/v2/rasa/parse"
question = "hello"
payload = "q={}&project=chatbot".format(question)
headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Bearer {}'.format(token)
    }
r = requests.post(url, data=payload, headers=headers)
response.json()

which now works properly and proxies to my Rasa server and gives me back the results:

{'entities': [{'confidence': 0.7423392842897176,
   'end': 5,
   'entity': 'serial',
   'extractor': 'ner_crf',
   'start': 0,
   'value': 'hello'}],
 'intent': {'confidence': 0.5612418049086964, 'name': 'greet'},
 'intent_ranking': [{'confidence': 0.5612418049086964, 'name': 'greet'},
  {'confidence': 0.12778262542564556, 'name': 'goodbye'},
  {'confidence': 0.12426149548459074, 'name': 'affirm'},
  {'confidence': 0.06779630706788278, 'name': 'cisco_serial'},
  {'confidence': 0.06100715539325644, 'name': 'about'},
  {'confidence': 0.05791061171992811, 'name': 'help'}],
 'text': 'hello'}

So sorry for the issue seems it was just how I was making the call and I didn't realize the project needed to be equal to my agent name.

Thanks again

from rasa-ui.

Related Issues (20)

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.