Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about README (minor error) and documentation update proposal #2

Open
solyarisoftware opened this issue Jul 22, 2021 · 0 comments
Open
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@solyarisoftware
Copy link

solyarisoftware commented Jul 22, 2021

Hi,
To maintain topic coherence I'm moving in this new "issue" (just a proposal/note indeed).

In general, a README with a full running example could help users.

You could also just supply a domain.yml and a README.md in the directory of your example examples/http: https://github.com/Lykos94/rasa-node-action-server/tree/master/examples/http

# file: domain.yml 
version: "2.0"

config:
  store_entities_as_slots: true

session_config:
  session_expiration_time: 60  # value in minutes
  carry_over_slots_to_new_session: true

nlu:

- intent: greet
  examples: |
    - Hi
    - Hey!
    - Hallo
    - Good day
    - Good morning

- intent: bye
  examples: |
    - Bye

- intent: ask_weather
  examples: |
    - what's the weather
    - what's the weather in [Genoa](city)
    - i want to know the [milan](city) weather of today
    - i want to know the weather of today
    - tell me the [Vienna](city) weather forecast
    - hows the weather today

- intent: city_inform
  examples: |
    - milan
    - Genoa
    - rome
    - Berlin
    - Vienna
    - Turin
    - Naples
    - london
    - new york
    - Dar Es Salaam
    - Nairobi
    - Mogadishu

intents:
  - greet
  -  bye
  - ask_weather
  - city_inform
  
entities:
  - city

slots:
  city:
    type: text
    influence_conversation: true

responses:
  utter_greet:
    - text: "Hey there!"
  utter_bye:
    - text: "Bye!"
  utter_ask_city:
    - text: "which city you want to check for?"  
    - text: "which city?"
    - text: "please tell me which city"
    - text: "where? In which city?"
  utter_default:
    - text: "Sorry, I didn't get that, can you rephrase?"

actions:
  - weather_city_today_action

stories:

 # the entity city is specified in the intent  ask_weather
 - story: 1. greet and weather with city specified
   steps:
   - intent: greet
   - action: utter_greet
   - intent: ask_weather
   - action: weather_city_today_action
   - action: utter_bye 

 # the entity city is specified in the intent ask_weather
 - story: 2. greet and weather with city NOT specified
   steps:
   - intent: greet
   - action: utter_greet
   - intent: ask_weather
  - slot_was_set:
    - city: None
   - utter_ask_city
   - city_inform
   - action: weather_city_today_action
   - action: utter_bye
# file: test_stories.yml
stories:
  - story: 1. greet and weather with city specified
   steps:
    - user: |
        hey
    - action: utter_greet
    - user: |
        what's the weather in Milan?
    - action: weather_city_today_action
    - action: utter_bye
    
 - story: 2. greet and weather with city NOT specified
   steps:
    - user: |
        hey
    - action: utter_greet
    - user: |
        what's the weather?
    - utter_ask_city
    - user: |
        Genoa
    - action: weather_city_today_action
    - action: utter_bye
    

Please double check if syntax of the above example is formally correct and it make sense.


BTW, in the README.md paragraph https://github.com/Lykos94/rasa-node-action-server#rasa-custom-connectors, you state:


You can then test your server by running:

curl -XPOST http://localhost:5005/webhooks/rnc/webhook \
  -H "Content-type: application/json" \
  -d '{"sender": "lykos94",  "message": "Hello bot", "metadata":{}}'

response:

[{"recipient_id":"lykos94","text":"Hello world, from your action server"}]

But
To test the action server example here: https://github.com/Lykos94/rasa-node-action-server/tree/master/examples/http:
I do believe that the POST request can not produce the response you mentioned.
Instead maybe you want something like this:

curl -XPOST http://localhost:5005/webhooks/rnc/webhook \
  -H "Content-type: application/json" \
  -d '{"sender": "lykos94",  "message": "/ask_weather{\“city\”:\“Vienna\”}"}'

In general I'd suggest to write down in README a step-by-step sequence of cli commands.

Thanks for your patience

@lukaszmoskwa lukaszmoskwa added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 22, 2021
@solyarisoftware solyarisoftware changed the title about README and documentation about README (minor error) and documentation update proposal Jul 22, 2021
@lukaszmoskwa lukaszmoskwa self-assigned this Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants