We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd43316 commit 58229eaCopy full SHA for 58229ea
1 file changed
deepeval/synthesizer/synthesizer.py
@@ -205,11 +205,15 @@ def _merge_cross_file_contexts(
205
)
206
207
for idx, current in enumerate(contexts_with_sources):
208
- target_count = (
209
- max_available_files
210
- if target_files_per_context is None
211
- else min(target_files_per_context, max_available_files)
212
- )
+ if target_files_per_context is None:
+ # Random cap avoids merging every distinct file (which blows up context).
+ target_count = (
+ random.randint(2, max_available_files)
+ if max_available_files >= 2
213
+ else 1
214
+ )
215
+ else:
216
+ target_count = min(target_files_per_context, max_available_files)
217
chosen_indices: List[int] = []
218
candidate_scores: List[Tuple[int, float]] = []
219
for candidate_idx, candidate in enumerate(contexts_with_sources):
0 commit comments