Update main_app.py
Browse files- main_app.py +5 -5
main_app.py
CHANGED
@@ -117,7 +117,7 @@ def _(client_instantiation_form, os):
|
|
117 |
space_id = None
|
118 |
wx_api_key = None
|
119 |
wx_url = None
|
120 |
-
|
121 |
return client_setup, project_id, space_id, wx_api_key, wx_url
|
122 |
|
123 |
|
@@ -223,7 +223,7 @@ def _(
|
|
223 |
deployment_client = None
|
224 |
task_credentials_details = None
|
225 |
client = None
|
226 |
-
|
227 |
return client, deployment_client, project_client
|
228 |
|
229 |
|
@@ -277,7 +277,7 @@ def _(mo, variant_selectors_list):
|
|
277 |
def _(cloudant, cloudant_db, template_variant):
|
278 |
fallback_template = {
|
279 |
"function_name": "deployable_function",
|
280 |
-
"function_code":
|
281 |
def score(input_data):
|
282 |
original_string = input_data.get("input_data")[0].get("values")[0][0]
|
283 |
append_string = input_data.get("input_data")[0].get("values")[0][1]
|
@@ -291,7 +291,7 @@ def _(cloudant, cloudant_db, template_variant):
|
|
291 |
}]
|
292 |
}
|
293 |
return score_response
|
294 |
-
return score
|
295 |
"use_cases": ["add_tags"],
|
296 |
"input_schema": [
|
297 |
{
|
@@ -707,7 +707,7 @@ def _(template):
|
|
707 |
dependency_pack_name = template["function_name"] + "_dependencies"
|
708 |
# After the yaml_template definition, add:
|
709 |
yaml_templates[dependency_pack_name] = yaml_template
|
710 |
-
|
711 |
return (yaml_templates, dependency_pack_name)
|
712 |
|
713 |
|
|
|
117 |
space_id = None
|
118 |
wx_api_key = None
|
119 |
wx_url = None
|
120 |
+
|
121 |
return client_setup, project_id, space_id, wx_api_key, wx_url
|
122 |
|
123 |
|
|
|
223 |
deployment_client = None
|
224 |
task_credentials_details = None
|
225 |
client = None
|
226 |
+
|
227 |
return client, deployment_client, project_client
|
228 |
|
229 |
|
|
|
277 |
def _(cloudant, cloudant_db, template_variant):
|
278 |
fallback_template = {
|
279 |
"function_name": "deployable_function",
|
280 |
+
"function_code": """def your_function_name():
|
281 |
def score(input_data):
|
282 |
original_string = input_data.get("input_data")[0].get("values")[0][0]
|
283 |
append_string = input_data.get("input_data")[0].get("values")[0][1]
|
|
|
291 |
}]
|
292 |
}
|
293 |
return score_response
|
294 |
+
return score""",
|
295 |
"use_cases": ["add_tags"],
|
296 |
"input_schema": [
|
297 |
{
|
|
|
707 |
dependency_pack_name = template["function_name"] + "_dependencies"
|
708 |
# After the yaml_template definition, add:
|
709 |
yaml_templates[dependency_pack_name] = yaml_template
|
710 |
+
|
711 |
return (yaml_templates, dependency_pack_name)
|
712 |
|
713 |
|