jorel
Version:
A unified wrapper for working with LLMs from multiple providers, including streams, images, documents & automatic tool use.
19 lines (18 loc) • 784 B
TypeScript
export type MessageIdGeneratorFunction = (params: {
timestamp: number;
}) => string;
export type MessageIdGenerator = "ulid" | "uuidv4" | "uuidv7" | MessageIdGeneratorFunction;
/**
* Resolves a MessageIdGenerator to a function that generates unique IDs
*/
export declare const resolveIdGenerator: (generator: MessageIdGenerator) => MessageIdGeneratorFunction;
/**
* Default unique ID generator (uuidv7)
*/
export declare const generateUniqueId: (timestamp?: number) => string;
/**
* Generate a unique ID using the specified generator
* @param generator - The generator to use (defaults to uuidv7)
* @param role - The role of the message (used by custom generators)
*/
export declare const generateMessageId: (generator?: MessageIdGenerator, timestamp?: number) => string;