IBM Watson connection not using server - node.js

Are there any way we can connect IBM Watson assistant without using node.js
to run the server?
Can I connect it like Firebase?

You can use the Watson Node SDK to connect with the Watson Assistant API directly from your React application, without the need for another server. This example shows you how to connect a service in the context of a client-side application.
That example includes a server, just so that a user can run that example on their own. It is not required - you can import and instantiate the Watson Assistant SDK in your React code as long as watson-developer-cloud is installed in your project dependencies.
Other links you may find helpful:
- Generic example for using Assistant
- Documentation for the Watson Assistant API, including Node request examples

Related

NodeJs Unable to detect a Project Id in the current environment Pubsub

We are implementing the PubSub Using Client Libraries on for publish data using Linux and NodeJs. Also followed all steps of Quickstart: Using Client Libraries .
But we are getting the below error while publish the data
Received error while publishing: Unable to detect a Project Id in the current environment.
To learn more about authentication and Google APIs, visit:
https://cloud.google.com/docs/authentication/getting-started
Thanks for your help in advance !!

Chatbot using Api.ai nodejs angular socket.io

I have been using api.ai javascript SDK on angular to build my chat app to integrate it with the website. As this javascript sfk is deprecated I am now exploring to build the same on Node JS SDK with socket.io for real-time experience and angular for client features...
Currently, I'm following the below link to build my chat app
https://codingblast.com/chat-application-angular-socket-io/
As I am very new to Node I have lots of doubt like...
How to deploy my node and angular app on a server to host it on my website
Angular and node can it be deployed as a simple app.. if so what are the steps and how could I achieve it.
Is node is possible ti have multi threading as many users might chat with my chatbot in parallel before on angular it will be acheived by session id.. but how it is possible on the node?
Is it fine to deploy my node app on my existing apache server or should I use separate server
How can I host multiple node js chat app on a single server since each app will use a port... how much it is possible...
Which server is recommended for node deployment windows ubuntu or Linux.
Please help me...
Angular Apps are static files that can be served using any server. For NodeJS, you will need a server that supports NodeJS runtime execution environment. A simple cloud server will do. (AWS or others that you may prefer)
Angular runs on the client-side, NodeJS runs on the server-side, there is no "Simple App Deployment" (as far as I've known). You need to run the NodeJS server code which will server the REST API, and send the Angular deployment files to the client with some file server. (Even the NodeJS server can do it)
"Node.js is a single threaded language which in background uses multiple threads to execute asynchronous code" [Source]
But you can use "fork" to run parallel tasks. For chatbot, you may consider using WebSockets.
It is possible to run NodeJS with Apache server, but how you want to deploy it depends on your decision and architecture. See HERE for more information.
Link in no. 4 should have answer this this.
NodeJS can be deployed on both Windows and Linux(Ubuntu) environment. It depends on how much you can spend, and how much benefit that expenditure will bring you. (Linux server operating systems are totally free, Windows servers aren't)

possibility of using NodeJs server-side codes in mobile application?

Is that possible to use NodeJs server-side codes in react native,ionic,cordova or native script for mobile applications?
Question update:
I want to use NodeJs package and include NodeJs package into mobile application (native script , ionic , cordova or react native). for example include instagram-private-api into native script : NodeJs Private instagram API
{N} !== Browser / NodeJS.
It's a pure JS runtime, any apis specific to these platforms won't work within {N}. Though nativescript-nodeify plugin on-boards very limited NodeJS apis by translating them to their native equivalents.
I've been using many node.js APIs (including google/baidu/bing/wikipedia) inside my cordova App, here's what I did:
Install node.js / express / socket.io in your linux server.
Use socket.io inside your Cordova app to create 'many clients to one server' connections between your app and the node.js/socket.io server. In https://socket.io there is a simple example teaching you how to do that.
In Cordova App, use something like socket.emit('FromClientToServerCallAPI', data) to call an api.
In node.js server, define a function:
socket.on('FromClientToServerCallAPI', data)
and inside this function, call your api, and after you got the result from the api provider, run:
socket.emit('FromServerToClientAPIResult', result)
In your Cordova App, define a function:
socket.on('FromServerToClientAPIResult', result)
then do somthing with 'result'
pls. note that all the functions above are async.
Never try to call the api directly in your client codes, Some api provider requires you to apply for the api service and give you a 'key' to use the api, you don't want to put this 'key' inside your javacript and disclose it to all your users of the App, right?
Yes, it is possible with nodejs-mobile. It lets you run a full-blown Node.js engine inside a mobile application. It works on Android and iOS. There are other solutions that work on Android but as far as I know nodejs-mobile is currently the only one that also supports iOS. It also comes with plugins for React Native and Cordova.
More information, including documentation, is available on the project website.
(Full disclosure: I work for the company that develops nodejs-mobile.)

Updates to Watson Node.js SDK for Conversation Service

I am waiting for the IBM Watson Conversation updates to the Node.js API to add/update entities and workspaces. I see this https://www.ibm.com/watson/developercloud/conversation/api/v1/#create_value , but it has been saying "Coming soon" for a few months now. Any ETA on the npm package support ?
I had a similar issue, only for Python and my watson-conversation-tool project. The Watson Node SDK has already been updated and you can use the API to manage entities and workspaces.
The Node.js API for Watson Conversation: https://github.com/watson-developer-cloud/node-sdk/blob/master/conversation/v1.js

IBM Watson Visual Recognition return empty result in Java android?

Hi i'm reading all the sources that provides help to using the service however i have this line of debug says :
I/CredentialUtils: JNDI string lookups is not available.
compile with
compile 'com.ibm.watson.developer_cloud:java-sdk:3.0.1'
VisualRecognition service = new VisualRecognition(VisualRecognition.VERSION_DATE_2016_05_19);
service.setApiKey("<api_key>");
ClassifyImagesOptions options = new ClassifyImagesOptions.Builder().images(currentSelectFileLocation).build();
VisualClassification result = service.classify(options).execute();
System.out.println(result);
the error you're getting does not come from the IBM Watson Visual Recognition Bluemix service, but from the Watson Java SDK library you're using.
see
https://github.com/watson-developer-cloud/java-sdk/search?utf8=%E2%9C%93&q=javax.naming
When you deploy some java code inside bluemix, in a liberty container, it can use JNDI to get the service credentials from inside bluemix. But when you run from outside bluemix, of course, you must provide the credentials (in your case, in your android app) in order to access the service.
It seems that for some reason your android app is importing javax.naming.Context and then the SDK is getting a little bit confusing.
You have these options here IMO
remove the javax.naming.Context from your android project
download and recompile the SDK code to fix that
Notice that providing your credentials in the android app is probably not a good idea, so I'd suggest you to take a different path here. Create a RESTful web service at Bluemix that wraps the calls to the Watson service. Of course, you may want to secure this access, because every call to the Watson service will be billed in your bluemix account.

Resources