File size: 1,703 Bytes
87d2a55
83deff3
 
87d2a55
 
 
 
 
 
 
 
 
 
 
 
 
 
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
fallback_template = {
    "function_name": "deployable_function",
    "function_code": """def your_function_name():
    def score(input_data):
        original_string = input_data.get("input_data")[0].get("values")[0][0]
        append_string = input_data.get("input_data")[0].get("values")[0][1]
        
        hello_world_message = "Hello World + {0}".format(original_string)
        concatenated_string = original_string + append_string
        
        score_response = {
            'predictions': [{'fields': ['Response_message_field', 'Random_appended_string'],
                            'values': [[hello_world_message, concatenated_string]]
                            }]
        }
        return score_response
    return score""",
    "use_cases": ["add_tags"],
    "input_schema": [
        {
            "id": "1",
            "type": "struct",
            "fields": [
                {
                    "name": "<variable name 1>",
                    "type": "string",
                    "nullable": False,
                    "metadata": {},
                },
                {
                    "name": "<variable name 2>",
                    "type": "string",
                    "nullable": False,
                    "metadata": {},
                },
            ],
        }
    ],
    "output_schema": [
        {
            "id": "1",
            "type": "struct",
            "fields": [
                {
                    "name": "<output return name>",
                    "type": "string",
                    "nullable": False,
                    "metadata": {},
                }
            ],
        }
    ],
    "dependencies": ["<library_to_add>"],
}