Class Memory

A memory class to store ai interactions

Export

Implements

Constructors

Properties

Methods

Constructors

Properties

data: Readonly<{
    content: string;
    role: "system";
} | {
    content: string;
    name?: string;
    role: "user";
} | {
    content: null | string;
    functionCalls?: {
        function: {
            arguments?: string | object;
            name: string;
        };
        id: string;
        type: "function";
    }[];
    name?: string;
    role: "assistant";
} | {
    content: string;
    functionId: string;
    role: "function";
}>[] = []
limit: number
sdata: Map<string, Readonly<{
    content: string;
    role: "system";
} | {
    content: string;
    name?: string;
    role: "user";
} | {
    content: null | string;
    functionCalls?: {
        function: {
            arguments?: string | object;
            name: string;
        };
        id: string;
        type: "function";
    }[];
    name?: string;
    role: "assistant";
} | {
    content: string;
    functionId: string;
    role: "function";
}>[]> = ...

Methods

  • Parameters

    • value: Readonly<Readonly<{
          content: string;
          role: "system";
      } | {
          content: string;
          name?: string;
          role: "user";
      } | {
          content: null | string;
          functionCalls?: {
              function: {
                  arguments?: string | object;
                  name: string;
              };
              id: string;
              type: "function";
          }[];
          name?: string;
          role: "assistant";
      } | {
          content: string;
          functionId: string;
          role: "function";
      }> | Readonly<{
          content: string;
          role: "system";
      } | {
          content: string;
          name?: string;
          role: "user";
      } | {
          content: null | string;
          functionCalls?: {
              function: {
                  arguments?: (...) | (...) | (...);
                  name: string;
              };
              id: string;
              type: "function";
          }[];
          name?: string;
          role: "assistant";
      } | {
          content: string;
          functionId: string;
          role: "function";
      }>[]>
    • Optional sessionId: string

    Returns void

  • Parameters

    • Optional sessionId: string

    Returns Readonly<{
        content: string;
        role: "system";
    } | {
        content: string;
        name?: string;
        role: "user";
    } | {
        content: null | string;
        functionCalls?: {
            function: {
                arguments?: string | object;
                name: string;
            };
            id: string;
            type: "function";
        }[];
        name?: string;
        role: "assistant";
    } | {
        content: string;
        functionId: string;
        role: "function";
    }>[]

  • Parameters

    • Optional sessionId: string

    Returns readonly Readonly<{
        content: string;
        role: "system";
    } | {
        content: string;
        name?: string;
        role: "user";
    } | {
        content: null | string;
        functionCalls?: {
            function: {
                arguments?: string | object;
                name: string;
            };
            id: string;
            type: "function";
        }[];
        name?: string;
        role: "assistant";
    } | {
        content: string;
        functionId: string;
        role: "function";
    }>[]

  • Parameters

    • Optional sessionId: string

    Returns readonly Readonly<{
        content: string;
        role: "system";
    } | {
        content: string;
        name?: string;
        role: "user";
    } | {
        content: null | string;
        functionCalls?: {
            function: {
                arguments?: string | object;
                name: string;
            };
            id: string;
            type: "function";
        }[];
        name?: string;
        role: "assistant";
    } | {
        content: string;
        functionId: string;
        role: "function";
    }>[]