Interface AIMemory

interface AIMemory {
    add(result, sessionId?): void;
    addResult(result, sessionId?): void;
    history(sessionId?): 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";
    }>[];
    peek(sessionId?): 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";
    }>[];
    reset(sessionId?): void;
}

Implemented by

Methods

  • Parameters

    • result: 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 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 void