Developer Documentation
DAR Open Network
  • Overview
  • DAR ID
    • Introduction
    • Client ID Registration
    • Authentication
      • 1. Request DAR ID Identity
      • 2. Exchange Code for Access Token
      • 3. Refresh Access Token
      • 4. Get Access Token Details
      • 5. Get User DAR ID Information
    • Security Best Practices
  • DeAI
    • Multi-Agent Framework
      • Development Guide
      • Agent Options
      • Endpoints Overview
    • aiNFT Framework
      • Overview
      • Chat with an NFT Agent
      • Generate a Story for an NFT Agent
      • Group Chat Between Multiple NFT Agents
    • Game Asset Generator
Powered by GitBook
On this page
  1. DeAI
  2. aiNFT Framework

Generate a Story for an NFT Agent

Generate unique narratives based on an agent's characteristics and a chosen theme.

Example:

  • Theme: "Space Adventure"

  • Generated Story: "Agent Astro embarked on a thrilling journey across the galaxy, encountering alien species and uncovering ancient treasures."

Endpoint:

/agent/${agentId}/story

Request Format:

  • Method: POST

  • Headers:

    • Content-Type: application/json

  • Body:

    {
      "theme": "Your theme here"
    }
    

Response Format:

  • Structure:

    {
      "data": {
        "story": "Generated story content"
      }
    }
    

Example Code:

async function generateAgentStory(agentId, theme) {
    const response = await fetch(`https://api.example.com/agent/${agentId}/story`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ theme })
    });

    const data = await response.json();
    return data.data.story;
}

// Usage:
generateAgentStory("agent123", "space_adventure")
    .then(story => console.log(story));
PreviousChat with an NFT AgentNextGroup Chat Between Multiple NFT Agents

Last updated 4 months ago