SDK Reference

Welcome to the Skillful AI Web SDK reference documentation. Here you'll find detailed information about the classes, methods, and properties available in the SDK.

πŸ”· SkillfulClient

The SkillfulClient is the main entry point for interacting with Skillful AI agents.

Initialization

import { SkillfulClient } from '@skillfulai/agents';

const client = new SkillfulClient({
    apiKey: 'your-api-key'
});

Core Methods

🟣 Agent Management

getAgents()

Retrieves all available agents.

const agents = await client.getAgents();

Returns: Array<Agent> - List of available agents

setAgent(agentOrName)

Sets the active agent for conversations.

// By name
await client.setAgent('Wojak');

// By agent object
await client.setAgent(agents[0]);

Parameters:

  • agentOrName: string | Agent - Agent name or object

Returns: Promise<Agent> - The set agent

🟣 Conversation Methods

sendMessage(content)

Sends a message to the active agent.

Parameters:

  • content: string - Message to send

Returns:

getConversationHistory()

Gets the current conversation history.

Returns: Array of message objects

clearConversation()

Clears the current conversation history.

πŸ”· Agent

The Agent class represents an AI agent and provides access to its properties and capabilities.

Properties

Methods

findAgentByName(name)

Finds a specific agent by name.

Parameters:

  • name: string - Name of the agent to find

Returns: Promise<Agent | null> - Found agent or null

hasSkill(skillName)

Checks if the agent has a specific skill.

Parameters:

  • skillName: string - Name of the skill to check

Returns: boolean

getLLMInfo()

Gets the agent's language model configuration.

Returns:

πŸ”· Response Structure

When receiving a response from sendMessage(), you get:

πŸ”· Error Handling

The SDK provides detailed error messages for common issues:

Last updated