Rasa chatbot : Retrieving conversation data - python-3.x

I am trying to build a chatbot using RASA. For now, I am running my chatbot locally on a Ubuntu shell. I'd like to be able to retrieve my conversation data ; from RASA's documentation, it seems to be possible, but the documentation only addresses the case when the bot is running on a http server : link

You can add a Mongo or Redis tracker store which stores all the conversations data in a database. Do so by adding a section like this to your endpoint configuration:
tracker_store:
store_type: mongod
url: <url to your mongo instance, e.g. mongodb://localhost:27017>
db: <name of the db within your mongo instance, e.g. rasa>
username: <username used for authentication>
password: <password used for authentication>
Then specify this file with --endpoints when you run Rasa Core, e.g.
python -m rasa_core.run -d models --endpoints endpoints.yml
The alternative would be to run Rasa Core with the exposed Rest API, e.g.
python -m rasa_core.run -d models --enable-api
Then you can access the conversations with HTTP requests as documented here, e.g.:
curl --request GET \
--url http://localhost:5005/conversations/<sender_id>/tracker

Related

Updating a file for a quick-pull using github cli

Currently in the github UI, a user can edit a file and create a new branch in a single action. This can also be done through the github api using something like this:
curl 'https://github.com/<my_org>/<my_repo>/tree-save/master/<path_to_file>' \
-H 'content-type: application/x-www-form-urlencoded' \
--data-raw 'authenticity_token=<generated_token>&filename=<filename>&new_filename=<filename>&content_changed=true&value=<new_contents_of_file>&message=Updated+file+in+my+repo&placeholder_message=Update+<filename>&description=&commit-choice=quick-pull&target_branch=<new_branch_name>&quick_pull=master&guidance_task=&commit=<target_commit_checksum>&same_repo=1&pr='
What I would like to be able to do, is perform the same action using the github cli* (gh). I have tried using the following commands:
gh api <my_org>/<my_repo>/tree-save/master/<path_to_file> -F "filename=<filename>" -F ...
and
gh api repos/<my_org>/<my_repo>/contents/<path_to_file> -F "filename=<filename>" -F ...
For both cases (and many variations on these options), I'm getting a 404** back. Any ideas what I'm doing wrong? Does the github cli even allow the functionality allowed in the above curl?
* For those curious, I want to use the CLI because of how it handles auth and it's statelessness. I can't generate a token to use, like in the curl above. And, due to multiple issues, I also can't clone the repo locally.
** I'm able to retrieve the file just fine using the simple GET command (the second command above without the '-F' flags)
After reading documentation, and then verifying by altering credentials, it appears to be a permissions issue. Evidently, for security reasons, if a token is used that does not meet the required permissions, a 404 is returned instead of a 403.
Interesting that I can still use the curl above through the browser. So, now i need to figure out why the gh cli token does not have the same permissions as my user.

How do I verify the version of RSK running on a node?

I have RPC access to a private deployment of an RSK node,
but no direct access to the file system.
How can I check what version of the RSK node is running on that system?
Without direct access to the file system,
you cannot verify the version of RSKj (the RSK node implementation)
that is running on that machine.
However, you can check the version that it claims to be running,
using an RPC request: web3_clientVersion.
For example, using the public public node:
curl \
-X POST \
-H "Content-Type:application/json" \
--data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' \
https://public-node.rsk.co/
(replace https://public-node.rsk.co/ with the
RPC endpoint URL of your target deployment.)
This should output the following:
{"jsonrpc":"2.0","id":1,"result":"RskJ/3.0.0/Linux/Java1.8/IRIS-ba01ea2"}
You can then view RSKj's tagged releases on the RSKj github repo.
For example, the above output corresponds to
https://github.com/rsksmart/rskj/releases/tag/IRIS-3.0.0
Note that if you see the following output:
{"jsonrpc":"2.0","id":1,"result":"RskJ/2.2.0/Linux/Java1.8/PAPYRUS-dev"}
That means you are still running an older version of the RSK node,
and prior to the Iris consensus changes,
and you should upgrade to the latest version and re-sync your blocks!

MLflow - Serving model by reference to model registry

I'm having an issue to serve a model with reference to model registry. According to help, the path should look like this:
models:/model_name/stage
When I type in terminal:
mlflow models serve -m models:/ml_test_model1/Staging --no-conda -h 0.0.0.0 -p 5003
I got the error:
mlflow.exceptions.MlflowException: Not a proper models:/ URI: models:/ml_test_model1/Staging/MLmodel. Models URIs must be of the form 'models:/<model_name>/<version or stage>'.
Model is registered and visible in db and server.
If I put absolute path, it works (experiment_id/run_id/artifacts/model_name).
mlflow version: 1.4
Python version: 3.7.3
Is it matter of some environmental settings or something different?
That style of referencing model artefacts is fixed from mlflow v1.5 (Bug Fix).
You'll need to run mlflow db upgrade <db uri> to refresh your schemas before restarting your mlflow server.
You may find listing registered models helpful:
<server>:<port>/api/2.0/preview/mlflow/registered-models/list
setting the env solved this for me:
export MLFLOW_TRACKING_URI=http://localhost:5000
mlflow models serve models:/my_clf_model/Staging -p 1234 -h 0.0.0.0 --no-conda

IBM Object Storage-How to make a File or a Container public accesible one?

I have uploaded a file from local to the IBM Storage container using Node js
In the response I have got the baseResourceUrl (https://dal.objectstorage.open.softlayer.com:443/v1/AUTH_bf7
d89eb565f4c638d7b6f7b15e73538/testContainer/test.png)
The URL is not accesible in the browser.It says Unauthorized
In my usecase I need to access publicly anywhere.Is that possible? If possible how to give public access to files.
I am new to IBM Bluemix environment and Object Storage service.Kindly share some solutions
After uploading the file you'll need to modify the ACLs. You'll end up creating a Read ACL for the container: testContainer.
I was able to test this using the Swift CLI, however you can use the curl examples to figure out what you'll need to write using Node.
Swift Example (assumes you have ENV variables exported):
swift post testContainer --read-acl ".r:*,.rlistings"
Curl with AUTH_TOKEN:
$ curl -X PUT -i \
> -H "X-Auth-Token: AUTH_TOKEN" \
> -H "X-Container-Read: .r:*,.rlistings" \
> https://dal.objectstorage.open.softlayer.com/v1/AUTH_bf7d89eb565f4c638d7b6f7b15e73538/testContainer
https://www.swiftstack.com/docs/cookbooks/swift_usage/container_acl.html#setting-container-read-acl
If we go back to the swift client we can view the current ACLs in place:
swift stat -v testContainer
Which will return data about the container:
Read ACL: .r:*,.rlistings
Write ACL:

How to get reports of a puppet node using puppetdb api?

How do I get reports from a puppet node using puppetdb report api?
After playing around with the query parameters, it seems like following will do the work:
curl -X GET puppet.foo.com:8180/pdb/query/v4/reports -d 'limit=1' -d 'query=["=", "certname", "node.foo.com"]'

Resources