Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libs/langchain-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@langchain/baidu-qianfan": "workspace:*",
"@langchain/cloudflare": "workspace:*",
"@langchain/cohere": "workspace:*",
"@langchain/community": "workspace:*",
"@langchain/core": "workspace:*",
"@langchain/deepseek": "workspace:*",
"@langchain/eslint": "workspace:*",
Expand Down Expand Up @@ -1243,4 +1244,4 @@
},
"./package.json": "./package.json"
}
}
}
3 changes: 0 additions & 3 deletions libs/langchain-classic/src/agents/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ export class RunnableMultiActionAgent extends BaseMultiActionAgent {
}
}

/** @deprecated Renamed to RunnableMultiActionAgent. */
export class RunnableAgent extends RunnableMultiActionAgent {}

/**
Expand Down Expand Up @@ -478,8 +477,6 @@ export interface AgentArgs {
* @remarks This is driven by an LLMChain. The prompt in the LLMChain *must*
* include a variable called "agent_scratchpad" where the agent can put its
* intermediary work.
*
* @deprecated Use {@link https://js.langchain.com/docs/modules/agents/agent_types/ | new agent creation methods}.
*/
export abstract class Agent extends BaseSingleActionAgent {
llmChain: LLMChain;
Expand Down
5 changes: 0 additions & 5 deletions libs/langchain-classic/src/agents/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const DEFAULT_HUMAN_MESSAGE_TEMPLATE = "{input}\n\n{agent_scratchpad}";

/**
* Interface for arguments used to create a chat prompt.
* @deprecated
*/
export interface ChatCreatePromptArgs {
/** String to put after the list of tools. */
Expand All @@ -35,16 +34,12 @@ export interface ChatCreatePromptArgs {
/**
* Type for input data for creating a ChatAgent, extending AgentInput with
* optional 'outputParser'.
*
* @deprecated
*/
export type ChatAgentInput = Optional<AgentInput, "outputParser">;

/**
* Agent for the MRKL chain.
* @augments Agent
*
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain.agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
*/
export class ChatAgent extends Agent {
static lc_name() {
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/agents/chat_convo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export type ChatConversationalAgentInput = Optional<AgentInput, "outputParser">;
/**
* Agent for the MRKL chain.
* @augments Agent
*
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain.agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
*/
export class ChatConversationalAgent extends Agent {
static lc_name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { TEMPLATE_TOOL_RESPONSE } from "../chat_convo/prompt.js";
* agents that use OpenAI's API. Helpful for passing in previous agent
* step context into new iterations.
*
* @deprecated Use formatToOpenAIFunctionMessages instead.
* @param steps A list of AgentSteps to format.
* @returns A list of BaseMessages.
*/
Expand Down
6 changes: 0 additions & 6 deletions libs/langchain-classic/src/agents/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ type AgentType =
| "chat-zero-shot-react-description"
| "chat-conversational-react-description";

/**
* @deprecated See {@link https://js.langchain.com/docs/modules/agents/agent_types/ | new agent creation docs}.
*/
export const initializeAgentExecutor = async (
tools: ToolInterface[],
llm: BaseLanguageModelInterface,
Expand Down Expand Up @@ -103,7 +100,6 @@ export type InitializeAgentExecutorOptionsStructured =

/**
* Initialize an agent executor with options.
* @deprecated See {@link https://js.langchain.com/docs/modules/agents/agent_types/ | new agent creation docs}.
* @param tools Array of tools to use in the agent
* @param llm LLM or ChatModel to use in the agent
* @param options Options for the agent, including agentType, agentArgs, and other options for AgentExecutor.fromAgentAndTools
Expand All @@ -114,13 +110,11 @@ export async function initializeAgentExecutorWithOptions(
llm: BaseLanguageModelInterface,
options: InitializeAgentExecutorOptionsStructured
): Promise<AgentExecutor>;
/** @deprecated See {@link https://js.langchain.com/docs/modules/agents/agent_types/ | new agent creation docs}. */
export async function initializeAgentExecutorWithOptions(
tools: ToolInterface[],
llm: BaseLanguageModelInterface,
options?: InitializeAgentExecutorOptions
): Promise<AgentExecutor>;
/** @deprecated See {@link https://js.langchain.com/docs/modules/agents/agent_types/ | new agent creation docs}. */
export async function initializeAgentExecutorWithOptions(
tools: StructuredToolInterface[] | ToolInterface[],
llm: BaseLanguageModelInterface,
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/agents/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { loadFromHub } from "../util/hub.js";
import { FileLoader, loadFromFile } from "../util/load.js";
import { parseFileConfig } from "../util/parse.js";

/** @deprecated */
const loadAgentFromFile: FileLoader<Agent> = async (
file: string,
path: string,
Expand All @@ -15,7 +14,6 @@ const loadAgentFromFile: FileLoader<Agent> = async (
return Agent.deserialize({ ...serialized, ...llmAndTools });
};

/** @deprecated */
export const loadAgent = async (
uri: string,
llmAndTools?: { llm?: BaseLanguageModelInterface; tools?: ToolInterface[] }
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/agents/mrkl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export type ZeroShotAgentInput = Optional<AgentInput, "outputParser">;
* input: `Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?`,
* });
* ```
*
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain.agents.createReactAgent.html | createReactAgent method instead}.
*/
export class ZeroShotAgent extends Agent {
static lc_name() {
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/agents/openai_functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ export interface OpenAIAgentCreatePromptArgs {
* Class representing an agent for the OpenAI chat model in LangChain. It
* extends the Agent class and provides additional functionality specific
* to the OpenAIAgent type.
*
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain.agents.createOpenAIFunctionsAgent.html | createOpenAIFunctionsAgent method instead}.
*/
export class OpenAIAgent extends Agent {
static lc_name() {
Expand Down
1 change: 0 additions & 1 deletion libs/langchain-classic/src/agents/structured_chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export type StructuredChatAgentInput = Optional<AgentInput, "outputParser">;
/**
* Agent that interoperates with Structured Tools using React logic.
* @augments Agent
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain.agents.createStructuredChatAgent.html | createStructuredChatAgent method instead}.
*/
export class StructuredChatAgent extends Agent {
static lc_name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "@langchain/core/tools";
import { formatDocumentsAsString } from "../../../util/document.js";

/** @deprecated Use "@langchain/classic/tools/retriever" instead. */
export function createRetrieverTool(
retriever: BaseRetrieverInterface,
input: Omit<DynamicStructuredToolInput, "func" | "schema">
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/agents/toolkits/json/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export class JsonToolkit extends BaseToolkit {
}

/**
* @deprecated Create a specific agent with a custom tool instead.
*
* Creates a JSON agent using a language model, a JSON toolkit, and
* optional prompt arguments. It creates a prompt for the agent using the
* JSON tools and the provided prefix and suffix. It then creates a
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/agents/toolkits/openapi/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export class OpenApiToolkit extends RequestsToolkit {
}

/**
* @deprecated Create a specific agent with a custom tool instead.
*
* Creates an OpenAPI agent using a language model, an OpenAPI toolkit,
* and optional prompt arguments. It creates a prompt for the agent using
* the OpenAPI tools and the provided prefix and suffix. It then creates a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export class VectorStoreRouterToolkit extends BaseToolkit {
}
}

/** @deprecated Create a specific agent with a custom tool instead. */
export function createVectorStoreAgent(
llm: BaseLanguageModelInterface,
toolkit: VectorStoreToolkit,
Expand Down Expand Up @@ -124,7 +123,6 @@ export function createVectorStoreAgent(
});
}

/** @deprecated Create a specific agent with a custom tool instead. */
export function createVectorStoreRouterAgent(
llm: BaseLanguageModelInterface,
toolkit: VectorStoreRouterToolkit,
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/agents/xml/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export interface XMLAgentInput {

/**
* Class that represents an agent that uses XML tags.
*
* @deprecated Use the {@link https://api.js.langchain.com/functions/langchain.agents.createXmlAgent.html | createXmlAgent method instead}.
*/
export class XMLAgent extends BaseSingleActionAgent implements XMLAgentInput {
static lc_name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ export interface ConversationalRetrievalQAChainInput extends ChainInputs {
}

/**
* @deprecated This class will be removed in 1.0.0. See below for an example implementation using
* `createRetrievalChain`.
*
* Class for conducting conversational question-answering tasks with a
* retrieval component. Extends the BaseChain class and implements the
* ConversationalRetrievalQAChainInput interface.
Expand Down
3 changes: 0 additions & 3 deletions libs/langchain-classic/src/chains/llm_chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ function _getLanguageModel(llmLike: RunnableInterface): BaseLanguageModel {
}

/**
* @deprecated This class will be removed in 1.0.0. Use the LangChain Expression Language (LCEL) instead.
* See the example below for how to use LCEL with the LLMChain class:
*
* Chain to run queries against LLMs.
*
* @example
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/chains/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const loadChainFromFile: FileLoader<BaseChain> = async (
* import { loadChain } from "@langchain/classic/chains/load";
* const chain = await loadChain("/path/to/chain.json");
* ```
*
* @deprecated Use newer {@link https://api.js.langchain.com/functions/langchain.load.load.html | load method}.
*/
export const loadChain = async (
uri: string,
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/chains/retrieval_qa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export interface RetrievalQAChainInput extends Omit<ChainInputs, "memory"> {
}

/**
* @deprecated This class will be removed in 1.0.0. See below for an example implementation using
* `createRetrievalChain`:
* Class representing a chain for performing question-answering tasks with
* a retrieval component.
* @example
Expand Down
10 changes: 0 additions & 10 deletions libs/langchain-classic/src/chains/sequential_chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ function formatSet(input: Set<string>) {

/**
* Interface for the input parameters of the SequentialChain class.
*
* @deprecated
* Switch to expression language: https://js.langchain.com/docs/expression_language/
* Will be removed in 0.2.0
*/
export interface SequentialChainInput extends ChainInputs {
/** Array of chains to run as a sequence. The chains are run in order they appear in the array. */
Expand Down Expand Up @@ -77,10 +73,6 @@ export interface SequentialChainInput extends ChainInputs {
* });
* console.log(chainExecutionResult);
* ```
*
* @deprecated
* Switch to {@link https://js.langchain.com/docs/expression_language/ | expression language}.
* Will be removed in 0.2.0
*/
export class SequentialChain extends BaseChain implements SequentialChainInput {
static lc_name() {
Expand Down Expand Up @@ -244,7 +236,6 @@ export class SequentialChain extends BaseChain implements SequentialChainInput {
}

/**
* @deprecated Switch to expression language: https://js.langchain.com/docs/expression_language/
* Interface for the input parameters of the SimpleSequentialChain class.
*/
export interface SimpleSequentialChainInput extends ChainInputs {
Expand All @@ -255,7 +246,6 @@ export interface SimpleSequentialChainInput extends ChainInputs {
}

/**
* @deprecated Switch to expression language: https://js.langchain.com/docs/expression_language/
* Simple chain where a single string output of one chain is fed directly into the next.
* @augments BaseChain
* @augments SimpleSequentialChainInput
Expand Down
8 changes: 0 additions & 8 deletions libs/langchain-classic/src/chains/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import { ChainInputs, BaseChain } from "./base.js";
* Interface that extends the `ChainInputs` interface and defines the
* fields required for a transform chain. It includes the `transform`
* function, `inputVariables`, and `outputVariables` properties.
*
* @deprecated
* Switch to expression language: https://js.langchain.com/docs/expression_language/
* Will be removed in 0.2.0
*/
export interface TransformChainFields<
I extends ChainValues,
Expand All @@ -28,10 +24,6 @@ export interface TransformChainFields<
* class and implements the `TransformChainFields` interface. It provides
* a way to transform input values to output values using a specified
* transform function.
*
* @deprecated
* Switch to {@link https://js.langchain.com/docs/expression_language/ | expression language}.
* Will be removed in 0.2.0
*/
export class TransformChain<
I extends ChainValues,
Expand Down
8 changes: 0 additions & 8 deletions libs/langchain-classic/src/chains/vector_db_qa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ export type LoadValues = Record<string, any>;
* input fields required for a VectorDBQAChain. It includes properties
* such as `vectorstore`, `combineDocumentsChain`,
* `returnSourceDocuments`, `k`, and `inputKey`.
*
* @deprecated
* Switch to {@link https://js.langchain.com/docs/modules/chains/ | createRetrievalChain}
* Will be removed in 0.2.0
*/
export interface VectorDBQAChainInput extends Omit<ChainInputs, "memory"> {
vectorstore: VectorStoreInterface;
Expand All @@ -32,10 +28,6 @@ export interface VectorDBQAChainInput extends Omit<ChainInputs, "memory"> {
* class and implements the `VectorDBQAChainInput` interface. It performs
* a similarity search using a vector store and combines the search
* results using a specified combine documents chain.
*
* @deprecated
* Switch to {@link https://js.langchain.com/docs/modules/chains/ | createRetrievalChain}
* Will be removed in 0.2.0
*/
export class VectorDBQAChain extends BaseChain implements VectorDBQAChainInput {
static lc_name() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"langchain/prompts/chat/BaseMessagePromptTemplate": "langchain_core/prompts/chat/BaseMessagePromptTemplate",
"@langchain/classic/output_parsers/list/CommaSeparatedListOutputParser": "langchain_core/output_parsers/list/CommaSeparatedListOutputParser",
"langchain/output_parsers/list/CommaSeparatedListOutputParser": "langchain_core/output_parsers/list/CommaSeparatedListOutputParser",
"langchain/prompts/few_shot_with_templates/FewShotPromptWithTemplates": "langchain_core/prompts/few_shot_with_templates/FewShotPromptWithTemplates",
"langchain/prompts/base/StringPromptTemplate": "langchain_core/prompts/string/StringPromptTemplate",
"langchain/prompts/chat/BaseStringMessagePromptTemplate": "langchain_core/prompts/chat/BaseStringMessagePromptTemplate",
Expand Down
1 change: 0 additions & 1 deletion libs/langchain-classic/src/schema/prompt_template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Document } from "@langchain/core/documents";
import { BasePromptTemplate } from "@langchain/core/prompts";

/**
* @deprecated
* Formats a document using a given prompt template.
*
* @async
Expand Down
1 change: 0 additions & 1 deletion libs/langchain-classic/src/schema/query_constructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* A simple data structure that holds information about an attribute. It
* is typically used to provide metadata about attributes in other classes
* or data structures within the LangChain framework.
* @deprecated
*/
export class AttributeInfo {
constructor(
Expand Down
2 changes: 0 additions & 2 deletions libs/langchain-classic/src/tools/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { DynamicTool, DynamicToolInput } from "@langchain/core/tools";
import { BaseChain } from "../chains/base.js";

/**
* @deprecated Wrap in a DynamicTool instead.
* Interface for the input parameters of the ChainTool constructor.
* Extends the DynamicToolInput interface, replacing the 'func' property
* with a 'chain' property.
Expand All @@ -12,7 +11,6 @@ export interface ChainToolInput extends Omit<DynamicToolInput, "func"> {
}

/**
* @deprecated Wrap in a DynamicTool instead.
* Class that extends DynamicTool for creating tools that can run chains.
* Takes an instance of a class that extends BaseChain as a parameter in
* its constructor and uses it to run the chain when its 'func' method is
Expand Down
Loading
Loading