0.1.0 • Published 3 months ago

helloworld-react-agent v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

HelloWorld ReAct Agent

A simple SDK for interacting with a HelloWorld ReAct agent powered by Claude from Anthropic.

Features

  • ReAct agent implementation using Claude from Anthropic
  • Simple SDK for client-side integration
  • API key authentication for secure access
  • Express server for hosting the service

Installation

Server

# Clone the repository
git clone https://github.com/yourusername/helloworld-react-agent.git
cd helloworld-react-agent

# Install dependencies
npm install

# Create a .env file
cp .env.example .env
# Edit the .env file with your Anthropic API key and other settings

# Build the project
npm run build

# Start the server
npm start

Client SDK

npm install helloworld-react-agent

Usage

Client SDK

import { HelloWorldSDK } from 'helloworld-react-agent';

// Initialize the SDK with your API key
const sdk = new HelloWorldSDK('your-api-key');

// Initialize the agent
await sdk.initialize();

// Ask a question
const response = await sdk.ask('What time is it?');
console.log(response);

Server API

Generate an API Key

You can generate an API key for a user with the following code:

import { generateApiKey } from 'helloworld-react-agent';

const apiKey = generateApiKey('user123', ['basic']);
console.log('Your API key:', apiKey);

API Endpoints

  • GET /health - Health check endpoint
  • POST /api/query - Process a query with the ReAct agent
    • Headers: x-api-key: your-api-key
    • Body: { "query": "What time is it?" }

Development

# Run in development mode
npm run dev

License

MIT