From be1c2e6563a5c09c0e648253a1eaed3e40ec67bb Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Fri, 24 Jan 2025 13:58:31 -0800 Subject: [PATCH] Docstring --- langchain/src/hub/index.ts | 14 +++++++++++--- langchain/src/hub/node.ts | 8 +++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/langchain/src/hub/index.ts b/langchain/src/hub/index.ts index 93a7303ac677..71377ba0f11c 100644 --- a/langchain/src/hub/index.ts +++ b/langchain/src/hub/index.ts @@ -7,10 +7,18 @@ export { basePush as push }; /** * Pull a prompt from the hub. - * NOTE: If you are in a Node environment and want to include an instantiated model with your pulled prompt, - * you can instead import this function from "langchain/hub/node" and pass "includeModel: true". + * * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash. - * @param options + * @param options.apiKey LangSmith API key to use when pulling the prompt + * @param options.apiUrl LangSmith API URL to use when pulling the prompt + * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt, + * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will + * also invoke the instantiated model. For non-OpenAI models, you must also set "modelClass" to the + * correct class of the model. + * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required + * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports, + * you may instead import this function from "langchain/hub/node" and pass "includeModel: true" instead + * of specifying this parameter. * @returns */ export async function pull( diff --git a/langchain/src/hub/node.ts b/langchain/src/hub/node.ts index 9dce0d0fb7f9..ab01777f5d2a 100644 --- a/langchain/src/hub/node.ts +++ b/langchain/src/hub/node.ts @@ -2,12 +2,18 @@ import { Runnable } from "@langchain/core/runnables"; import { basePush, basePull, generateModelImportMap } from "./base.js"; import { load } from "../load/index.js"; +// TODO: Make this the default, add web entrypoint in next breaking release + export { basePush as push }; /** * Pull a prompt from the hub. * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash. - * @param options + * @param options.apiKey LangSmith API key to use when pulling the prompt + * @param options.apiUrl LangSmith API URL to use when pulling the prompt + * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt, + * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will + * also invoke the instantiated model. You must have the appropriate LangChain integration package installed. * @returns */ export async function pull(