Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
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",
|