Skip to content

threepointone/shawarma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@threepointone/shawarma

(just an evening spike, ignore)

openai's swarm, rewritten by vercel's ai sdk team, running on workers/durable objects.

const agentA = new Agent({
  name: "Agent A",
  system: "You are a helpful agent.",
  tools: {
    transferToAgentB: {
      type: "handover",
      parameters: z.object({}),
      execute: () => ({ agent: agentB }),
    },
  },
});

const agentB = new Agent({
  name: "Agent B",
  system: "Only speak in Haikus.",
});

try {
  const { text } = await runSwarm({
    agent: agentA,
    context: {},
    model: openai("gpt-4o", { structuredOutputs: true }),
    prompt: "I want to talk to agent B.",
    debug: true,
    onStepFinish: (result) => {
      console.log({ result });
    },
  });
  console.log("got here");

  this.state.text = text;
} catch (e) {
  console.error(e);
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published