Skip to content

Commit 45e5892

Browse files
refactor: simplify overriding output_kind
Co-authored-by: Felipe Mello <[email protected]>
1 parent c87c154 commit 45e5892

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/forge/actors/generator.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,11 @@ async def generate(
309309
t.start()
310310
record_metric("generator/generate/count_requests", 1, Reduce.SUM)
311311

312+
if sampling_params is not None:
313+
# as in `post_init`
314+
sampling_params.output_kind = RequestOutputKind.FINAL_ONLY
315+
312316
params = sampling_params or self.sampling_params
313-
# Ensure output_kind is set to FINAL_ONLY (as required by post_init)
314-
if params.output_kind != RequestOutputKind.FINAL_ONLY:
315-
params = params.__replace__(output_kind=RequestOutputKind.FINAL_ONLY)
316317

317318
self.request_id += 1 % sys.maxsize
318319
request_id = str(self.request_id)

0 commit comments

Comments
 (0)