@jeanmemory/react
Version:
React SDK for Jean Memory - Build personalized AI chatbots in 5 lines of code
48 lines (47 loc) • 1.44 kB
TypeScript
/**
* Jean Memory React SDK - Provider Component
* Manages authentication state and API client
*/
import { ReactNode } from 'react';
export interface JeanUser {
user_id: string;
email: string;
name?: string;
access_token: string;
}
export interface JeanMessage {
id: string;
role: 'user' | 'assistant';
content: string;
timestamp: Date;
}
interface JeanContextValue {
isAuthenticated: boolean;
isLoading: boolean;
user: JeanUser | null;
messages: JeanMessage[];
error: string | null;
signIn: () => void;
signOut: () => void;
sendMessage: (message: string, options?: MessageOptions) => Promise<void>;
storeDocument: (title: string, content: string) => Promise<void>;
connect: (service: 'notion' | 'slack' | 'gdrive') => void;
clearConversation: () => void;
setUser: (user: JeanUser) => void;
tools: {
add_memory: (content: string) => Promise<any>;
search_memory: (query: string) => Promise<any>;
};
}
export interface MessageOptions {
speed?: 'fast' | 'balanced' | 'comprehensive';
tool?: 'jean_memory' | 'search_memory';
format?: 'simple' | 'enhanced';
}
interface JeanProviderProps {
apiKey: string;
children: ReactNode;
}
export declare function JeanProvider({ apiKey, children }: JeanProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useJean(): JeanContextValue;
export {};