recoder-shared
Version:
Shared types, utilities, and configurations for Recoder
42 lines • 2.21 kB
JavaScript
/**
* AI API Handler interfaces and types
* Shared across all Recoder apps
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.AIAuthenticationError = exports.AIRateLimitError = exports.AIApiError = exports.getModelMaxOutputTokens = exports.shouldUseReasoningEffort = exports.shouldUseReasoningBudget = exports.DEFAULT_HYBRID_REASONING_MODEL_THINKING_TOKENS = exports.DEFAULT_HYBRID_REASONING_MODEL_MAX_TOKENS = void 0;
// Re-export reasoning utilities
var reasoning_1 = require("./reasoning");
Object.defineProperty(exports, "DEFAULT_HYBRID_REASONING_MODEL_MAX_TOKENS", { enumerable: true, get: function () { return reasoning_1.DEFAULT_HYBRID_REASONING_MODEL_MAX_TOKENS; } });
Object.defineProperty(exports, "DEFAULT_HYBRID_REASONING_MODEL_THINKING_TOKENS", { enumerable: true, get: function () { return reasoning_1.DEFAULT_HYBRID_REASONING_MODEL_THINKING_TOKENS; } });
Object.defineProperty(exports, "shouldUseReasoningBudget", { enumerable: true, get: function () { return reasoning_1.shouldUseReasoningBudget; } });
Object.defineProperty(exports, "shouldUseReasoningEffort", { enumerable: true, get: function () { return reasoning_1.shouldUseReasoningEffort; } });
Object.defineProperty(exports, "getModelMaxOutputTokens", { enumerable: true, get: function () { return reasoning_1.getModelMaxOutputTokens; } });
// Cerebras model definitions are in cerebras.ts
// Error types
class AIApiError extends Error {
constructor(message, code, status, provider) {
super(message);
this.code = code;
this.status = status;
this.provider = provider;
this.name = 'AIApiError';
}
}
exports.AIApiError = AIApiError;
class AIRateLimitError extends AIApiError {
constructor(message, retryAfter) {
super(message, 'RATE_LIMIT', 429);
this.retryAfter = retryAfter;
this.name = 'AIRateLimitError';
}
}
exports.AIRateLimitError = AIRateLimitError;
class AIAuthenticationError extends AIApiError {
constructor(message) {
super(message, 'AUTHENTICATION', 401);
this.name = 'AIAuthenticationError';
}
}
exports.AIAuthenticationError = AIAuthenticationError;
//# sourceMappingURL=api.js.map
;