Update process_data.py
Browse files- process_data.py +3 -8
process_data.py
CHANGED
|
@@ -202,10 +202,10 @@ def generate_json_pieces(specification, model_version, additional_json_creation_
|
|
| 202 |
def pre_processing(input_data, parameters):
|
| 203 |
# in the event there's a pre-prompt, process
|
| 204 |
|
| 205 |
-
if
|
| 206 |
|
| 207 |
input_text = input_data["input_text"]
|
| 208 |
-
pre_processing_list = [
|
| 209 |
|
| 210 |
for pre_prompt in pre_processing_list:
|
| 211 |
|
|
@@ -231,7 +231,7 @@ def pre_processing(input_data, parameters):
|
|
| 231 |
input_data["input_text"] = input_text
|
| 232 |
return input_data
|
| 233 |
else:
|
| 234 |
-
input_context = f"You are processing farm activity, interactions, and trial data. Here's important context of the data {
|
| 235 |
input_data["input_context"] = input_context
|
| 236 |
return input_data
|
| 237 |
|
|
@@ -281,11 +281,6 @@ def parse_survey_stack_parameters(data):
|
|
| 281 |
try:
|
| 282 |
|
| 283 |
pre_promp_parameters = data[0]['data']['group_2']
|
| 284 |
-
print("PREPROMPT PARAMETERS")
|
| 285 |
-
print(pre_promp_parameters)
|
| 286 |
-
|
| 287 |
-
print("PREPROMPT PREPROMPT")
|
| 288 |
-
print(pre_promp_parameters['preprompt'])
|
| 289 |
|
| 290 |
if pre_promp_parameters['preprompt']['value'][0] == 'continue_preprompts':
|
| 291 |
processed_data["pre_prompt"] = True
|
|
|
|
| 202 |
def pre_processing(input_data, parameters):
|
| 203 |
# in the event there's a pre-prompt, process
|
| 204 |
|
| 205 |
+
if parameters["chaining"]:
|
| 206 |
|
| 207 |
input_text = input_data["input_text"]
|
| 208 |
+
pre_processing_list = [parameters["context_pre_prompt"], parameters["summary_pre_prompt"], parameters["conversation_pre_prompt"], parameters["example_pre_prompt"]]
|
| 209 |
|
| 210 |
for pre_prompt in pre_processing_list:
|
| 211 |
|
|
|
|
| 231 |
input_data["input_text"] = input_text
|
| 232 |
return input_data
|
| 233 |
else:
|
| 234 |
+
input_context = f"You are processing farm activity, interactions, and trial data. Here's important context of the data {parameters['combined_prompt']}. With this context in mind, "
|
| 235 |
input_data["input_context"] = input_context
|
| 236 |
return input_data
|
| 237 |
|
|
|
|
| 281 |
try:
|
| 282 |
|
| 283 |
pre_promp_parameters = data[0]['data']['group_2']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
|
| 285 |
if pre_promp_parameters['preprompt']['value'][0] == 'continue_preprompts':
|
| 286 |
processed_data["pre_prompt"] = True
|