solace-agent-mesh-js
v0.0.3
Published
Javascript SDK to create agents for solace-agent-mesh
Maintainers
Readme
Solace-Agent-Mesh Agent JS SDK
This is a JavaScript SDK for creating agents for the Solace-Agent-Mesh.
Supported Features:
| Feature | Supported | |---------|-----------| | Agent Registration | ✅ | | Adding Actions | ✅ | | File Response | ❌ | | LLM Request | ❌ | | Embedding Request | ❌ | | Middlewares | ❌ | | FileService Access | ❌ |
Usage Example - Weather Agent
This agent provides weather information using the weatherapi.com API.
Check example.ts for the full code.
Setup
Clone this repository
Install dependencies: (requires NodeJS version 20.0 or higher)
npm installSet your Weather API key as an environment variable:
export WEATHER_API_KEY="your_api_key_here"Or create a
.envfile in the root directory:WEATHER_API_KEY=your_api_key_hereStart the agent:
cd sam-js-sdk ts-node example.ts
Available Actions
getWeather
Gets the current weather for a location.
Parameters:
location: The location to get weather for (city name, zip code, coordinates, etc.)
Example:
{
"location": "San Francisco, CA"
}getForecast
Gets a multi-day weather forecast for a location.
Parameters:
location: The location to get forecast fordays: Number of forecast days (1-10, default: 3)
Example:
{
"location": "San Francisco, CA",
"days": 5
}