以编程方式使用文档

此示例展示如何在 LangChain 中使用 ChatGPT 检索器插件。

要设置 ChatGPT 检索器插件,请按照 ChatGPT 检索插件设置说明.

用法

const retriever = new ChatGPTPluginRetriever({
  url: "http://0.0.0.0:8000",
  auth: {
    bearer: "super-secret-jwt-token-with-at-least-32-characters-long",
  },
});

const docs = await retriever.invoke("hello world");

console.log(docs);

相关