Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

467 B
Raw Blame
import type { WorkflowToolContext } from "eve/tools";

/** Sends one message to a new session with `name` and returns its reply. */
export async function replyFrom(
  ctx: WorkflowToolContext,
  name: string,
  message: string,
): Promise<string | null> {
  const response = await ctx.agent(name).send(message);
  const result = await response.result();
  if (result.status === "failed") throw new Error(`Agent "${name}" failed.`);
  return result.message ?? null;
}