@redocly/theme
Version:
Shared UI components lib
64 lines • 2.9 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TOOL_CALL_DISPLAY_TEXT = exports.SEARCH_DEBOUNCE_TIME_MS = exports.AI_SEARCH_MAX_MESSAGE_LENGTH = exports.AI_SEARCH_ERROR_CONFIG = exports.AiSearchConversationRole = exports.AiSearchError = void 0;
const search_1 = require("../types/search");
var AiSearchError;
(function (AiSearchError) {
AiSearchError["Unauthorized"] = "ai_search_unauthorized";
AiSearchError["Forbidden"] = "ai_search_forbidden";
AiSearchError["HttpRequestFailed"] = "http_request_in_failed_status";
AiSearchError["EmptyResponse"] = "empty_response";
AiSearchError["ErrorProcessingResponse"] = "error_processing_response";
})(AiSearchError || (exports.AiSearchError = AiSearchError = {}));
exports.AiSearchConversationRole = {
USER: 'user',
ASSISTANT: 'assistant',
};
const defaultErrorConfig = {
headerKey: 'search.ai.error.header',
headerDefault: 'Oops! Something went wrong.',
messageKey: 'search.ai.error.description',
messageDefault: 'We encountered an issue while processing your search. Try again later or refine your query. If the problem persists, please contact Redocly support.',
};
exports.AI_SEARCH_ERROR_CONFIG = {
[AiSearchError.Forbidden]: {
headerKey: 'search.ai.error.header.forbidden',
headerDefault: 'Feature Unavailable',
messageKey: 'search.ai.error.description.forbidden',
messageDefault: 'AI Search is currently unavailable.',
},
[AiSearchError.Unauthorized]: {
headerKey: 'search.ai.error.header.unauthorized',
headerDefault: 'Authentication Required',
messageKey: 'search.ai.error.description.unauthorized',
messageDefault: 'You are not authorized to use AI Search.',
},
[AiSearchError.HttpRequestFailed]: defaultErrorConfig,
[AiSearchError.EmptyResponse]: defaultErrorConfig,
[AiSearchError.ErrorProcessingResponse]: defaultErrorConfig,
};
exports.AI_SEARCH_MAX_MESSAGE_LENGTH = 45000;
exports.SEARCH_DEBOUNCE_TIME_MS = 300;
exports.TOOL_CALL_DISPLAY_TEXT = {
[search_1.ToolCallName.SearchDocumentation]: {
inProgressText: 'Searching documentation...',
completedText: 'Search completed',
},
[search_1.ToolCallName.ListApis]: {
inProgressText: 'Browsing APIs...',
completedText: 'Browsed APIs',
},
[search_1.ToolCallName.GetEndpoints]: {
inProgressText: 'Browsing endpoints for API...',
completedText: 'Browsed endpoints for API',
},
[search_1.ToolCallName.GetSecuritySchemes]: {
inProgressText: 'Browsing security schemes for API...',
completedText: 'Browsed security schemes for API',
},
[search_1.ToolCallName.GetFullApiDescription]: {
inProgressText: 'Reading API description...',
completedText: 'Read API description',
},
};
//# sourceMappingURL=search.js.map