@unified-llm/core
Version:
Unified LLM interface.
48 lines • 1.6 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.callAnotherClient = void 0;
const llm_client_1 = require("../llm-client");
const _1 = __importDefault(require("."));
exports.callAnotherClient = {
type: 'function',
function: {
name: 'callAnotherClient',
description: 'Call another LLM client with specified ID and thread',
parameters: {
type: 'object',
properties: {
id: {
type: 'string',
description: 'The ID of the LLM client to call'
},
threadId: {
type: 'string',
description: 'The thread ID for the conversation'
}
},
required: ['id', 'threadId']
}
},
handler: async (args) => {
const client = new llm_client_1.LLMClient({
id: args.id,
provider: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY || '',
tools: _1.default,
});
const response = await client.chat({
messages: [{
id: 'msg-1',
role: 'user',
content: [{ type: 'text', text: '' }],
created_at: new Date()
}],
model: 'claude-3-haiku-20240307'
});
return response;
}
};
//# sourceMappingURL=callAnotherClient.js.map