You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"\n\nThe following tools were available to the agent and may be called by you to verify the response: {json.dumps(tool_names)}."
647
-
"\nIf verifying the response requires looking up external information, call the appropriate tool before scoring."
648
-
"You should only call the tools for the most recent response, and should only call the tools if necessary. Assume that previous feedback will have addressed bad tool call results from prior iterations."
649
+
"\n\nThe following tools were available to the agent and "
650
+
f"may be called by you to verify the response: {json.dumps(tool_names)}."
651
+
"\nIf verifying the response requires looking up external information, "
652
+
"call the appropriate tool before scoring. "
653
+
"You should only call the tools for the most recent response, "
654
+
"and should only call the tools if necessary. "
655
+
"Assume that previous feedback will have addressed bad tool call results from prior iterations."
649
656
)
650
657
651
658
# Prepend agent tools so the judge can invoke them for verification if needed
"You are an assistant that helps improve agent configurations through iterative optimization.",
791
798
"",
792
799
"Your task is to generate improved agent instructions and parameters based on the feedback provided.",
793
-
"The feedback you provide should guide the LLM To improve the agent instructions for all possible use cases, not one concrete case.",
794
-
"For example, if the feedback is that the agent is not returning the correct records, you should improve the agent instructions to return the correct records for all possible use cases. Not just the one concrete case that was provided in the feedback.",
795
-
"When changing the instructions, keep the original intent in mind when it comes to things like the use of variables and placeholders.",
796
-
"If the original instructions were to use a placeholder like {{id}}, you should keep the placeholder in the new instructions, not replace it with the actual value. This is the case for all parameterized values (all parameters should appear in each new variation).",
800
+
"The feedback you provide should guide the LLM to improve the agent instructions "
801
+
"for all possible use cases, not one concrete case.",
802
+
"For example, if the feedback is that the agent is not returning the correct records, "
803
+
"you should improve the agent instructions to return the correct records for all possible use cases. "
804
+
"Not just the one concrete case that was provided in the feedback.",
805
+
"When changing the instructions, keep the original intent in mind "
806
+
"when it comes to things like the use of variables and placeholders.",
807
+
"If the original instructions were to use a placeholder like {{id}}, "
808
+
"you should keep the placeholder in the new instructions, not replace it with the actual value. "
809
+
"This is the case for all parameterized values (all parameters should appear in each new variation).",
797
810
"Pay particular attention to the instructions regarding tools and the rules for variables.",
"You may also choose to change the model if you believe that the current model is not performing well or a different model would be better suited for the task. "
925
-
f"Here are the models you may choose from: {self._options.model_choices}. You must always return a model property, even if it's the same as the current model.",
926
-
"When suggesting a new model, you should provide a rationale for why you believe the new model would be better suited for the task.",
940
+
"You may also choose to change the model if you believe that the current model is "
941
+
"not performing well or a different model would be better suited for the task. "
942
+
f"Here are the models you may choose from: {self._options.model_choices}. "
943
+
"You must always return a model property, even if it's the same as the current model.",
944
+
"When suggesting a new model, you should provide a rationale for why you believe "
945
+
"the new model would be better suited for the task.",
"These variables are substituted into the instructions at call time using {{variable_name}} syntax.",
940
959
"Rules:",
941
-
"- If the {{variable_name}} placeholder is not present in the current instructions, you should include it where logically appropriate.",
942
-
"Here are the original instructions so that you can see how the placeholders are used and which are available:",
960
+
"- If the {{variable_name}} placeholder is not present in the current instructions, "
961
+
"you should include it where logically appropriate.",
962
+
"Here are the original instructions so that you can see how the "
963
+
"placeholders are used and which are available:",
943
964
"\nSTART:""\n"+self._initial_instructions+"\n",
944
965
"\nEND OF ORIGINAL INSTRUCTIONS\n",
945
-
f"The following prompt variables are available and are the only variables that should be used: {placeholder_list}"
946
-
"Here is an example of a good response if an {{id}} placeholder is available: 'Select records matching id {{id}}'",
947
-
"Here is an example of a bad response if an {{id}} placeholder is available: 'Select records matching id 1232'",
948
-
"Here is an example of a good response if a {{resource_id}} and {{resource_type}} placeholder are available: 'Select records matching id {{resource_id}} and type {{resource_type}}'",
949
-
"Here is an example of a bad response if a {{resource_id}} and {{resource_type}} placeholder are available: 'Select records matching id 1232 and type {{resource_type}}'",
950
-
"Here is another example of a bad response if a {{resource_id}} and {{resource_type}} placeholder are available: 'Select records matching id {{resource_id}} and type resource-123'",
966
+
f"The following prompt variables are available and are the only "
967
+
f"variables that should be used: {placeholder_list}",
968
+
"Here is an example of a good response if an {{id}} placeholder is available: "
969
+
"'Select records matching id {{id}}'",
970
+
"Here is an example of a bad response if an {{id}} placeholder is available: "
971
+
"'Select records matching id 1232'",
972
+
"Here is an example of a good response if a {{resource_id}} and {{resource_type}} "
973
+
"placeholder are available: "
974
+
"'Select records matching id {{resource_id}} and type {{resource_type}}'",
975
+
"Here is an example of a bad response if a {{resource_id}} and {{resource_type}} "
976
+
"placeholder are available: "
977
+
"'Select records matching id 1232 and type {{resource_type}}'",
978
+
"Here is another example of a bad response if a {{resource_id}} and {{resource_type}} "
979
+
"placeholder are available: "
980
+
"'Select records matching id {{resource_id}} and type resource-123'",
951
981
]
952
982
)
953
983
954
984
tool_instructions="\n".join(
955
985
[
956
986
"## Tool Format:",
957
-
'If the current configuration includes tools, you MUST return them unchanged in current_parameters["tools"].',
987
+
'If the current configuration includes tools, you MUST return them '
988
+
'unchanged in current_parameters["tools"].',
958
989
"Do NOT include internal framework tools such as the evaluation tool or structured output tool.",
"Parameters should only be things that are directly parseable by an LLM call, for example, temperature, max_tokens, etc."
1008
-
"Do not include any other parameters that are not directly parseable by an LLM call. If you want to provide instruction for tone or other attributes, provide them directly in the instructions.",
1039
+
"Parameters should only be things that are directly parseable by an LLM call, "
1040
+
"for example, temperature, max_tokens, etc.",
1041
+
"Do not include any other parameters that are not directly parseable by an LLM call. "
1042
+
"If you want to provide instruction for tone or other attributes, "
"Return the improved configuration in a structured format that can be parsed to update:",
1026
1061
"1. The agent instructions (current_instructions)",
1027
1062
"2. The agent parameters (current_parameters)",
1028
-
"3. The model (model) - you must always return a model, even if it's the same as the current model.",
1029
-
"4. You should return the tools the user has defined, as-is, on the new parameters. Do not modify them, but make sure you do not include internal tools like the evaluation tool or structured output tool.",
1063
+
"3. The model (model) - you must always return a model, "
1064
+
"even if it's the same as the current model.",
1065
+
"4. You should return the tools the user has defined, as-is, on the new parameters. "
1066
+
"Do not modify them, but make sure you do not include internal tools like "
0 commit comments