File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,26 @@ def __init__(self):
3535 )
3636
3737 def initialize_openai (self ):
38- client = OpenAI ()
38+ if self .verbose :
39+ print ("[Config][initialize_openai]" )
40+
3941 if self .openai_api_key :
4042 if self .verbose :
4143 print ("[Config][initialize_openai] using cached openai_api_key" )
4244 api_key = self .openai_api_key
4345 else :
44- print (
45- "[Config][initialize_openai] no cached openai_api_key, try to get from env."
46- )
46+ if self .verbose :
47+ print (
48+ "[Config][initialize_openai] no cached openai_api_key, try to get from env."
49+ )
4750 api_key = os .getenv ("OPENAI_API_KEY" )
51+
52+ if self .verbose :
53+ print ("[Config][initialize_openai] api_key" , api_key )
54+
55+ client = OpenAI (
56+ api_key = api_key ,
57+ )
4858 client .api_key = api_key
4959 client .base_url = os .getenv ("OPENAI_API_BASE_URL" , client .base_url )
5060 return client
Original file line number Diff line number Diff line change 4242async def get_next_action (model , messages , objective , session_id ):
4343 if VERBOSE :
4444 print ("[Self-Operating Computer][get_next_action]" )
45- print ("[Self-Operating Computer][get_next_action] VERBOSE" , VERBOSE )
46- print ("[Self-Operating Computer][get_next_action] config" , config )
4745 print ("[Self-Operating Computer][get_next_action] model" , model )
4846 if model == "gpt-4" :
4947 return call_gpt_4_vision_preview (messages ), None
You can’t perform that action at this time.
0 commit comments