{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# You can use other public modules via our Client object with module's identifier\n",
    "# and parameters.\n",
    "# For more detailes, please see our online document - https://momodel.github.io/docs/#\n",
    "import os\n",
    "import sys\n",
    "# Define root path\n",
    "sys.path.append('../')\n",
    "# Import necessary packages\n",
    "from modules import json_parser\n",
    "from modules import Client\n",
    "# Initialise Client object\n",
    "client = Client(api_key='996c5ec910a35bc0813ba5f12f4ba667ba10af41ecd4c9dd0ff9aa5cbfc0439a',\n",
    "                project_id='5cd04ee51afd94639a492b8e', user_ID='5ca1c6991afd941dd93a4052',\n",
    "                project_type='app', source_file_path='Untitled.ipynb')\n",
    "# Make run/train/predict command alias for further use\n",
    "run = client.run\n",
    "train = client.train\n",
    "predict = client.predict\n",
    "# Make controller alias for further use\n",
    "controller = client.controller\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def handle(conf): \n",
    "    \"\"\"\n",
    "    该方法是部署之后，其他人调用你的服务时候的处理方法。\n",
    "    请按规范填写参数结构，这样我们就能替你自动生成配置文件，方便其他人的调用。\n",
    "    范例：\n",
    "    params['key'] = value # value_type: str # description: some description\n",
    "    参数请放到params字典中，我们会自动解析该变量。\n",
    "    \"\"\"\n",
    "    \n",
    "    param1 = conf['param1']  # value_type: str # description: some description\n",
    "    param2 = conf['param2']  # value_type: str # description: some description\n",
    "    # add your code\n",
    "    return {'ret1': 'cat', 'ret2': 'dog'}\n",
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
