Spaces:
Runtime error
Runtime error
feat: implement function for system setting messages
Browse files- modules/gpt_modules.py +10 -0
modules/gpt_modules.py
CHANGED
@@ -16,4 +16,14 @@ def gpt_call(prompt, role="user"):
|
|
16 |
)
|
17 |
output_text = response["choices"][0]["message"]["content"]
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
return output_text
|
|
|
16 |
)
|
17 |
output_text = response["choices"][0]["message"]["content"]
|
18 |
|
19 |
+
return output_text
|
20 |
+
|
21 |
+
|
22 |
+
def gpt_call_context(messages):
|
23 |
+
response = openai.ChatCompletion.create(
|
24 |
+
model="gpt-3.5-turbo",
|
25 |
+
messages=messages
|
26 |
+
)
|
27 |
+
output_text = response["choices"][0]["message"]["content"]
|
28 |
+
|
29 |
return output_text
|