For Local Machine
Prerequisites
Ensure the following are installed and configured on your system:
Node.js (v16 or higher) Download Node.js
npm (Node Package Manager) Comes bundled with Node.js.
Firebase Service Account Key Required for local Firestore authentication.
OpenAI API Key Obtain an API key from OpenAI.
Install all dependencies:
npm installSetup
1. Clone the Repository
git clone https://github.com/frausai/frausframework-api.git
cd frausframework-api2. Install Dependencies
npm install3. Configure Environment Variables
Create a .env file in the root directory:
Add the following variables to your .env file:
4. Add Firebase Credentials
Copy the sample file and replace placeholders with your Firebase credentials:
Edit: serviceAccountKey.json
Running the API Locally
Start the server:
Access the API locally:
API Endpoints
1. Fetch Agent Details
Retrieve metadata for an AI agent.
GET /api/agent/:name
Request Example:
Response Example:
2. Interact with an Agent (GET Method)
Interact with an AI agent using a query parameter.
GET /api/agent/:name/interact?message=YourMessage
Request Example:
Response Example:
3. Interact with an Agent (POST Method)
Interact with an AI agent using a JSON payload.
POST /api/agent/:name/interact
Request Example:
Response Example:
Example Usage in Node.js
Here’s how you can interact with the API programmatically:
Last updated