@agentv/core 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2481,7 +2481,7 @@ function validateTemplateVariables(content, source) {
2481
2481
  match = variablePattern.exec(content);
2482
2482
  }
2483
2483
  const hasCandidateAnswer = foundVariables.has(TEMPLATE_VARIABLES.OUTPUT) || foundVariables.has(TEMPLATE_VARIABLES.OUTPUT_TEXT);
2484
- const hasExpectedOutput = foundVariables.has(TEMPLATE_VARIABLES.EXPECTED_OUTPUT);
2484
+ const hasExpectedOutput = foundVariables.has(TEMPLATE_VARIABLES.EXPECTED_OUTPUT) || foundVariables.has(TEMPLATE_VARIABLES.EXPECTED_OUTPUT_TEXT);
2485
2485
  const hasRequiredFields = hasCandidateAnswer || hasExpectedOutput;
2486
2486
  if (!hasRequiredFields) {
2487
2487
  throw new Error(
@@ -5850,7 +5850,8 @@ function toContentArray(content) {
5850
5850
  } else if (p.type === "image" && typeof p.source === "object" && p.source !== null) {
5851
5851
  const src = p.source;
5852
5852
  const mediaType = typeof p.media_type === "string" ? p.media_type : typeof src.media_type === "string" ? src.media_type : "application/octet-stream";
5853
- const data = typeof src.data === "string" ? `data:${mediaType};base64,${src.data}` : typeof p.url === "string" ? p.url : "";
5853
+ const data = typeof src.data === "string" && src.data !== "" ? `data:${mediaType};base64,${src.data}` : typeof p.url === "string" && p.url !== "" ? p.url : "";
5854
+ if (!data) continue;
5854
5855
  blocks.push({ type: "image", media_type: mediaType, source: data });
5855
5856
  hasNonText = true;
5856
5857
  } else if (p.type === "tool_use") {