Draft
Conversation
…izer-to-promptolution
… a class instantiation' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…promptolution into feature/welcome_capoeira # especially if it merges an updated upstream into a topic branch.
Comment on lines
123
to
135
| few_shot_examples = build_few_shot_examples( | ||
| instruction="Classify the sentiment of the text.", | ||
| num_examples=2, | ||
| df_few_shots=mock_df, | ||
| x_column=mock_task.x_column, | ||
| y_column=mock_task.y_column, | ||
| predictor=mock_predictor, | ||
| fewshot_template=CAPO_FEWSHOT_TEMPLATE, | ||
| target_begin_marker=optimizer.target_begin_marker, | ||
| target_end_marker=optimizer.target_end_marker, | ||
| check_fs_accuracy=True, | ||
| create_fs_reasoning=True, | ||
| ) |
Comment on lines
141
to
153
| few_shot_examples = build_few_shot_examples( | ||
| instruction="Classify the sentiment of the text.", | ||
| num_examples=0, | ||
| df_few_shots=mock_df, | ||
| x_column=mock_task.x_column, | ||
| y_column=mock_task.y_column, | ||
| predictor=mock_predictor, | ||
| fewshot_template=CAPO_FEWSHOT_TEMPLATE, | ||
| target_begin_marker=optimizer.target_begin_marker, | ||
| target_end_marker=optimizer.target_end_marker, | ||
| check_fs_accuracy=True, | ||
| create_fs_reasoning=True, | ||
| ) |
Comment on lines
186
to
202
| mutated = perform_mutation( | ||
| offsprings=[Prompt("Instruction 1", ["Example 1"]), Prompt("Instruction 2", ["Example 2"])], | ||
| mutation_template=optimizer.mutation_template, | ||
| upper_shots=optimizer.upper_shots, | ||
| meta_llm=optimizer.meta_llm, | ||
| few_shot_kwargs=dict( | ||
| df_few_shots=mock_df, | ||
| x_column=mock_task.x_column, | ||
| y_column=mock_task.y_column, | ||
| predictor=mock_predictor, | ||
| fewshot_template=CAPO_FEWSHOT_TEMPLATE, | ||
| target_begin_marker=optimizer.target_begin_marker, | ||
| target_end_marker=optimizer.target_end_marker, | ||
| check_fs_accuracy=True, | ||
| create_fs_reasoning=True, | ||
| ), | ||
| ) |
Comment on lines
270
to
286
| perform_mutation( | ||
| offsprings=[parent], | ||
| mutation_template=optimizer.mutation_template, | ||
| upper_shots=optimizer.upper_shots, | ||
| meta_llm=optimizer.meta_llm, | ||
| few_shot_kwargs=dict( | ||
| df_few_shots=mock_df, | ||
| x_column=mock_task.x_column, | ||
| y_column=mock_task.y_column, | ||
| predictor=mock_predictor, | ||
| fewshot_template=CAPO_FEWSHOT_TEMPLATE, | ||
| target_begin_marker=optimizer.target_begin_marker, | ||
| target_end_marker=optimizer.target_end_marker, | ||
| check_fs_accuracy=True, | ||
| create_fs_reasoning=True, | ||
| ), | ||
| ) |
Comment on lines
168
to
173
| offsprings = perform_crossover( | ||
| [Prompt("Instruction 1", ["Example 1"]), Prompt("Instruction 2", ["Example 2"])], | ||
| optimizer.crossovers_per_iter, | ||
| optimizer.crossover_template, | ||
| optimizer.meta_llm, | ||
| ) |
tests/optimizers/test_capo.py
Outdated
| mother = Prompt("Classify the sentiment of the text.", ["Input: I love this! Output: Positive"]) | ||
| father = Prompt("Determine if the review is positive or negative.", ["Input: This is terrible. Output: Negative"]) | ||
| optimizer._crossover([mother, father]) | ||
| perform_crossover([mother, father], optimizer.crossovers_per_iter, optimizer.crossover_template, optimizer.meta_llm) |
tests/optimizers/test_capoeira.py
Outdated
|
|
||
| mother = Prompt("Instruction 1", ["Example 1"]) | ||
| father = Prompt("Instruction 2", ["Example 2"]) | ||
| perform_crossover([mother, father], optimizer.crossovers_per_iter, optimizer.crossover_template, optimizer.meta_llm) |
banjuessing
suggested changes
Jan 12, 2026
banjuessing
suggested changes
Jan 13, 2026
…rth/promptolution into feature/welcome_capoeira
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.