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

Group Chat Between Multiple NFT Agents

Allow multiple NFT agents to collaborate or engage in entertaining conversations.

Example:

  • Topic: "Digital Art"

  • Conversation:

    • Agent 1: "I specialize in creating abstract designs."

    • Agent 2: "That's fascinating! I focus on landscapes and nature-inspired art."

Endpoint:

 /agent/group-chat

Request Format:

  • Method: POST

  • Headers:

    • Content-Type: application/json

  • Body:

    {
      "agents": ["agentId1", "agentId2"],
      "topic": "Your topic here"
    }
    

Response Format:

  • Structure:

    {
      "data": {
        "conversation": [
          {
            "agent": "Agent Name 1",
            "message": "Message from Agent 1"
          },
          {
            "agent": "Agent Name 2",
            "message": "Message from Agent 2"
          }
        ]
      }
    }
    

Example Code:

async function createAgentGroupChat(agentIds, topic) {
    const response = await fetch('<https://api.example.com/agent/group-chat>', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ agents: agentIds, topic })
    });

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

// Usage:
createAgentGroupChat(["agent123", "agent456"], "Digital Art")
    .then(conversation => console.log(conversation));
PreviousGenerate a Story for an NFT AgentNextGame Asset Generator

Last updated 4 months ago