CYF200127 commited on
Commit
6b368e8
β€’
1 Parent(s): 747fa75

Update rxnim.py

Browse files
Files changed (1) hide show
  1. rxnim.py +6 -10
rxnim.py CHANGED
@@ -11,16 +11,12 @@ from getReaction import get_reaction
11
 
12
 
13
  class RXNIM:
14
- def __init__(self, api_key_file='api_key.txt', api_version='2024-06-01', azure_endpoint='https://hkust.azure-api.net'):
15
- # Read API key
16
- with open(api_key_file, 'r') as api_key_file_handle:
17
- self.API_KEY = api_key_file_handle.read().strip()
18
-
19
- # def __init__(self, api_version='2024-06-01', azure_endpoint='https://hkust.azure-api.net'):
20
- # # δ»ŽηŽ―ε’ƒε˜ι‡θ―»ε– API Key
21
- # self.API_KEY = os.environ.get('key')
22
- # if not self.API_KEY:
23
- # raise ValueError("Environment variable 'KEY' not set.")
24
 
25
  # Set up client
26
  self.client = AzureOpenAI(
 
11
 
12
 
13
  class RXNIM:
14
+
15
+ def __init__(self, api_version='2024-06-01', azure_endpoint='https://hkust.azure-api.net'):
16
+ # δ»ŽηŽ―ε’ƒε˜ι‡θ―»ε– API Key
17
+ self.API_KEY = os.environ.get('key')
18
+ if not self.API_KEY:
19
+ raise ValueError("Environment variable 'KEY' not set.")
 
 
 
 
20
 
21
  # Set up client
22
  self.client = AzureOpenAI(