Example

Querying an Agent

import { interactAgent } from './src/interactAgent';

(async () => {
  const response = await interactAgent('TestAgent', 'What is the market cap for BTC?');
  console.log('Agent Response:', response);
})();

Storing Memory

import { storeMemory } from './src/firebase';

(async () => {
  await storeMemory('TestAgent', 'session_data', 'Important session information');
  console.log('Memory stored successfully.');
})();

Executing a Trade

import { executeTrade } from './src/trade';

(async () => {
  const tradeDetails = {
    token: "BTC",
    amount: 5,
    action: "buy"
  };

  const result = await executeTrade(tradeDetails);
  console.log('Trade result:', result);
})();

Error Handling

The API follows standard HTTP response codes to indicate the success or failure of requests.

Error Format:

{
  "error": "Error message describing the issue"
}

Last updated