Zihadev commited on
Commit
65eb4e2
·
verified ·
1 Parent(s): 7ccb876

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -4,6 +4,10 @@ import streamlit as st
4
 
5
  # Set your OpenAI API key as an environment variable
6
  openai.api_key = os.getenv('OPENAI_API_KEY')
 
 
 
 
7
 
8
  def chat(user_message):
9
  response = client.chat.completions.create(
 
4
 
5
  # Set your OpenAI API key as an environment variable
6
  openai.api_key = os.getenv('OPENAI_API_KEY')
7
+ client = OpenAI(
8
+ # This is the default and can be omitted
9
+ api_key=os.environ.get("OPENAI_API_KEY"),
10
+ )
11
 
12
  def chat(user_message):
13
  response = client.chat.completions.create(