@future-agi/sdk
Version:
We help GenAI teams maintain high-accuracy for their Models in production.
170 lines • 5.51 kB
TypeScript
/**
* Base exception for all SDK errors.
*/
declare class SDKException extends Error {
readonly customMessage?: string;
readonly cause?: Error;
constructor(message?: string, cause?: Error);
getMessage(): string;
getErrorCode(): string;
toString(): string;
}
/**
* Base exception for all dataset operations.
*/
declare class DatasetError extends SDKException {
getMessage(): string;
getErrorCode(): string;
}
/**
* Raised when a dataset cannot be found.
*/
declare class DatasetNotFoundError extends DatasetError {
getMessage(): string;
getErrorCode(): string;
}
/**
* Raised when authentication fails for dataset operations (e.g., invalid API key).
*/
declare class DatasetAuthError extends DatasetError {
getMessage(): string;
getErrorCode(): string;
}
/**
* Raised when input data fails validation.
*/
declare class DatasetValidationError extends DatasetError {
getMessage(): string;
getErrorCode(): string;
}
/**
* Raised when API rate limits are exceeded.
*/
declare class RateLimitError extends DatasetError {
getMessage(): string;
getErrorCode(): string;
}
/**
* Raised for server-side errors.
*/
declare class ServerError extends DatasetError {
getMessage(): string;
getErrorCode(): string;
}
/**
* Raised when the service is temporarily unavailable.
*/
declare class ServiceUnavailableError extends DatasetError {
getMessage(): string;
getErrorCode(): string;
}
/**
* Raised when required authentication credentials are missing.
*/
declare class MissingAuthError extends SDKException {
readonly missingApiKey: boolean;
readonly missingSecretKey: boolean;
constructor(fiApiKey?: string, fiSecretKey?: string, cause?: Error);
getMessage(): string;
getErrorCode(): string;
}
/**
* Exception raised when API authentication fails due to invalid credentials.
*/
declare class InvalidAuthError extends SDKException {
constructor(message?: string, cause?: Error);
getMessage(): string;
getErrorCode(): string;
}
declare class TemplateNotFound extends SDKException {
readonly templateName: string;
constructor(templateName: string, message?: string, cause?: Error);
getErrorCode(): string;
}
/**
* Exception raised when additional headers are invalid.
*/
declare class InvalidAdditionalHeaders extends SDKException {
readonly invalidHeaderNames: string[];
constructor(invalidHeaders: string[], cause?: Error);
getMessage(): string;
getErrorCode(): string;
}
/**
* Exception raised when the number of embeddings is invalid.
*/
declare class InvalidNumberOfEmbeddings extends SDKException {
readonly numberOfEmbeddings: number;
readonly maxEmbeddings: number;
constructor(numberOfEmbeddings: number, maxEmbeddings?: number, cause?: Error);
getMessage(): string;
getErrorCode(): string;
}
/**
* Exception raised when the value type is invalid.
*/
declare class InvalidValueType extends SDKException {
readonly valueName: string;
readonly value: unknown;
readonly correctType: string;
constructor(valueName: string, value: unknown, correctType: string, cause?: Error);
getMessage(): string;
getErrorCode(): string;
}
/**
* Exception raised when the supported type is invalid.
*/
declare class InvalidSupportedType extends SDKException {
readonly valueName: string;
readonly value: unknown;
readonly correctType: string;
constructor(valueName: string, value: unknown, correctType: string, cause?: Error);
getMessage(): string;
getErrorCode(): string;
}
/**
* Exception raised when a required key is missing.
*/
declare class MissingRequiredKey extends SDKException {
readonly fieldName: string;
readonly missingKey: string;
constructor(fieldName: string, missingKey: string, cause?: Error);
getErrorCode(): string;
}
/**
* Exception raised when required config for eval template is missing.
*/
declare class MissingRequiredConfigForEvalTemplate extends SDKException {
readonly missingKey: string;
readonly evalTemplateName: string;
constructor(missingKey: string, evalTemplateName: string, cause?: Error);
getErrorCode(): string;
}
/**
* Exception raised when a file is not found.
*/
declare class FileNotFoundException extends SDKException {
readonly filePath: string | string[];
constructor(filePath: string | string[], message?: string, cause?: Error);
private static generateMessage;
getErrorCode(): string;
}
/**
* Exception raised when a file type is not supported.
*/
declare class UnsupportedFileType extends SDKException {
readonly fileExt: string;
readonly fileName: string;
constructor(fileExt: string, fileName: string, message?: string, cause?: Error);
getErrorCode(): string;
}
/**
* Exception raised when a template already exists.
*/
declare class TemplateAlreadyExists extends SDKException {
readonly templateName: string;
constructor(templateName: string, message?: string, cause?: Error);
getErrorCode(): string;
}
export { SDKException, DatasetError, DatasetNotFoundError, DatasetAuthError, DatasetValidationError, RateLimitError, ServerError, ServiceUnavailableError, MissingAuthError, InvalidAuthError, InvalidAdditionalHeaders, InvalidNumberOfEmbeddings, InvalidValueType, InvalidSupportedType, MissingRequiredKey, MissingRequiredConfigForEvalTemplate, FileNotFoundException, UnsupportedFileType, TemplateAlreadyExists, TemplateNotFound };
//# sourceMappingURL=errors.d.ts.map