Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

1.1 KB
Raw Blame
import { defineEval } from "eve/evals";

import { DYNAMIC_ECHO_TOKEN, ECHO_TOOL } from "./shared";

// The dynamic tool must survive serialization/deserialization (lazy
// replay of the resolver): both turns call it and see the token.
export default defineEval({
  tags: ["real-model"],
  description: "Dynamic tools smoke: the dynamic tool survives serialization across turns.",
  async test(t) {
    const first = await t.send(
      `Please call the \`${ECHO_TOOL}\` tool with message 'turn one' and tell me the token it returned.`,
    );
    const session = first.session;
    first.expectOk();
    first.calledTool(ECHO_TOOL, {
      output: { token: DYNAMIC_ECHO_TOKEN },
    });

    const second = await session.send(
      `I need you to call the \`${ECHO_TOOL}\` tool right now with message 'turn two', do not answer from memory. Call it and tell me the token from the result.`,
    );
    second.calledTool(ECHO_TOOL, {
      output: { token: DYNAMIC_ECHO_TOKEN },
    });

    t.succeeded();
    t.calledTool(ECHO_TOOL, {
      output: { token: DYNAMIC_ECHO_TOKEN },
      count: (count) => count >= 2,
    });
  },
});