Anne31415 commited on
Commit
c695390
·
1 Parent(s): eb37211

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -8,7 +8,6 @@ import os
8
  import openai
9
  import pandas as pd
10
 
11
- OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
12
 
13
  # Set your OpenAI Assistant ID here
14
  assistant_id = os.getenv("assistant_id")
@@ -27,7 +26,17 @@ repo.git_pull() # Pull the latest changes (if any)
27
  file_path = "Test_csv/Basic_Info_GrunddatenKH141123.csv"
28
 
29
 
30
- client = openai.OpenAI(OPENAI_API_KEY)
 
 
 
 
 
 
 
 
 
 
31
 
32
 
33
  file = client.files.create(
 
8
  import openai
9
  import pandas as pd
10
 
 
11
 
12
  # Set your OpenAI Assistant ID here
13
  assistant_id = os.getenv("assistant_id")
 
26
  file_path = "Test_csv/Basic_Info_GrunddatenKH141123.csv"
27
 
28
 
29
+ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
30
+
31
+ # Set the OpenAI API key globally
32
+ openai.api_key = OPENAI_API_KEY
33
+
34
+
35
+ # Create a file for the assistant
36
+ file = openai.File.create(
37
+ file=open("Test_csv/Basic_Info_GrunddatenKH141123.csv", "rb"),
38
+ purpose='assistants'
39
+ )
40
 
41
 
42
  file = client.files.create(