Update process_data.py
Browse files- process_data.py +6 -2
process_data.py
CHANGED
|
@@ -326,6 +326,9 @@ def pre_processing(input_data, parameters):
|
|
| 326 |
for text_label, text_body in input_data["input_text_pieces"].items():
|
| 327 |
for parameter_name, parameter_value in parameters.items():
|
| 328 |
if 'pre_prompt' in parameter_name and parameter_value is not None and not isinstance(parameter_value, bool):
|
|
|
|
|
|
|
|
|
|
| 329 |
response = client.chat.completions.create(
|
| 330 |
model=parameters["model_version"],
|
| 331 |
messages=[
|
|
@@ -335,8 +338,9 @@ def pre_processing(input_data, parameters):
|
|
| 335 |
)
|
| 336 |
|
| 337 |
response_text = response.choices[0].message.content
|
| 338 |
-
text_body = response_text
|
| 339 |
-
|
|
|
|
| 340 |
|
| 341 |
return input_data
|
| 342 |
|
|
|
|
| 326 |
for text_label, text_body in input_data["input_text_pieces"].items():
|
| 327 |
for parameter_name, parameter_value in parameters.items():
|
| 328 |
if 'pre_prompt' in parameter_name and parameter_value is not None and not isinstance(parameter_value, bool):
|
| 329 |
+
print("Prompt followed by data entered")
|
| 330 |
+
print(parameter_value)
|
| 331 |
+
print(text_body)
|
| 332 |
response = client.chat.completions.create(
|
| 333 |
model=parameters["model_version"],
|
| 334 |
messages=[
|
|
|
|
| 338 |
)
|
| 339 |
|
| 340 |
response_text = response.choices[0].message.content
|
| 341 |
+
text_body = str(response_text.json())
|
| 342 |
+
print(text_body)
|
| 343 |
+
input_data["input_text_pieces"]["pre_processed_pieces"][text_label] = response_text.json()
|
| 344 |
|
| 345 |
return input_data
|
| 346 |
|