Spaces:
Sleeping
Sleeping
Update src/open_ai_connector.py
Browse files- src/open_ai_connector.py +8 -7
src/open_ai_connector.py
CHANGED
|
@@ -12,17 +12,18 @@ class OpenAIConnector:
|
|
| 12 |
|
| 13 |
#print(prefiltered_names)
|
| 14 |
|
| 15 |
-
actions_list = pd.DataFrame({
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
})
|
| 19 |
|
| 20 |
-
csv_buffer = StringIO()
|
| 21 |
-
actions_list.to_csv(csv_buffer, index=False)
|
| 22 |
|
|
|
|
| 23 |
|
| 24 |
system_message = "following is a csv list of actions and their descriptions: \n"
|
| 25 |
-
system_message +=
|
| 26 |
system_message += "\n\n"
|
| 27 |
system_message += "find me all best fitting actions for the user request and order them by match. please just consider these actions and nothing else, but there might be multiple fitting actions.\n"
|
| 28 |
system_message += 'return the actions just in form of a json with action name and short reasoning, no additional text around, no formatting, etc.: [{ "action": "Icon Library", "reason": "Shows you a list of icons you can use in Pimcore configurations." }].\n'
|
|
|
|
| 12 |
|
| 13 |
#print(prefiltered_names)
|
| 14 |
|
| 15 |
+
# actions_list = pd.DataFrame({
|
| 16 |
+
# 'action': prefiltered_names,
|
| 17 |
+
# 'descriptions': prefiltered_descriptions
|
| 18 |
+
# })
|
| 19 |
|
| 20 |
+
# csv_buffer = StringIO()
|
| 21 |
+
# actions_list.to_csv(csv_buffer, index=False)
|
| 22 |
|
| 23 |
+
actions_list = "\n".join([f"action: {action}, description: {desc}" for action, desc in zip(prefiltered_names, prefiltered_descriptions)])
|
| 24 |
|
| 25 |
system_message = "following is a csv list of actions and their descriptions: \n"
|
| 26 |
+
system_message += actions_list
|
| 27 |
system_message += "\n\n"
|
| 28 |
system_message += "find me all best fitting actions for the user request and order them by match. please just consider these actions and nothing else, but there might be multiple fitting actions.\n"
|
| 29 |
system_message += 'return the actions just in form of a json with action name and short reasoning, no additional text around, no formatting, etc.: [{ "action": "Icon Library", "reason": "Shows you a list of icons you can use in Pimcore configurations." }].\n'
|