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
Copy file name to clipboardExpand all lines: packages/agent-runtime/src/templates/strings.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -226,7 +226,7 @@ export async function getAgentPrompt<T extends StringField>(
226
226
if(outputSchema){
227
227
addendum+='\n\n## Output Schema\n\n'
228
228
addendum+=
229
-
'When using the set_output tool, your output must conform to this schema:\n\n'
229
+
'When using the set_output tool, your output must conform to this schema. You may pass the fields either directly as top-level parameters or inside a `data` field — both are accepted.\n\n'
consterrorMessage=`Output validation error: Output failed to match the output schema and was ignored. You might want to try again! Issues: ${error}`
55
+
// Show whichever error has fewer issues — that represents the "closer" parse
56
+
// attempt and gives the agent more actionable feedback for retrying.
57
+
constissues1=getZodIssueCount(error)
58
+
constissues2=getZodIssueCount(error2)
59
+
constusedData=issues2<issues1
60
+
constbestError=usedData ? error2 : error
61
+
constprefix=usedData
62
+
? 'Output validation error: Your output was found inside the `data` field but still failed validation. Please fix the issues and try again without wrapping in `data`. Issues: '
63
+
: 'Output validation error: Output failed to match the output schema and was ignored. You might want to try again! Issues: '
0 commit comments