Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ openai.api_key = "your-openai-secret-key"
|
|
7 |
# Define a function to call the OpenAI API (new method)
|
8 |
def chatbot(input_text):
|
9 |
try:
|
10 |
-
response = openai.
|
11 |
model="gpt-3.5-turbo", # You can change this model if you have access to GPT-4 or other models
|
12 |
messages=[
|
13 |
{"role": "system", "content": "You are a helpful assistant."},
|
@@ -29,3 +29,4 @@ iface = gr.Interface(
|
|
29 |
# Launch the interface
|
30 |
iface.launch()
|
31 |
|
|
|
|
7 |
# Define a function to call the OpenAI API (new method)
|
8 |
def chatbot(input_text):
|
9 |
try:
|
10 |
+
response = openai.ChatCompletion.create(
|
11 |
model="gpt-3.5-turbo", # You can change this model if you have access to GPT-4 or other models
|
12 |
messages=[
|
13 |
{"role": "system", "content": "You are a helpful assistant."},
|
|
|
29 |
# Launch the interface
|
30 |
iface.launch()
|
31 |
|
32 |
+
|