lachie0232 commited on
Commit
fa594fe
·
verified ·
1 Parent(s): 3338a17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,11 +8,11 @@ openai.api_key = "your-openai-secret-key"
8
  def chatbot(input_text):
9
  try:
10
  response = openai.completions.create(
11
- model="gpt-3.5-turbo", # You can change this model if you have access to GPT-4 or other models
12
  prompt=input_text,
13
  max_tokens=150
14
  )
15
- return response['choices'][0]['text'].strip()
16
  except Exception as e:
17
  return f"Error: {str(e)}"
18
 
 
8
  def chatbot(input_text):
9
  try:
10
  response = openai.completions.create(
11
+ model="gpt-3.5-turbo", # Use the model you prefer, like "gpt-4"
12
  prompt=input_text,
13
  max_tokens=150
14
  )
15
+ return response.choices[0].text.strip() # Adjusted to match the new response structure
16
  except Exception as e:
17
  return f"Error: {str(e)}"
18