Skip to content

Commit

Permalink
Docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jan 24, 2025
1 parent deef63c commit be1c2e6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 11 additions & 3 deletions langchain/src/hub/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T extends Runnable>(
Expand Down
8 changes: 7 additions & 1 deletion langchain/src/hub/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T extends Runnable>(
Expand Down

0 comments on commit be1c2e6

Please sign in to comment.