File size: 1,913 Bytes
87d2a55
5aecae9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83deff3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
fallback_template = {
 "id": "7bcc0723c4dca96f0a25a8babdb13a05",
 "key": "7bcc0723c4dca96f0a25a8babdb13a05",
 "value": {
  "rev": "2-6b19a5f38c311dfe11977294434d5cdf"
 },
 "doc": {
  "_id": "7bcc0723c4dca96f0a25a8babdb13a05",
  "_rev": "2-6b19a5f38c311dfe11977294434d5cdf",
  "filename": "deployable_function_your_function_name.py",
  "text": "def your_function_name():\n def score(input_data):\n original_string = input_data.get(\"input_data\")[0].get(\"values\")[0][0]\n append_string = input_data.get(\"input_data\")[0].get(\"values\")[0][1]\n \n hello_world_message = \"Hello World + {0}\".format(original_string)\n concatenated_string = original_string + append_string\n \n score_response = {\n 'predictions': [{'fields': ['response_message_field', 'random_appended_string'],\n 'values': [[hello_world_message, concatenated_string]]\n }]\n }\n return score_response\n return score\n score = your_function_name()",
  "score_assignment": "score = your_function_name()",
  "input_schema": [
   {
    "id": "1",
    "type": "struct",
    "fields": [
     {
      "name": "response_message_field",
      "type": "string",
      "nullable": False,
      "metadata": {}
     },
     {
      "name": "random_appended_string",
      "type": "string",
      "nullable": False,
      "metadata": {}
     }
    ]
   }
  ],
  "output_schema": [
   {
    "id": "1",
    "type": "struct",
    "fields": [
     {
      "name": "hello_world_message",
      "type": "string",
      "nullable": False,
      "metadata": {}
     },
     {
      "name": "concatenated_string",
      "type": "string",
      "nullable": False,
      "metadata": {}
     }
    ]
   }
  ],
  "dependencies": [
   "<library_to_add>",
   "<library_to_add>"
  ],
  "function_name": "your_function_name",
  "category": "base_template",
  "prompt_template": "{text}",
  "use_cases": [
   "add_tags"
  ],
  "type": "wx.ai Deployable Python Function"
 }
}