@xynehq/jaf
Version:
Juspay Agent Framework - A purely functional agent framework with immutable state and composable tools
56 lines • 1.87 kB
JavaScript
/**
* JAF ADK - Production Tools Collection
*
* Export all production-ready tools
*/
export { createWeatherTool } from './weather';
export { createNewsTool } from './news';
export { createGeocodingTool } from './geocoding';
// Re-export existing tools
export { createCalculatorTool, createFunctionTool, createOpenAPIToolset, validateTool, executeTools } from '../tools';
// Production tool presets
import { createWeatherTool } from './weather';
import { createNewsTool } from './news';
import { createGeocodingTool } from './geocoding';
import { createCalculatorTool } from '../tools';
/**
* Get a collection of production-ready tools
* @param options Configuration options for tools
*/
export const getProductionTools = (options) => {
const tools = [];
// Weather tool (always included)
tools.push(createWeatherTool(options?.weatherApiKey));
// News tool (always included)
tools.push(createNewsTool(options?.newsApiKey));
// Geocoding tool (optional, default true)
if (options?.includeGeocoding !== false) {
tools.push(createGeocodingTool());
}
// Calculator tool (optional, default true)
if (options?.includeCalculator !== false) {
tools.push(createCalculatorTool());
}
return tools;
};
/**
* Create a production-ready agent with common tools
*/
export const createProductionAgent = (name, model, instruction, options) => {
const tools = getProductionTools({
weatherApiKey: options?.weatherApiKey,
newsApiKey: options?.newsApiKey
});
if (options?.additionalTools) {
tools.push(...options.additionalTools);
}
// Import createAgent locally to avoid circular dependency
const { createAgent } = require('../agents');
return createAgent({
name,
model,
instruction,
tools
});
};
//# sourceMappingURL=production.js.map