@@ -82,6 +82,10 @@ def create(cls,
82
82
workspace : str = None ,
83
83
extra_body : Optional [Dict ] = None ,
84
84
api_key : str = None ,
85
+ top_p : Optional [float ] = None ,
86
+ top_k : Optional [int ] = None ,
87
+ temperature : Optional [float ] = None ,
88
+ max_tokens : Optional [int ] = None ,
85
89
** kwargs ) -> Run :
86
90
"""Create a run.
87
91
@@ -122,6 +126,15 @@ def create(cls,
122
126
if extra_body is not None and extra_body :
123
127
data = {** data , ** extra_body }
124
128
129
+ if top_p is not None :
130
+ data ['top_p' ] = top_p
131
+ if top_k is not None :
132
+ data ['top_k' ] = top_k
133
+ if temperature is not None :
134
+ data ['temperature' ] = temperature
135
+ if max_tokens is not None :
136
+ data ['max_tokens' ] = max_tokens
137
+
125
138
response = super ().call (data = data ,
126
139
path = f'threads/{ thread_id } /runs' ,
127
140
api_key = api_key ,
@@ -180,6 +193,10 @@ def call(cls,
180
193
workspace : str = None ,
181
194
extra_body : Optional [Dict ] = None ,
182
195
api_key : str = None ,
196
+ top_p : Optional [float ] = None ,
197
+ top_k : Optional [int ] = None ,
198
+ temperature : Optional [float ] = None ,
199
+ max_tokens : Optional [int ] = None ,
183
200
** kwargs ) -> Run :
184
201
"""Create a run.
185
202
@@ -214,6 +231,10 @@ def call(cls,
214
231
workspace = workspace ,
215
232
extra_body = extra_body ,
216
233
api_key = api_key ,
234
+ top_p = top_p ,
235
+ top_k = top_k ,
236
+ temperature = temperature ,
237
+ max_tokens = max_tokens ,
217
238
** kwargs )
218
239
219
240
@classmethod
0 commit comments