Update fallback_template.py
Browse files- fallback_template.py +63 -52
fallback_template.py
CHANGED
|
@@ -1,54 +1,65 @@
|
|
| 1 |
fallback_template = {
|
| 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 |
}
|
|
|
|
| 1 |
fallback_template = {
|
| 2 |
+
"id": "7bcc0723c4dca96f0a25a8babdb13a05",
|
| 3 |
+
"key": "7bcc0723c4dca96f0a25a8babdb13a05",
|
| 4 |
+
"value": {
|
| 5 |
+
"rev": "2-6b19a5f38c311dfe11977294434d5cdf"
|
| 6 |
+
},
|
| 7 |
+
"doc": {
|
| 8 |
+
"_id": "7bcc0723c4dca96f0a25a8babdb13a05",
|
| 9 |
+
"_rev": "2-6b19a5f38c311dfe11977294434d5cdf",
|
| 10 |
+
"filename": "deployable_function_your_function_name.py",
|
| 11 |
+
"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()",
|
| 12 |
+
"score_assignment": "score = your_function_name()",
|
| 13 |
+
"input_schema": [
|
| 14 |
+
{
|
| 15 |
+
"id": "1",
|
| 16 |
+
"type": "struct",
|
| 17 |
+
"fields": [
|
| 18 |
+
{
|
| 19 |
+
"name": "response_message_field",
|
| 20 |
+
"type": "string",
|
| 21 |
+
"nullable": False,
|
| 22 |
+
"metadata": {}
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"name": "random_appended_string",
|
| 26 |
+
"type": "string",
|
| 27 |
+
"nullable": False,
|
| 28 |
+
"metadata": {}
|
| 29 |
+
}
|
| 30 |
+
]
|
| 31 |
+
}
|
| 32 |
+
],
|
| 33 |
+
"output_schema": [
|
| 34 |
+
{
|
| 35 |
+
"id": "1",
|
| 36 |
+
"type": "struct",
|
| 37 |
+
"fields": [
|
| 38 |
+
{
|
| 39 |
+
"name": "hello_world_message",
|
| 40 |
+
"type": "string",
|
| 41 |
+
"nullable": False,
|
| 42 |
+
"metadata": {}
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"name": "concatenated_string",
|
| 46 |
+
"type": "string",
|
| 47 |
+
"nullable": False,
|
| 48 |
+
"metadata": {}
|
| 49 |
+
}
|
| 50 |
+
]
|
| 51 |
+
}
|
| 52 |
+
],
|
| 53 |
+
"dependencies": [
|
| 54 |
+
"<library_to_add>",
|
| 55 |
+
"<library_to_add>"
|
| 56 |
+
],
|
| 57 |
+
"function_name": "your_function_name",
|
| 58 |
+
"category": "base_template",
|
| 59 |
+
"prompt_template": "{text}",
|
| 60 |
+
"use_cases": [
|
| 61 |
+
"add_tags"
|
| 62 |
+
],
|
| 63 |
+
"type": "wx.ai Deployable Python Function"
|
| 64 |
+
}
|
| 65 |
}
|