langchain.js
    Preparing search index...

    Hierarchy

    • BaseClient
      • AssistantsClient
    Index

    Constructors

    Properties

    apiUrl: string
    asyncCaller: AsyncCaller
    defaultHeaders: Record<string, HeaderValue>
    onRequest?: RequestHook
    timeoutMs: undefined | number

    Methods

    • Count assistants matching filters.

      Parameters

      • Optionalquery: { graphId?: string; metadata?: Metadata }
        • OptionalgraphId?: string

          Optional graph id to filter by.

        • Optionalmetadata?: Metadata

          Metadata to filter by. Exact match for each key/value.

      Returns Promise<number>

      Number of assistants matching the criteria.

    • Create a new assistant.

      Parameters

      • payload: {
            assistantId?: string;
            config?: Config;
            context?: unknown;
            description?: string;
            graphId: string;
            ifExists?: OnConflictBehavior;
            metadata?: Metadata;
            name?: string;
        }

        Payload for creating an assistant.

      Returns Promise<Assistant>

      The created assistant.

    • Delete an assistant.

      Parameters

      • assistantId: string

        ID of the assistant.

      Returns Promise<void>

    • Type Parameters

      • T

      Parameters

      • path: string
      • options: RequestInit & {
            json?: unknown;
            params?: Record<string, unknown>;
            signal?: AbortSignal;
            timeoutMs?: null | number;
            withResponse: true;
        }

      Returns Promise<[T, Response]>

    • Type Parameters

      • T

      Parameters

      • path: string
      • Optionaloptions: RequestInit & {
            json?: unknown;
            params?: Record<string, unknown>;
            signal?: AbortSignal;
            timeoutMs?: null | number;
            withResponse?: false;
        }

      Returns Promise<T>

    • Get an assistant by ID.

      Parameters

      • assistantId: string

        The ID of the assistant.

      Returns Promise<Assistant>

      Assistant

    • Get the JSON representation of the graph assigned to a runnable

      Parameters

      • assistantId: string

        The ID of the assistant.

      • Optionaloptions: { xray?: number | boolean }
        • Optionalxray?: number | boolean

          Whether to include subgraphs in the serialized graph representation. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.

      Returns Promise<AssistantGraph>

      Serialized graph

    • Get the state and config schema of the graph assigned to a runnable

      Parameters

      • assistantId: string

        The ID of the assistant.

      Returns Promise<GraphSchema>

      Graph schema

    • Get the schemas of an assistant by ID.

      Parameters

      • assistantId: string

        The ID of the assistant to get the schema of.

      • Optionaloptions: { namespace?: string; recurse?: boolean }

        Additional options for getting subgraphs, such as namespace or recursion extraction.

      Returns Promise<Subgraphs>

      The subgraphs of the assistant.

    • List all versions of an assistant.

      Parameters

      • assistantId: string

        ID of the assistant.

      • Optionalpayload: { limit?: number; metadata?: Metadata; offset?: number }

      Returns Promise<AssistantVersion[]>

      List of assistant versions.

    • Parameters

      • path: string
      • Optionaloptions: RequestInit & {
            json?: unknown;
            params?: Record<string, unknown>;
            timeoutMs?: null | number;
            withResponse?: boolean;
        }

      Returns [url: URL, init: RequestInit]

    • List assistants.

      Parameters

      • Optionalquery: {
            graphId?: string;
            limit?: number;
            metadata?: Metadata;
            offset?: number;
            select?: AssistantSelectField[];
            sortBy?: AssistantSortBy;
            sortOrder?: SortOrder;
        }

        Query options.

      Returns Promise<Assistant[]>

      List of assistants.

    • Change the version of an assistant.

      Parameters

      • assistantId: string

        ID of the assistant.

      • version: number

        The version to change to.

      Returns Promise<Assistant>

      The updated assistant.

    • Update an assistant.

      Parameters

      • assistantId: string

        ID of the assistant.

      • payload: {
            config?: Config;
            context?: unknown;
            description?: string;
            graphId?: string;
            metadata?: Metadata;
            name?: string;
        }

        Payload for updating the assistant.

      Returns Promise<Assistant>

      The updated assistant.