Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

1.0 KB
Raw Blame
import { defineEval } from "eve/evals";
import { equals } from "eve/evals/expect";

// @ts-ignore TS6059: this eval intentionally exercises the workspace source implementation.
import { coalesceDeliverPayloads } from "../../../../../packages/eve/src/execution/deliver-payloads.js";

export default defineEval({
  tags: ["real-model"],
  description: "Payloads within one delivery combine their messages and context in order.",
  async test(t) {
    const firstMessage = "Remember synthetic marker BATCH-FIRST.";
    const secondMessage = "Remember synthetic marker BATCH-SECOND.";
    const firstContext = "Synthetic context: first delivery.";
    const secondContext = "Synthetic context: second delivery.";

    await t.require(
      coalesceDeliverPayloads([
        { context: [firstContext], message: firstMessage },
        { context: [secondContext], message: secondMessage },
      ]),
      equals({
        context: [firstContext, secondContext],
        message: `${firstMessage}\n\n${secondMessage}`,
      }),
    );

    t.succeeded();
  },
});