Skillful Agents Service Reference
Skillful Agents Service ReferenceThis reference guide covers the essential components and usage patterns of the Skillful Agents service, focusing on practical implementation details.
Core Components
Core ComponentsSkillfulAgent Component
SkillfulAgent ComponentThe primary component for integrating agents into your Unity game. This component handles:
Agent selection and management
Message sending and receiving
Conversation history tracking
Error handling and debugging
Basic Implementation Patterns
Basic Implementation PatternsSingle Agent Pattern
Best for simple implementations with one agent:
using SkillfulAI.Agents;
using UnityEngine;
public class BasicAgent : MonoBehaviour
{
private SkillfulAgent agent;
void Start()
{
// Basic setup
agent = gameObject.AddComponent<SkillfulAgent>();
agent.SelectAgentByName("YourAgentName");
}
public void SendQuestion(string question)
{
agent.SendMessage(question, HandleResponse);
}
private void HandleResponse(string response)
{
Debug.Log($"Agent Response: {response}");
}
}Multi-Agent Pattern
Multi-Agent PatternFor games requiring multiple different agents:
Conversation Manager Pattern
Conversation Manager PatternFor handling complex dialogue flows:
UI Integration Pattern
UI Integration PatternFor creating a chat interface:
Game Event Integration Pattern
Game Event Integration PatternFor creating event-driven agent interactions:
Best Practices
Best PracticesAgent SelectionSelect agents early in the game lifecycle
Keep agent names consistent with the dashboard
Implement fallback behavior for missing agents
Message HandlingKeep messages concise and context-aware
Implement proper error handling
Consider message queuing for multiple requests
PerformanceDon't spam messages in Update loops
Cache agent references
Implement cooldowns if needed
Last updated