sergeipetrov commited on
Commit
16d11d9
1 Parent(s): 5bc9830

Update src/open_ai_connector.py

Browse files
Files changed (1) hide show
  1. 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
- 'action': prefiltered_names,
17
- 'descriptions': prefiltered_descriptions
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 += csv_buffer.getvalue()
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'