Class ChatGPTPluginRetriever

Class that connects ChatGPT to third-party applications via plugins. It extends the RemoteRetriever class and implements the ChatGPTPluginRetrieverParams interface.

Example

const retriever = new ChatGPTPluginRetriever({
url: "http:
auth: {
bearer: "super-secret-jwt-token-with-at-least-32-characters-long",
},
});
const docs = await retriever.getRelevantDocuments("hello world");

Hierarchy

Implements

Constructors

Properties

asyncCaller: AsyncCaller

The authentication method to use, currently implemented is

  • false: no authentication
  • { bearer: string }: Bearer token authentication
headers: Record<string, string>
topK: number

The number of results to request from the ChatGPTRetrievalPlugin server

url: string

The URL of the remote retriever server

The filter to use when querying the ChatGPTRetrievalPlugin server

Methods

  • Creates a JSON body for the request to the ChatGPTRetrievalPlugin server.

    Parameters

    • query: string

      The query to send to the server.

    Returns RemoteRetrieverValues

    A JSON object representing the body of the request.

  • Processes the JSON response from the ChatGPTRetrievalPlugin server and returns an array of Document instances.

    Parameters

    Returns Document<Record<string, any>>[]

    An array of Document instances.

Generated using TypeDoc