Spaces:
Sleeping
Sleeping
Update helper.py
Browse files
helper.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import openai
|
2 |
import os
|
3 |
import json
|
|
|
4 |
|
5 |
def chat_with_gpt(system_prompt, user_query, use_schema=False, schema=None):
|
6 |
"""
|
@@ -65,3 +66,12 @@ def load_intent_texts(intents, get_txt_files):
|
|
65 |
except FileNotFoundError:
|
66 |
loaded_texts[intent] = f"[ERROR] File '{filename}' not found."
|
67 |
return loaded_texts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import openai
|
2 |
import os
|
3 |
import json
|
4 |
+
from prompts_and_chema import intent_description_map
|
5 |
|
6 |
def chat_with_gpt(system_prompt, user_query, use_schema=False, schema=None):
|
7 |
"""
|
|
|
66 |
except FileNotFoundError:
|
67 |
loaded_texts[intent] = f"[ERROR] File '{filename}' not found."
|
68 |
return loaded_texts
|
69 |
+
|
70 |
+
def load_intent_description(intents, intent_description_map):
|
71 |
+
intent_list = intents.get("intents", [])
|
72 |
+
intent_description_string = ''
|
73 |
+
for intent in intent_list:
|
74 |
+
intent_description_string += '\n' + str(intent_description_map[intent])
|
75 |
+
|
76 |
+
return intent_description_string
|
77 |
+
|