UNPKG

ravendb

Version:
58 lines 2.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MistralAiSettings = void 0; const AbstractAiSettings_js_1 = require("./AbstractAiSettings.js"); const AiSettingsCompareDifferences_js_1 = require("../AiSettingsCompareDifferences.js"); const StringUtil_js_1 = require("../../../../../Utility/StringUtil.js"); /** * Settings for Mistral AI service. */ class MistralAiSettings extends AbstractAiSettings_js_1.AbstractAiSettings { /** * The model ID for the Mistral AI service. */ model; /** * The endpoint for the Mistral AI service. */ endpoint; /** * The API key required for accessing the Mistral AI service. */ apiKey; constructor(model, apiKey, endpoint) { super(); this.model = model; this.endpoint = endpoint; this.apiKey = apiKey; } validate(errors) { if (StringUtil_js_1.StringUtil.isNullOrWhitespace(this.model)) { errors.push("Value of 'model' field cannot be empty."); } if (StringUtil_js_1.StringUtil.isNullOrWhitespace(this.endpoint)) { errors.push("Value of 'endpoint' field cannot be empty."); } if (StringUtil_js_1.StringUtil.isNullOrWhitespace(this.apiKey)) { errors.push("Value of 'apiKey' field cannot be empty."); } } compare(other) { if (!(other instanceof MistralAiSettings)) { return AiSettingsCompareDifferences_js_1.AiSettingsCompareDifferences.All; } let differences = AiSettingsCompareDifferences_js_1.AiSettingsCompareDifferences.None; if (this.model !== other.model) { differences |= AiSettingsCompareDifferences_js_1.AiSettingsCompareDifferences.ModelArchitecture; } if (this.endpoint !== other.endpoint) { differences |= AiSettingsCompareDifferences_js_1.AiSettingsCompareDifferences.EndpointConfiguration; } if (this.apiKey !== other.apiKey) { differences |= AiSettingsCompareDifferences_js_1.AiSettingsCompareDifferences.AuthenticationSettings; } return differences; } } exports.MistralAiSettings = MistralAiSettings; //# sourceMappingURL=MistralAiSettings.js.map