openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
34 lines (33 loc) • 1.42 kB
JavaScript
import { r as createLazyRuntimeModule } from "../../lazy-runtime-CJrzFzqU.mjs";
import { o as optionalPositiveIntegerSchema } from "../../typebox-CIc89Etv.mjs";
import "../../channel-actions-CBUooQ_G.mjs";
import { t as defineToolPlugin } from "../../tool-plugin-a8bhio4b.mjs";
import { t as llmTaskToolDefinition } from "../../llm-task-tool-definition-BuRpA4nF.mjs";
import { Type } from "typebox";
//#region extensions/llm-task/index.ts
function createLazyLlmTaskTool(api) {
const loadTool = createLazyRuntimeModule(() => import("../../llm-task-tool-Bwy-iNVZ.mjs").then(({ createLlmTaskTool }) => createLlmTaskTool(api)));
return {
...llmTaskToolDefinition,
execute: async (id, params, signal) => await (await loadTool()).execute(id, params, signal)
};
}
var llm_task_default = defineToolPlugin({
id: "llm-task",
name: "LLM Task",
description: "Generic JSON-only LLM tool for structured tasks callable from workflows.",
configSchema: Type.Object({
defaultProvider: Type.Optional(Type.String()),
defaultModel: Type.Optional(Type.String()),
defaultAuthProfileId: Type.Optional(Type.String()),
maxTokens: optionalPositiveIntegerSchema(),
timeoutMs: optionalPositiveIntegerSchema()
}, { additionalProperties: false }),
tools: (tool) => [tool({
...llmTaskToolDefinition,
optional: true,
factory: ({ api }) => createLazyLlmTaskTool(api)
})]
});
//#endregion
export { llm_task_default as default };