tonyassi commited on
Commit
7f679d9
β€’
1 Parent(s): ffc242d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  from openai import OpenAI
3
 
4
- client = OpenAI()
5
 
6
  def echo(message, chat_history):
7
  bot_message = 'echo ' + message
@@ -9,8 +9,8 @@ def echo(message, chat_history):
9
  return '', chat_history
10
 
11
  def is_api_key_valid(api_key):
 
12
  try:
13
- client.api_key = api_key
14
  response = client.chat.completions.create(
15
  messages=[{"role": "user", "content": "Testing"}],
16
  model="gpt-3.5-turbo",
 
1
  import gradio as gr
2
  from openai import OpenAI
3
 
4
+ client = OpenAI(api_key="")
5
 
6
  def echo(message, chat_history):
7
  bot_message = 'echo ' + message
 
9
  return '', chat_history
10
 
11
  def is_api_key_valid(api_key):
12
+ client.api_key = api_key
13
  try:
 
14
  response = client.chat.completions.create(
15
  messages=[{"role": "user", "content": "Testing"}],
16
  model="gpt-3.5-turbo",