UNPKG

@llumiverse/common

Version:

Public types, enums and options used by Llumiverse API.

34 lines 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAnthropicOptions = getAnthropicOptions; const types_js_1 = require("../types.js"); const fallback_js_1 = require("./fallback.js"); const shared_parsing_js_1 = require("./shared-parsing.js"); const version_parsing_js_1 = require("./version-parsing.js"); function getAnthropicOptions(model, option) { const max_tokens_limit = (0, shared_parsing_js_1.getClaudeMaxTokensLimit)(model); const excludeOptions = ["max_tokens", "presence_penalty", "frequency_penalty"]; let commonOptions = fallback_js_1.textOptionsFallback.options.filter((o) => !excludeOptions.includes(o.name)); const hasSamplingRestriction = (0, version_parsing_js_1.hasSamplingParameterRestriction)(model); if (hasSamplingRestriction) { commonOptions = commonOptions.filter((o) => o.name !== types_js_1.SharedOptions.temperature && o.name !== types_js_1.SharedOptions.top_p && o.name !== "top_k"); } return { _option_id: "anthropic-claude", options: [ { name: types_js_1.SharedOptions.max_tokens, type: types_js_1.OptionType.numeric, min: 1, max: max_tokens_limit, integer: true, step: 200, description: "The maximum number of tokens to generate", }, ...commonOptions, ...(0, shared_parsing_js_1.buildClaudeEffortOptions)(model), ...(0, shared_parsing_js_1.buildClaudeThinkingBudgetOption)(model), ...(0, shared_parsing_js_1.buildClaudeIncludeThoughtsOption)(model), ...(0, shared_parsing_js_1.buildClaudeCacheOptions)(), ...(0, shared_parsing_js_1.buildClaudeCacheTtlOptions)(option?.cache_enabled), ], }; } //# sourceMappingURL=anthropic.js.map