pythonibm-cloudwatson-assistantibm-cloud-functionsboxsdk

Using BOX SDK from IBM Cloud Functions


I am trying to integrate my Watson Assistant to BOX. I tried to use boxsdk in my Cloud Function Action. But it gives me exception - No module named 'boxsdk'

Has anyone tried integrating BOX with Watson Assistant or tried using the API's in cloud functions? Is this possible?

It works fine if I try on my local deployment or using Online Python

Here's a simple code snippet -

import sys
import boxsdk

def main(dict):
    return { 'message': 'Hello world' }

Solution

  • You can do that.

    The standard Python runtimes for IBM Cloud Functions do not contain the Box SDK. It is possible to include your own choice of Python modules. In that case you have to use one of the documented methods to pack the function and required modules.

    I did something like this for my GitHub stats project. If you want to build a Docker-based Python runtime, I recommend taking a look at the offical Docker base for Python and Cloud Functions.