UNPKG

@genkit-ai/anthropic

Version:

Genkit AI framework plugin for Anthropic APIs.

55 lines 1.9 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var list_exports = {}; __export(list_exports, { listActions: () => listActions }); module.exports = __toCommonJS(list_exports); var import_plugin = require("genkit/plugin"); var import_models = require("./models.js"); async function listActions(client) { const clientModels = (await client.beta.models.list()).data; const seenNames = /* @__PURE__ */ new Set(); return clientModels.filter((modelInfo) => { const modelId = modelInfo.id; if (!modelId) { return false; } const ref = (0, import_models.claudeModelReference)(modelId); const name = ref.name; if (seenNames.has(name)) { return false; } seenNames.add(name); return true; }).map((modelInfo) => { const modelId = modelInfo.id; const ref = (0, import_models.claudeModelReference)(modelId); return (0, import_plugin.modelActionMetadata)({ name: ref.name, info: ref.info, configSchema: ref.configSchema }); }); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { listActions }); //# sourceMappingURL=list.js.map