Skip to content

Documentation / @agentick/agent / agentComponent

Function: agentComponent() ​

agentComponent(config): ComponentFunction

Defined in: create-agent.ts:58

Convert an AgentConfig to a ComponentFunction for use with session.spawn().

Core's spawn only accepts ComponentFunction | JSX.Element (no config objects). This bridges the gap for users who want config-object spawn.

Parameters ​

config ​

AgentConfig

Returns ​

ComponentFunction

Example ​

typescript
// In a tool handler
const result = await ctx.spawn(
  agentComponent({ system: "Research this", tools: [SearchTool] }),
  { messages: [...] },
);

Released under the ISC License.