File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ def __init__(self):
1111
1212 def get_response (self ):
1313 response = openai .Completion .create (
14- model = " text-davinci-003" ,
15- prompt = self .prompt .generate_prompt (),
16- temperature = 0 ,
17- frequency_penalty = 0 ,
18- presence_penalty = 0.6 ,
19- max_tokens = 240
14+ model = os . getenv ( "OPENAI_MODEL" , default = " text-davinci-003") ,
15+ prompt = self .prompt .generate_prompt (),
16+ temperature = int ( os . getenv ( "OPENAI_TEMPERATURE" , default = "0" )) ,
17+ frequency_penalty = int ( os . getenv ( "OPENAI_FREQUENCY_PENALTY" , default = "0" )) ,
18+ presence_penalty = float ( os . getenv ( "OPENAI_PRESENCE_PENALTY" , default = " 0.6" )) ,
19+ max_tokens = int ( os . getenv ( "OPENAI_MAX_TOKENS" , default = " 240" ))
2020 )
2121 return response ['choices' ][0 ]['text' ].strip ()
2222
2323 def add_msg (self , text ):
24- self .prompt .add_msg (text )
24+ self .prompt .add_msg (text )
You can’t perform that action at this time.
0 commit comments