Skip to content

danget1345/https-github.com-TeneoProtocolAI-teneo-agent-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

import { TeneoSDK, SecurePrivateKey } from "@teneo-protocol/sdk";

const sdk = new TeneoSDK({ wsUrl: "wss://backend.developer.chatroom.teneo-protocol.ai/ws", privateKey: new SecurePrivateKey(process.env.PRIVATE_KEY!), autoSummon: true // Automatically add agents to rooms when needed });

await sdk.connect();

// This is a paid command (0.001 USDC per request) // Payment is handled automatically via autoApproveQuotes (enabled by default) const response = await sdk.sendMessage("@example /analyze ETH 24h", { room: "your-room-id", waitForResponse: true, timeout: 30000 });

console.log(response.content);

sdk.disconnect();

// If you prefer not to enable autoSummon globally, you can add agents manually: // // await sdk.agentRoom.addAgentToRoom("your-room-id", "example"); // const response = await sdk.sendMessage("@example /analyze ETH 24h", { ... });

// Advanced: To inspect pricing before paying, disable auto-approve: // // const sdk = new TeneoSDK({ ..., autoApproveQuotes: false }); // const quote = await sdk.requestQuote("@example /analyze ETH 24h", "your-room-id"); // console.log(Price: ${quote.pricing.pricePerUnit} USDC); // const response = await sdk.confirmQuote(quote.taskId, { waitForResponse: true });

About

fan

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors