srush HF staff commited on
Commit
c324ae4
1 Parent(s): 0eeebf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -62,8 +62,13 @@ def start(prompt, board, api_key):
62
  # num_tokens = encoding.encode(string)
63
  content = ""
64
  openai.api_key = api_key
65
-
66
- for chunk in chat_completion = client.chat.completions.create(
 
 
 
 
 
67
  model="gpt-4o",
68
  messages=[{
69
  "role": "user",
 
62
  # num_tokens = encoding.encode(string)
63
  content = ""
64
  openai.api_key = api_key
65
+ from openai import OpenAI
66
+
67
+ client = OpenAI(
68
+ # This is the default and can be omitted
69
+ api_key=api_key,
70
+ )
71
+ for chunk in client.chat.completions.create(
72
  model="gpt-4o",
73
  messages=[{
74
  "role": "user",