Interface AssistantsAPI

interface AssistantsAPI {
    clearCache: () => void;
    createAssistant: (
        body: CreateAssistant,
        options?: ApiCallOptions,
    ) => Promise<CreateAssistantHttpResponse>;
    createAssistantStarter: (
        assistantId: string,
        body: CreateStarter,
        options?: ApiCallOptions,
    ) => Promise<CreateAssistantStarterHttpResponse>;
    createAssistantThread: (
        assistantId: string,
        body: CreateThread,
        options?: ApiCallOptions,
    ) => Promise<CreateAssistantThreadHttpResponse>;
    createAssistantThreadInteraction: (
        assistantId: string,
        threadId: string,
        body: CreateInteraction,
        options?: ApiCallOptions,
    ) => Promise<CreateAssistantThreadInteractionHttpResponse>;
    createAssistantThreadInteractionFeedback: (
        assistantId: string,
        threadId: string,
        interactionId: string,
        body: CreateFeedback,
        options?: ApiCallOptions,
    ) => Promise<CreateAssistantThreadInteractionFeedbackHttpResponse>;
    createAssistantThreadInteractionReview: (
        assistantId: string,
        threadId: string,
        interactionId: string,
        body: CreateReview,
        options?: ApiCallOptions,
    ) => Promise<CreateAssistantThreadInteractionReviewHttpResponse>;
    deleteAssistant: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteAssistantHttpResponse>;
    deleteAssistantStarter: (
        assistantId: string,
        starterId: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteAssistantStarterHttpResponse>;
    deleteAssistantStarterFollowup: (
        assistantId: string,
        starterId: string,
        followupId: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteAssistantStarterFollowupHttpResponse>;
    deleteAssistantThread: (
        assistantid: string,
        threadid: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteAssistantThreadHttpResponse>;
    deleteAssistantThreadInteraction: (
        assistantId: string,
        threadId: string,
        interactionId: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteAssistantThreadInteractionHttpResponse>;
    getAssistant: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<GetAssistantHttpResponse>;
    getAssistantFeedback: (
        assistantId: string,
        options?: ApiCallOptions,
    ) => Promise<GetAssistantFeedbackHttpResponse>;
    getAssistants: (
        query: {
            countTotal?: boolean;
            limit?: number;
            next?: string;
            prev?: string;
            sort?:
                | "NAME"
                | "-NAME"
                | "DESCRIPTION"
                | "-DESCRIPTION"
                | "CREATED"
                | "-CREATED"
                | "UPDATED"
                | "-UPDATED";
        },
        options?: ApiCallOptions,
    ) => Promise<GetAssistantsHttpResponse>;
    getAssistantSources: (
        assistantId: string,
        body: ChunksRefs,
        options?: ApiCallOptions,
    ) => Promise<GetAssistantSourcesHttpResponse>;
    getAssistantStarter: (
        assistantId: string,
        starterId: string,
        options?: ApiCallOptions,
    ) => Promise<GetAssistantStarterHttpResponse>;
    getAssistantStarters: (
        assistantId: string,
        query: {
            limit?: number;
            next?: string;
            prev?: string;
            sort?:
                | "CREATED"
                | "-CREATED"
                | "UPDATED"
                | "-UPDATED"
                | "QUESTION"
                | "-QUESTION";
        },
        options?: ApiCallOptions,
    ) => Promise<GetAssistantStartersHttpResponse>;
    getAssistantThread: (
        assistantid: string,
        threadid: string,
        options?: ApiCallOptions,
    ) => Promise<GetAssistantThreadHttpResponse>;
    getAssistantThreadInteraction: (
        assistantId: string,
        threadId: string,
        interactionId: string,
        options?: ApiCallOptions,
    ) => Promise<GetAssistantThreadInteractionHttpResponse>;
    getAssistantThreadInteractions: (
        assistantId: string,
        threadId: string,
        query: {
            limit?: number;
            next?: string;
            prev?: string;
            sort?: "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED";
        },
        options?: ApiCallOptions,
    ) => Promise<GetAssistantThreadInteractionsHttpResponse>;
    getAssistantThreads: (
        assistantId: string,
        query: {
            filter?: string;
            limit?: number;
            next?: string;
            prev?: string;
            sort?: "NAME" | "-NAME" | "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED";
        },
        options?: ApiCallOptions,
    ) => Promise<GetAssistantThreadsHttpResponse>;
    invokeAssistantThread: (
        assistantId: string,
        threadId: string,
        body: PromptInput,
        options?: ApiCallOptions,
    ) => Promise<InvokeAssistantThreadHttpResponse>;
    patchAssistant: (
        id: string,
        body: JSONPatchArray,
        options?: ApiCallOptions,
    ) => Promise<PatchAssistantHttpResponse>;
    patchAssistantThread: (
        assistantid: string,
        threadid: string,
        body: ThreadPatchArray,
        options?: ApiCallOptions,
    ) => Promise<PatchAssistantThreadHttpResponse>;
    patchAssistantThreadInteractionFeedback: (
        assistantId: string,
        threadId: string,
        interactionId: string,
        feedbackId: string,
        body: FeedbackPatchArray,
        options?: ApiCallOptions,
    ) => Promise<PatchAssistantThreadInteractionFeedbackHttpResponse>;
    streamAssistantThread: (
        assistantId: string,
        threadId: string,
        body: PromptInput,
        options?: ApiCallOptions,
    ) => Promise<StreamAssistantThreadHttpResponse>;
    updateAssistantStarter: (
        assistantId: string,
        starterId: string,
        body: Starter,
        options?: ApiCallOptions,
    ) => Promise<UpdateAssistantStarterHttpResponse>;
    updateAssistantStarterFollowup: (
        assistantId: string,
        starterId: string,
        followupId: string,
        body: Followup,
        options?: ApiCallOptions,
    ) => Promise<UpdateAssistantStarterFollowupHttpResponse>;
}
Index

Properties

clearCache: () => void

Clears the cache for assistants api requests.

Type declaration

    • (): void
    • Clears the cache for assistants api requests.

      Returns void

createAssistant: (
    body: CreateAssistant,
    options?: ApiCallOptions,
) => Promise<CreateAssistantHttpResponse>

Creates a new assistant.

Type declaration

an object with the body content

CreateAssistantHttpError

createAssistantStarter: (
    assistantId: string,
    body: CreateStarter,
    options?: ApiCallOptions,
) => Promise<CreateAssistantStarterHttpResponse>

Creates a new starter for the assistant.

Type declaration

The ID of the assistant in which to create the starter.

an object with the body content

CreateAssistantStarterHttpError

createAssistantThread: (
    assistantId: string,
    body: CreateThread,
    options?: ApiCallOptions,
) => Promise<CreateAssistantThreadHttpResponse>

Creates a new thread for the assistant.

Type declaration

The ID of the assistant in which to create the thread.

an object with the body content

CreateAssistantThreadHttpError

createAssistantThreadInteraction: (
    assistantId: string,
    threadId: string,
    body: CreateInteraction,
    options?: ApiCallOptions,
) => Promise<CreateAssistantThreadInteractionHttpResponse>

Creates a new interaction for the thread.

Type declaration

The ID of the assistant in which to create the interaction.

The ID of the thread in which to create the interaction.

an object with the body content

CreateAssistantThreadInteractionHttpError

createAssistantThreadInteractionFeedback: (
    assistantId: string,
    threadId: string,
    interactionId: string,
    body: CreateFeedback,
    options?: ApiCallOptions,
) => Promise<CreateAssistantThreadInteractionFeedbackHttpResponse>

Creates feedback for the thread.

Type declaration

The ID of the assistant in which to create the feedback.

The ID of the thread in which to create the feedback.

The ID of the interaction in which to create the feedback.

an object with the body content

CreateAssistantThreadInteractionFeedbackHttpError

createAssistantThreadInteractionReview: (
    assistantId: string,
    threadId: string,
    interactionId: string,
    body: CreateReview,
    options?: ApiCallOptions,
) => Promise<CreateAssistantThreadInteractionReviewHttpResponse>

Creates feedback review for the thread.

Type declaration

The ID of the assistant in which to create the feedback review.

The ID of the thread in which to create the feedback review.

The ID of the interaction in which to create the feedback review.

an object with the body content

CreateAssistantThreadInteractionReviewHttpError

deleteAssistant: (
    id: string,
    options?: ApiCallOptions,
) => Promise<DeleteAssistantHttpResponse>

Deletes the assistant and all of its resources.

Type declaration

The ID of the assistant to delete.

DeleteAssistantHttpError

deleteAssistantStarter: (
    assistantId: string,
    starterId: string,
    options?: ApiCallOptions,
) => Promise<DeleteAssistantStarterHttpResponse>

Deletes the starter and all of its resources.

Type declaration

The ID of the assistant containing the requested starter.

The ID of the starter to delete.

DeleteAssistantStarterHttpError

deleteAssistantStarterFollowup: (
    assistantId: string,
    starterId: string,
    followupId: string,
    options?: ApiCallOptions,
) => Promise<DeleteAssistantStarterFollowupHttpResponse>

Deletes the specified Followup.

Type declaration

The ID of the assistant containing the requested Followup.

The ID of the starter containing the requested Followup.

The ID of the Followup to delete.

DeleteAssistantStarterFollowupHttpError

deleteAssistantThread: (
    assistantid: string,
    threadid: string,
    options?: ApiCallOptions,
) => Promise<DeleteAssistantThreadHttpResponse>

Deletes the specified thread and all of its resources.

Type declaration

The ID of the assistant containing the requested thread.

The ID of the thread to retrieve.

DeleteAssistantThreadHttpError

deleteAssistantThreadInteraction: (
    assistantId: string,
    threadId: string,
    interactionId: string,
    options?: ApiCallOptions,
) => Promise<DeleteAssistantThreadInteractionHttpResponse>

Deletes the specified interaction and all of its resources.

Type declaration

    • (
          assistantId: string,
          threadId: string,
          interactionId: string,
          options?: ApiCallOptions,
      ): Promise<DeleteAssistantThreadInteractionHttpResponse>
    • Deletes the specified interaction and all of its resources.

      Parameters

      • assistantId: string

        The ID of the assistant in which to delete the interaction.

      • threadId: string

        The ID of the thread in which to delete the interaction.

      • interactionId: string

        The ID of the interaction to delete.

      • Optionaloptions: ApiCallOptions

      Returns Promise<DeleteAssistantThreadInteractionHttpResponse>

      DeleteAssistantThreadInteractionHttpError

The ID of the assistant in which to delete the interaction.

The ID of the thread in which to delete the interaction.

The ID of the interaction to delete.

DeleteAssistantThreadInteractionHttpError

getAssistant: (
    id: string,
    options?: ApiCallOptions,
) => Promise<GetAssistantHttpResponse>

Retrieves the specified assistant.

Type declaration

The ID of the assistant to retrieve.

GetAssistantHttpError

getAssistantFeedback: (
    assistantId: string,
    options?: ApiCallOptions,
) => Promise<GetAssistantFeedbackHttpResponse>

Retrieves feedback summary for the assistant.

Type declaration

The ID of the assistant from which to retrieve feedback summary.

GetAssistantFeedbackHttpError

getAssistants: (
    query: {
        countTotal?: boolean;
        limit?: number;
        next?: string;
        prev?: string;
        sort?:
            | "NAME"
            | "-NAME"
            | "DESCRIPTION"
            | "-DESCRIPTION"
            | "CREATED"
            | "-CREATED"
            | "UPDATED"
            | "-UPDATED";
    },
    options?: ApiCallOptions,
) => Promise<GetAssistantsHttpResponse>

Retrieves the list of assistants. The result can be filtered, sorted, and paginated.

Type declaration

    • (
          query: {
              countTotal?: boolean;
              limit?: number;
              next?: string;
              prev?: string;
              sort?:
                  | "NAME"
                  | "-NAME"
                  | "DESCRIPTION"
                  | "-DESCRIPTION"
                  | "CREATED"
                  | "-CREATED"
                  | "UPDATED"
                  | "-UPDATED";
          },
          options?: ApiCallOptions,
      ): Promise<GetAssistantsHttpResponse>
    • Retrieves the list of assistants. The result can be filtered, sorted, and paginated.

      Parameters

      • query: {
            countTotal?: boolean;
            limit?: number;
            next?: string;
            prev?: string;
            sort?:
                | "NAME"
                | "-NAME"
                | "DESCRIPTION"
                | "-DESCRIPTION"
                | "CREATED"
                | "-CREATED"
                | "UPDATED"
                | "-UPDATED";
        }

        an object with query parameters

        • OptionalcountTotal?: boolean

          Optional parameter to request total count for query.

        • Optionallimit?: number

          The number of assistants to get.

        • Optionalnext?: string

          Optional parameter to request the next page.

        • Optionalprev?: string

          Optional parameter to request the previous page.

        • Optionalsort?:
              | "NAME"
              | "-NAME"
              | "DESCRIPTION"
              | "-DESCRIPTION"
              | "CREATED"
              | "-CREATED"
              | "UPDATED"
              | "-UPDATED"

          Optional resource field name to sort on, case insensitive, e.g. name. Can be prefixed with - to set descending order; defaults to ascending.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAssistantsHttpResponse>

      GetAssistantsHttpError

an object with query parameters

GetAssistantsHttpError

getAssistantSources: (
    assistantId: string,
    body: ChunksRefs,
    options?: ApiCallOptions,
) => Promise<GetAssistantSourcesHttpResponse>

Perform a bulk search for the plaintext of source chunks for the assistant.

Type declaration

The ID of the assistant in which to search for source chunks.

an object with the body content

GetAssistantSourcesHttpError

getAssistantStarter: (
    assistantId: string,
    starterId: string,
    options?: ApiCallOptions,
) => Promise<GetAssistantStarterHttpResponse>

Retrieves the specified starter.

Type declaration

The ID of the assistant containing the requested starter.

The ID of the starter to retrieve.

GetAssistantStarterHttpError

getAssistantStarters: (
    assistantId: string,
    query: {
        limit?: number;
        next?: string;
        prev?: string;
        sort?:
            | "CREATED"
            | "-CREATED"
            | "UPDATED"
            | "-UPDATED"
            | "QUESTION"
            | "-QUESTION";
    },
    options?: ApiCallOptions,
) => Promise<GetAssistantStartersHttpResponse>

Retrieves the list of starters for the assistant.

Type declaration

    • (
          assistantId: string,
          query: {
              limit?: number;
              next?: string;
              prev?: string;
              sort?:
                  | "CREATED"
                  | "-CREATED"
                  | "UPDATED"
                  | "-UPDATED"
                  | "QUESTION"
                  | "-QUESTION";
          },
          options?: ApiCallOptions,
      ): Promise<GetAssistantStartersHttpResponse>
    • Retrieves the list of starters for the assistant.

      Parameters

      • assistantId: string

        The ID of the assistant from which to retrieve starters.

      • query: {
            limit?: number;
            next?: string;
            prev?: string;
            sort?:
                | "CREATED"
                | "-CREATED"
                | "UPDATED"
                | "-UPDATED"
                | "QUESTION"
                | "-QUESTION";
        }

        an object with query parameters

        • Optionallimit?: number

          The number of starters to get.

        • Optionalnext?: string

          Optional parameter to request the next page.

        • Optionalprev?: string

          Optional parameter to request the previous page.

        • Optionalsort?: "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED" | "QUESTION" | "-QUESTION"

          Optional resource field name to sort on, case insensitive, e.g. name. Can be prefixed with - to set descending order; defaults to ascending.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAssistantStartersHttpResponse>

      GetAssistantStartersHttpError

The ID of the assistant from which to retrieve starters.

an object with query parameters

GetAssistantStartersHttpError

getAssistantThread: (
    assistantid: string,
    threadid: string,
    options?: ApiCallOptions,
) => Promise<GetAssistantThreadHttpResponse>

Retrieves a thread for the assistant.

Type declaration

The ID of the assistant containing the requested thread.

The ID of the thread to retrieve.

GetAssistantThreadHttpError

getAssistantThreadInteraction: (
    assistantId: string,
    threadId: string,
    interactionId: string,
    options?: ApiCallOptions,
) => Promise<GetAssistantThreadInteractionHttpResponse>

Retrieves an interaction for the thread.

Type declaration

    • (
          assistantId: string,
          threadId: string,
          interactionId: string,
          options?: ApiCallOptions,
      ): Promise<GetAssistantThreadInteractionHttpResponse>
    • Retrieves an interaction for the thread.

      Parameters

      • assistantId: string

        The ID of the assistant in which to retrieve the interaction.

      • threadId: string

        The ID of the thread in which to retrieve the interaction.

      • interactionId: string

        The ID of the interaction to retrieve.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAssistantThreadInteractionHttpResponse>

      GetAssistantThreadInteractionHttpError

The ID of the assistant in which to retrieve the interaction.

The ID of the thread in which to retrieve the interaction.

The ID of the interaction to retrieve.

GetAssistantThreadInteractionHttpError

getAssistantThreadInteractions: (
    assistantId: string,
    threadId: string,
    query: {
        limit?: number;
        next?: string;
        prev?: string;
        sort?: "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED";
    },
    options?: ApiCallOptions,
) => Promise<GetAssistantThreadInteractionsHttpResponse>

Retrieves the list of interactions for the thread.

Type declaration

    • (
          assistantId: string,
          threadId: string,
          query: {
              limit?: number;
              next?: string;
              prev?: string;
              sort?: "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED";
          },
          options?: ApiCallOptions,
      ): Promise<GetAssistantThreadInteractionsHttpResponse>
    • Retrieves the list of interactions for the thread.

      Parameters

      • assistantId: string

        The ID of the assistant from which to retrieve the interactions.

      • threadId: string

        The ID of the thread from which to retrieve the interactions.

      • query: {
            limit?: number;
            next?: string;
            prev?: string;
            sort?: "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED";
        }

        an object with query parameters

        • Optionallimit?: number

          The number of feedback to get.

        • Optionalnext?: string

          Optional parameter to request the next page.

        • Optionalprev?: string

          Optional parameter to request the previous page.

        • Optionalsort?: "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED"

          Optional resource field name to sort on, case insensitive, e.g. created. Can be prefixed with - to set descending order; defaults to ascending.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAssistantThreadInteractionsHttpResponse>

      GetAssistantThreadInteractionsHttpError

The ID of the assistant from which to retrieve the interactions.

The ID of the thread from which to retrieve the interactions.

an object with query parameters

GetAssistantThreadInteractionsHttpError

getAssistantThreads: (
    assistantId: string,
    query: {
        filter?: string;
        limit?: number;
        next?: string;
        prev?: string;
        sort?: "NAME" | "-NAME" | "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED";
    },
    options?: ApiCallOptions,
) => Promise<GetAssistantThreadsHttpResponse>

Retrieves the list of threads for the assistant.

Type declaration

    • (
          assistantId: string,
          query: {
              filter?: string;
              limit?: number;
              next?: string;
              prev?: string;
              sort?: "NAME" | "-NAME" | "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED";
          },
          options?: ApiCallOptions,
      ): Promise<GetAssistantThreadsHttpResponse>
    • Retrieves the list of threads for the assistant.

      Parameters

      • assistantId: string

        The ID of the assistant from which to retrieve threads.

      • query: {
            filter?: string;
            limit?: number;
            next?: string;
            prev?: string;
            sort?: "NAME" | "-NAME" | "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED";
        }

        an object with query parameters

        • Optionalfilter?: string

          Optional parameter to filter threads.

        • Optionallimit?: number

          The number of assistants to get.

        • Optionalnext?: string

          Optional parameter to request the next page.

        • Optionalprev?: string

          Optional parameter to request the previous page.

        • Optionalsort?: "NAME" | "-NAME" | "CREATED" | "-CREATED" | "UPDATED" | "-UPDATED"

          Optional resource field name to sort on, case insensitive, e.g. name. Can be prefixed with - to set descending order; defaults to ascending.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetAssistantThreadsHttpResponse>

      GetAssistantThreadsHttpError

The ID of the assistant from which to retrieve threads.

an object with query parameters

GetAssistantThreadsHttpError

invokeAssistantThread: (
    assistantId: string,
    threadId: string,
    body: PromptInput,
    options?: ApiCallOptions,
) => Promise<InvokeAssistantThreadHttpResponse>

Execute prompt in synchronous non-streaming mode.

Type declaration

The id of the Assistant containing requested Thread

The id of the Thread to retrieve

an object with the body content

InvokeAssistantThreadHttpError

patchAssistant: (
    id: string,
    body: JSONPatchArray,
    options?: ApiCallOptions,
) => Promise<PatchAssistantHttpResponse>

Updates the properties of an existing assistant with JSON Patch-formatted data.

Type declaration

The assistant ID.

an object with the body content

PatchAssistantHttpError

patchAssistantThread: (
    assistantid: string,
    threadid: string,
    body: ThreadPatchArray,
    options?: ApiCallOptions,
) => Promise<PatchAssistantThreadHttpResponse>

Updates the properties of an existing thread with JSON Patch-formatted data.

Type declaration

The ID of the assistant containing the requested thread.

The ID of the thread to retrieve.

an object with the body content

PatchAssistantThreadHttpError

patchAssistantThreadInteractionFeedback: (
    assistantId: string,
    threadId: string,
    interactionId: string,
    feedbackId: string,
    body: FeedbackPatchArray,
    options?: ApiCallOptions,
) => Promise<PatchAssistantThreadInteractionFeedbackHttpResponse>

Updates feedback for the thread.

Type declaration

The ID of the assistant containing the requested feedback.

The ID of the thread containing the requested feedback.

The ID of the interaction containing the requested Feedback.

The ID of the feedback to update.

an object with the body content

PatchAssistantThreadInteractionFeedbackHttpError

streamAssistantThread: (
    assistantId: string,
    threadId: string,
    body: PromptInput,
    options?: ApiCallOptions,
) => Promise<StreamAssistantThreadHttpResponse>

Execute prompt in asynchronous streaming mode.

Type declaration

The id of the Assistant containing requested Thread

The id of the Thread to retrieve

an object with the body content

StreamAssistantThreadHttpError

updateAssistantStarter: (
    assistantId: string,
    starterId: string,
    body: Starter,
    options?: ApiCallOptions,
) => Promise<UpdateAssistantStarterHttpResponse>

Updates the specified starter.

Type declaration

The ID of the assistant containing the requested starter.

The ID of the starter to retrieve.

an object with the body content

UpdateAssistantStarterHttpError

updateAssistantStarterFollowup: (
    assistantId: string,
    starterId: string,
    followupId: string,
    body: Followup,
    options?: ApiCallOptions,
) => Promise<UpdateAssistantStarterFollowupHttpResponse>

Updates the specified Followup.

Type declaration

The ID of the assistant containing the requested Followup.

The ID of the starter containing the requested Followup.

The ID of the Followup to update.

an object with the body content

UpdateAssistantStarterFollowupHttpError