File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,13 @@ def is_intersection(keys, required_keys):
14
14
15
15
16
16
def set_openai_api_key ():
17
- if os .environ .get ("OPENAI_DEV" ) != None :
18
- os .environ ["OPENAI_API_KEY" ] = os .environ ["OPENAI_DEV" ]
17
+ match os .environ .get ("MAPLE_DEV" ):
18
+ case "prod" :
19
+ if os .environ .get ("OPENAI_PROD" ) != None :
20
+ os .environ ["OPENAI_API_KEY" ] = os .environ ["OPENAI_PROD" ]
21
+ case _: # if "dev" or unspecified, use OPENAI_DEV
22
+ if os .environ .get ("OPENAI_DEV" ) != None :
23
+ os .environ ["OPENAI_API_KEY" ] = os .environ ["OPENAI_DEV" ]
19
24
20
25
21
26
@app .route ("/summary" , methods = ["POST" ])
@@ -59,7 +64,9 @@ def ready():
59
64
60
65
61
66
@https_fn .on_request (
62
- secrets = ["OPENAI_DEV" ], timeout_sec = 300 , memory = options .MemoryOption .GB_1
67
+ secrets = ["OPENAI_DEV" , "OPENAI_PROD" ],
68
+ timeout_sec = 300 ,
69
+ memory = options .MemoryOption .GB_1 ,
63
70
)
64
71
def httpsflaskexample (req : https_fn .Request ) -> https_fn .Response :
65
72
with app .request_context (req .environ ):
You can’t perform that action at this time.
0 commit comments