UNPKG

@promptbook/utils

Version:

Promptbook: Turn your company's scattered knowledge into AI ready books

202 lines (201 loc) 5.67 kB
import type { PipelineJson } from './pipeline/PipelineJson/PipelineJson'; import type { ExportJsonOptions } from './utils/serialization/exportJson'; /** * How is the model provider trusted? * * @public exported from `@promptbook/core` */ export declare const MODEL_TRUST_LEVELS: { readonly FULL: "Model is running on the local machine, training data and model weights are known, data are ethically sourced"; readonly OPEN: "Model is open source, training data and model weights are known"; readonly PARTIALLY_OPEN: "Model is open source, but training data and model weights are not (fully) known"; readonly CLOSED_LOCAL: "Model can be run locally, but it is not open source"; readonly CLOSED_FREE: "Model is behind API gateway but free to use"; readonly CLOSED_BUSINESS: "Model is behind API gateway and paid but has good SLA, TOS, privacy policy and in general is a good to use in business applications"; readonly CLOSED: "Model is behind API gateway and paid"; readonly UNTRUSTED: "Model has questions about the training data and ethics, but it is not known if it is a problem or not"; readonly VURNABLE: "Model has some known serious vulnerabilities, leaks, ethical problems, etc."; }; /** * How is the model provider important? * * @public exported from `@promptbook/core` */ export declare const MODEL_ORDERS: { /** * Top-tier models, e.g. OpenAI, Anthropic,... */ readonly TOP_TIER: 333; /** * Mid-tier models, e.g. Llama, Mistral, etc. */ readonly NORMAL: 100; /** * Low-tier models, e.g. Phi, Tiny, etc. */ readonly LOW_TIER: 0; }; /** * Order of keys in the pipeline JSON * * @public exported from `@promptbook/core` */ export declare const ORDER_OF_PIPELINE_JSON: ExportJsonOptions<PipelineJson>['order']; /** * Nonce which is used for replacing things in strings * * @private within the repository */ export declare const REPLACING_NONCE = "ptbkauk42kV2dzao34faw7FudQUHYPtW"; /** * Nonce which is used as string which is not occurring in normal text * * @private within the repository */ export declare const SALT_NONCE = "ptbkghhewbvruets21t54et5"; /** * Placeholder value indicating a parameter is missing its value. * * @private within the repository */ export declare const RESERVED_PARAMETER_MISSING_VALUE: string; /** * Placeholder value indicating a parameter is restricted and cannot be used directly. * * @private within the repository */ export declare const RESERVED_PARAMETER_RESTRICTED: string; /** * The names of the parameters that are reserved for special purposes * * @public exported from `@promptbook/core` */ export declare const RESERVED_PARAMETER_NAMES: readonly ["content", "context", "knowledge", "examples", "modelName", "currentDate"]; /** * Limits for IDs, names, and other strings * * @public exported from `@promptbook/core` */ export declare const LIMITS: { /** * Minimum length of a name (e.g. agent name, persona name) */ readonly NAME_MIN_LENGTH: 3; /** * Recommended maximum length of a name */ readonly NAME_MAX_LENGTH: 20; /** * Maximum length of a short description or a hash */ readonly SHORT_TEXT_MAX_LENGTH: 30; /** * Gone */ readonly GONE: 410; /** * Gateway timeout */ readonly GATEWAY_TIMEOUT: 504; /** * Too many requests */ readonly TOO_MANY_REQUESTS: 429; /** * Maximum length of a file path segment */ readonly FILE_PATH_SEGMENT_MAX_LENGTH: 8; /** * Default length of a short name (e.g. for default agent names) */ readonly SHORT_NAME_LENGTH: 6; }; /** * Common time intervals in milliseconds * * @public exported from `@promptbook/core` */ export declare const TIME_INTERVALS: { /** * One second in milliseconds */ readonly SECOND: 1000; /** * Two seconds in milliseconds */ readonly TWO_SECONDS: 2000; /** * One minute in milliseconds */ readonly MINUTE: 60000; /** * Thirty seconds in milliseconds */ readonly THIRTY_SECONDS: 30000; /** * Five seconds in milliseconds */ readonly FIVE_SECONDS: 5000; }; /** * Common ports and network limits * * @public exported from `@promptbook/core` */ export declare const NETWORK_LIMITS: { /** * Maximum valid port number */ readonly MAX_PORT: 65535; }; /** * Common color and image constants * * @public exported from `@promptbook/core` */ export declare const COLOR_CONSTANTS: { /** * Maximum value for a color channel (0-255) */ readonly MAX_CHANNEL_VALUE: 255; /** * Number of possible colors in 24-bit color (0xFFFFFF) */ readonly MAX_24BIT_COLOR: 16777215; /** * Base for hexadecimal strings */ readonly HEX_BASE: 16; /** * Length of a hex color without alpha (e.g. "FF0000") */ readonly HEX_COLOR_LENGTH: 6; /** * Full circle in degrees */ readonly FULL_CIRCLE_DEGREES: 360; /** * Half circle in degrees */ readonly HALF_CIRCLE_DEGREES: 180; }; /** * HTTP Status Codes * * @public exported from `@promptbook/core` */ export declare const HTTP_STATUS_CODES: { readonly OK: 200; readonly CREATED: 201; readonly BAD_REQUEST: 400; readonly UNAUTHORIZED: 401; readonly NOT_FOUND: 404; readonly INTERNAL_SERVER_ERROR: 500; readonly BAD_GATEWAY: 502; readonly SERVICE_UNAVAILABLE: 503; readonly GATEWAY_TIMEOUT: 504; readonly TOO_MANY_REQUESTS: 429; }; /** * Note: [💞] Ignore a discrepancy between file name and entity name */