Skip to content

Commit

Permalink
docs(agent-kit): favor createAgent() instead of new Agent()
Browse files Browse the repository at this point in the history
  • Loading branch information
charlypoly committed Nov 25, 2024
1 parent 58075df commit 5bd771e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pages/docs/agent-kit/ai-agent-network-state-routing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The history system maintains a chronological record of all agent interactions in
The network state keeps track of every agent interaction, building a chronological list of messages in memory. When the network runs, it calls the `onStart` lifecycle hook with the given agent, network, user input, system, and history from memory:

```jsx
const agent = new Agent({
const agent = createAgent({
name: "Code writer",
lifecycles: {
onStart: ({
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/agent-kit/ai-agents-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Here’s a simple agent, which makes a single model call using system prompts an
```jsx
import { Agent, agenticOpenai as openai } from "@inngest/agent-kit";

const agent = new Agent({
const agent = createAgent({
name: "Code writer",
system: "You are an expert TypeScript programmer. Given a set of asks, you think step-by-step to plan clean, " +
"idiomatic TypeScript code, with comments and tests as necessary." +
Expand Down Expand Up @@ -84,7 +84,7 @@ const systemPrompt =
"You are an expert TypeScript programmer. Given a set of asks, think step-by-step to plan clean, " +
"idiomatic TypeScript code, with comments and tests as necessary."

const agent = new Agent({
const agent = createAgent({
name: "Code writer",

// description helps LLM routers choose the right agents to run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default inngest.createFunction(
async ({ event, step }) => {

// Create a new agent with a system prompt (you can add optional tools, too)
const writer = new Agent({
const writer = createAgent({
name: "writer",
system: "You are an expert writer. You write readable, concise, simple content.",
model: openai({ model: "gpt-4o", step }),
Expand Down

0 comments on commit 5bd771e

Please sign in to comment.