hzxwonder commited on
Commit
2d75a44
·
1 Parent(s): ac09190
deciders/act.py CHANGED
@@ -99,7 +99,7 @@ class NaiveAct(gpt):
99
  max_tokens=self.max_tokens
100
  )
101
  elif self.args.api_type == "openai":
102
- autofixing_chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key)
103
 
104
  parser = PydanticOutputParser(pydantic_object=PARSERS[num_action])
105
  autofixing_parser = OutputFixingParser.from_llm(
 
99
  max_tokens=self.max_tokens
100
  )
101
  elif self.args.api_type == "openai":
102
+ autofixing_chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key,model=self.args.gpt_version)
103
 
104
  parser = PydanticOutputParser(pydantic_object=PARSERS[num_action])
105
  autofixing_parser = OutputFixingParser.from_llm(
deciders/cot.py CHANGED
@@ -43,7 +43,7 @@ class ChainOfThought(NaiveAct):
43
  max_tokens=self.max_tokens
44
  )
45
  elif self.args.api_type == "openai":
46
- chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key)
47
 
48
 
49
  suffix_flag = False
 
43
  max_tokens=self.max_tokens
44
  )
45
  elif self.args.api_type == "openai":
46
+ chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key, model=self.args.gpt_version)
47
 
48
 
49
  suffix_flag = False
deciders/exe.py CHANGED
@@ -108,7 +108,7 @@ class EXE(NaiveAct):
108
  max_tokens=self.max_tokens
109
  )
110
  elif self.args.api_type == "openai":
111
- chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key)
112
  # print(self.logger)
113
  reply_format_description = \
114
  "Your response should choose an optimal action from valid action list, and terminated with following format: "
 
108
  max_tokens=self.max_tokens
109
  )
110
  elif self.args.api_type == "openai":
111
+ chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key, model=self.args.gpt_version)
112
  # print(self.logger)
113
  reply_format_description = \
114
  "Your response should choose an optimal action from valid action list, and terminated with following format: "
deciders/reflexion.py CHANGED
@@ -65,7 +65,7 @@ class Reflexion(NaiveAct):
65
  max_tokens=self.max_tokens
66
  )
67
  elif self.args.api_type == "openai":
68
- chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key)
69
  suffix_flag = False
70
  reply_format_description = \
71
  "Your response should choose an optimal action from a valid action list and terminate with the following format: "
 
65
  max_tokens=self.max_tokens
66
  )
67
  elif self.args.api_type == "openai":
68
+ chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key, model=self.args.gpt_version)
69
  suffix_flag = False
70
  reply_format_description = \
71
  "Your response should choose an optimal action from a valid action list and terminate with the following format: "
deciders/self_consistency.py CHANGED
@@ -46,7 +46,7 @@ class SelfConsistency(NaiveAct):
46
  max_tokens=self.max_tokens
47
  )
48
  elif self.args.api_type == "openai":
49
- chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key)
50
 
51
  suffix_flag = False
52
  reply_format_description = \
 
46
  max_tokens=self.max_tokens
47
  )
48
  elif self.args.api_type == "openai":
49
+ chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key, model=self.args.gpt_version)
50
 
51
  suffix_flag = False
52
  reply_format_description = \
deciders/selfask.py CHANGED
@@ -43,7 +43,7 @@ class SelfAskAct(NaiveAct):
43
  max_tokens=self.max_tokens
44
  )
45
  elif self.args.api_type == "openai":
46
- chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key)
47
 
48
  suffix_flag = False
49
  reply_format_description = \
 
43
  max_tokens=self.max_tokens
44
  )
45
  elif self.args.api_type == "openai":
46
+ chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key, model=self.args.gpt_version)
47
 
48
  suffix_flag = False
49
  reply_format_description = \
deciders/spp.py CHANGED
@@ -42,7 +42,7 @@ class SPP(NaiveAct):
42
  max_tokens=self.max_tokens
43
  )
44
  elif self.args.api_type == "openai":
45
- chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key)
46
 
47
  self.fewshot_example = self.irr_few_shot_examples if not self.fewshot_example else self.fewshot_example
48
  self.irr_few_shot_examples = self.irr_few_shot_examples if not self.fewshot_example else self.fewshot_example
 
42
  max_tokens=self.max_tokens
43
  )
44
  elif self.args.api_type == "openai":
45
+ chat = ChatOpenAI(temperature=self.temperature, openai_api_key=openai.api_key, model=self.args.gpt_version)
46
 
47
  self.fewshot_example = self.irr_few_shot_examples if not self.fewshot_example else self.fewshot_example
48
  self.irr_few_shot_examples = self.irr_few_shot_examples if not self.fewshot_example else self.fewshot_example