For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
        • ApiNinjasTriviaSkill
        • AskClaudeSkill
        • ClaudeSkillsSkill
        • CustomSkillsSkill
        • DataSphereServerlessSkill
        • DataSphereSkill
        • DateTimeSkill
        • GoogleMapsSkill
        • InfoGathererSkill
        • JokeSkill
        • MathSkill
        • McpGatewaySkill
        • NativeVectorSearchSkill
        • PlayBackgroundFileSkill
        • SpiderSkill
        • SwmlTransferSkill
        • WeatherApiSkill
        • WebSearchSkill
        • WikipediaSearchSkill
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • tool_name
  • api_key
  • categories
  • default_category
  • reveal_answer
AgentsSkills

ApiNinjasTriviaSkill

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

AskClaudeSkill

Next
Built with

Fetch trivia questions from the API Ninjas service with optional category filtering.

Class: ApiNinjasTriviaSkill

Tools: Configurable via tool_name (default get_trivia)

Env vars: API_NINJAS_KEY

Multi-instance: Yes — each instance must use a distinct tool_name.

tool_name
stringDefaults to get_trivia

Custom name for the SWAIG trivia tool. Set a distinct value per instance when registering multiple ApiNinjasTriviaSkill instances on the same agent.

api_key
stringRequired

API Ninjas API key. Falls back to the API_NINJAS_KEY environment variable.

categories
string[]

Subset of trivia categories to enable. Defaults to all 14 supported categories. Values outside the allowed set are filtered out. Available categories: artliterature, language, sciencenature, general, fooddrink, peopleplaces, geography, historyholidays, entertainment, toysgames, music, mathematics, religionmythology, sportsleisure.

default_category
string

Default trivia category if none is specified by the user. Must be one of the enabled categories.

reveal_answer
booleanDefaults to false

Whether to include the answer in the response. When false, the AI receives the answer privately so it can quiz the user.

1import { AgentBase, ApiNinjasTriviaSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new ApiNinjasTriviaSkill({
7 default_category: 'sciencenature',
8 reveal_answer: false,
9}));
10
11agent.run();