Skip to content

Commit

Permalink
deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Apr 8, 2024
1 parent 70a239f commit 2bd42f7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions langchain-core/src/language_models/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ export abstract class BaseChatModel<
}

/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*
* Generates chat based on the input messages.
* @param messages An array of arrays of BaseMessage instances.
* @param options The call options or an array of stop sequences.
Expand Down
2 changes: 2 additions & 0 deletions langchain-core/src/language_models/llms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ export abstract class BaseLLM<
}

/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*
* Run the LLM on the given prompts and input, handling caching.
*/
async generate(
Expand Down
2 changes: 2 additions & 0 deletions langchain-core/src/retrievers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export abstract class BaseRetriever<
}

/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*
* Main method used to retrieve relevant documents. It takes a query
* string and an optional configuration object, and returns a promise that
* resolves to an array of `Document` objects. This method handles the
Expand Down
14 changes: 14 additions & 0 deletions langchain-core/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export interface StructuredToolInterface<
schema: T | z.ZodEffects<T>;

/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*
* Calls the tool with the provided argument, configuration, and tags. It
* parses the input according to the schema, handles any errors, and
* manages callbacks.
Expand Down Expand Up @@ -105,6 +107,8 @@ export abstract class StructuredTool<
}

/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*
* Calls the tool with the provided argument, configuration, and tags. It
* parses the input according to the schema, handles any errors, and
* manages callbacks.
Expand Down Expand Up @@ -168,6 +172,8 @@ export abstract class StructuredTool<

export interface ToolInterface extends StructuredToolInterface {
/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*
* Calls the tool with the provided argument and callbacks. It handles
* string inputs specifically.
* @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.
Expand All @@ -193,6 +199,8 @@ export abstract class Tool extends StructuredTool {
}

/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*
* Calls the tool with the provided argument and callbacks. It handles
* string inputs specifically.
* @param arg The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.
Expand Down Expand Up @@ -264,6 +272,9 @@ export class DynamicTool extends Tool {
this.returnDirect = fields.returnDirect ?? this.returnDirect;
}

/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*/
async call(
arg: string | undefined | z.input<this["schema"]>,
configArg?: RunnableConfig | Callbacks
Expand Down Expand Up @@ -316,6 +327,9 @@ export class DynamicStructuredTool<
this.schema = fields.schema;
}

/**
* @deprecated Use .invoke() instead. Will be removed in 0.2.0.
*/
async call(
arg: z.output<T>,
configArg?: RunnableConfig | Callbacks,
Expand Down

0 comments on commit 2bd42f7

Please sign in to comment.