@openclueo/sdk
Version:
Official JavaScript SDK for Clueo AI Personality API with Big Five model integration
123 lines (110 loc) • 3.78 kB
TypeScript
declare module '@openclueo/sdk' {
export interface BigFiveConfig {
/** Openness to experience (1-10): creativity, curiosity, and openness to new ideas */
openness?: number;
/** Conscientiousness (1-10): organization, discipline, and goal-oriented behavior */
conscientiousness?: number;
/** Extraversion (1-10): outgoing, social, and energetic behavior */
extraversion?: number;
/** Agreeableness (1-10): cooperation, trust, and empathy */
agreeableness?: number;
/** Neuroticism (1-10): emotional stability vs. anxiety and moodiness */
neuroticism?: number;
/** Optional: Your own OpenAI API key for BYOK (Bring Your Own Key) */
openaiKey?: string;
}
export interface ClueOptions {
/** Base URL for the Clueo API (default: https://backend.clueoai.com) */
baseUrl?: string;
/** Request timeout in milliseconds (default: 10000) */
timeout?: number;
}
export interface InjectResult {
/** The original prompt with personality injected */
injected_prompt: string;
/** The personality configuration used */
personality_config: BigFiveConfig;
/** API usage information */
usage?: any;
/** Timestamp of the request */
timestamp: string;
}
export interface SimulateResult {
/** The original user message */
original_message: string;
/** The AI response with personality */
response: string;
/** The personality configuration used */
personality_config: BigFiveConfig;
/** API usage information */
usage?: any;
/** Timestamp of the request */
timestamp: string;
}
export interface TransformResult {
/** Original message */
original: string;
/** Transformed message */
transformed: string;
/** Tone used for transformation */
tone: string;
/** API usage information */
usage?: any;
/** Additional metadata */
meta?: any;
}
export interface BatchTransformItem {
message: string;
tone: string;
}
export interface BatchTransformResult {
success: boolean;
original?: string;
transformed?: string;
tone?: string;
usage?: any;
meta?: any;
error?: string;
}
export default class Clueo {
/**
* Create a new Clueo SDK instance
* @param apiKey Your Clueo API key (starts with 'ck_')
* @param options Optional configuration
*/
constructor(apiKey: string, options?: ClueOptions);
/**
* Inject personality into a prompt using the Big Five model
* @param prompt The prompt to inject personality into
* @param options Big Five personality configuration (1-10 scale)
* @returns Promise with injected prompt result
*/
inject(prompt: string, options?: BigFiveConfig): Promise<InjectResult>;
/**
* Simulate a conversation response with personality
* @param message The user message to respond to
* @param options Big Five personality configuration (1-10 scale)
* @returns Promise with simulated response
*/
simulate(message: string, options?: BigFiveConfig): Promise<SimulateResult>;
/**
* Transform a message with AI personality (legacy method)
* @param message The message to transform
* @param tone Personality tone ('Professional', 'Sarcastic', 'Empathetic')
* @returns Promise with transformation result
*/
transform(message: string, tone?: string): Promise<TransformResult>;
/**
* Batch transform multiple messages
* @param messages Array of message and tone objects
* @returns Promise with array of transformation results
*/
batchTransform(messages: BatchTransformItem[]): Promise<BatchTransformResult[]>;
}
}
declare global {
interface Window {
Clueo: typeof Clueo;
}
}
export = Clueo;