recallrai
Version:
Official Node.js SDK for RecallrAI - Revolutionary contextual memory system that enables AI assistants to form meaningful connections between conversations, just like human memory.
66 lines (65 loc) • 3.06 kB
TypeScript
/**
* Merge conflict management functionality for the RecallrAI SDK.
*/
import { HTTPClient } from "./utils";
import { MergeConflictModel, MergeConflictStatus, MergeConflictAnswer, MergeConflictConflictingMemory, MergeConflictNewMemory, MergeConflictQuestion } from "./models";
/**
* Represents a merge conflict in the RecallrAI system.
*
* This class provides methods for inspecting and resolving merge conflicts
* that occur when new memories conflict with existing ones.
*/
export declare class MergeConflict {
private http;
private conflictData;
readonly userId: string;
conflictId: string;
status: MergeConflictStatus;
proposedMemoryContent?: string;
newMemories?: MergeConflictNewMemory[];
conflictingMemories: MergeConflictConflictingMemory[];
clarifyingQuestions: MergeConflictQuestion[];
createdAt: Date;
resolvedAt?: Date;
resolutionData?: Record<string, any>;
/**
* Initialize a merge conflict.
*
* @param httpClient - HTTP client for API communication.
* @param userId - User ID who owns this conflict.
* @param conflictData - Merge conflict data model.
*/
constructor(httpClient: HTTPClient, userId: string, conflictData: MergeConflictModel);
/**
* Resolve this merge conflict by providing answers to clarifying questions.
*
* @param answers - List of answers to the clarifying questions.
* @throws {UserNotFoundError} If the user is not found.
* @throws {MergeConflictNotFoundError} If the merge conflict is not found.
* @throws {MergeConflictAlreadyResolvedError} If the conflict is already resolved.
* @throws {MergeConflictInvalidQuestionsError} If the provided questions don't match the original questions.
* @throws {MergeConflictMissingAnswersError} If not all required questions have been answered.
* @throws {MergeConflictInvalidAnswerError} If an answer is not a valid option for its question.
* @throws {ValidationError} If the answers are invalid.
* @throws {AuthenticationError} If the API key or project ID is invalid.
* @throws {InternalServerError} If the server encounters an error.
* @throws {NetworkError} If there are network issues.
* @throws {TimeoutError} If the request times out.
* @throws {RecallrAIError} For other API-related errors.
*/
resolve(answers: MergeConflictAnswer[]): Promise<void>;
/**
* Refresh this merge conflict's data from the API.
*
* @throws {UserNotFoundError} If the user is not found.
* @throws {MergeConflictNotFoundError} If the merge conflict is not found.
* @throws {AuthenticationError} If the API key or project ID is invalid.
* @throws {InternalServerError} If the server encounters an error.
* @throws {NetworkError} If there are network issues.
* @throws {TimeoutError} If the request times out.
* @throws {RecallrAIError} For other API-related errors.
*/
refresh(): Promise<void>;
private parseMergeConflictResponse;
toString(): string;
}