langchain 0.0.209 → 0.0.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/agent.d.ts +8 -8
- package/dist/agents/chat/index.cjs +1 -1
- package/dist/agents/chat/index.d.ts +7 -7
- package/dist/agents/chat/index.js +1 -1
- package/dist/agents/chat_convo/index.d.ts +6 -6
- package/dist/agents/chat_convo/outputParser.cjs +3 -3
- package/dist/agents/chat_convo/outputParser.d.ts +5 -5
- package/dist/agents/chat_convo/outputParser.js +3 -3
- package/dist/agents/executor.cjs +6 -6
- package/dist/agents/executor.d.ts +5 -5
- package/dist/agents/executor.js +1 -1
- package/dist/agents/helpers.d.ts +3 -3
- package/dist/agents/initialize.d.ts +5 -5
- package/dist/agents/load.d.ts +4 -4
- package/dist/agents/mrkl/index.d.ts +8 -8
- package/dist/agents/openai/index.d.ts +6 -6
- package/dist/agents/structured_chat/index.d.ts +6 -6
- package/dist/agents/structured_chat/outputParser.d.ts +2 -2
- package/dist/agents/toolkits/aws_sfn.d.ts +2 -2
- package/dist/agents/toolkits/conversational_retrieval/openai_functions.d.ts +2 -2
- package/dist/agents/toolkits/conversational_retrieval/tool.d.ts +2 -2
- package/dist/agents/toolkits/json/json.d.ts +4 -4
- package/dist/agents/toolkits/openapi/openapi.d.ts +5 -5
- package/dist/agents/toolkits/sql/sql.d.ts +5 -5
- package/dist/agents/toolkits/vectorstore/vectorstore.d.ts +12 -12
- package/dist/agents/toolkits/zapier/zapier.d.ts +2 -2
- package/dist/agents/xml/index.d.ts +5 -5
- package/dist/base_language/index.d.ts +1 -1
- package/dist/chains/api/api_chain.d.ts +2 -2
- package/dist/chains/chat_vector_db_chain.d.ts +5 -5
- package/dist/chains/combine_docs_chain.d.ts +1 -1
- package/dist/chains/constitutional_ai/constitutional_chain.d.ts +2 -2
- package/dist/chains/conversational_retrieval_chain.cjs +2 -2
- package/dist/chains/conversational_retrieval_chain.d.ts +8 -8
- package/dist/chains/conversational_retrieval_chain.js +2 -2
- package/dist/chains/graph_qa/cypher.d.ts +4 -4
- package/dist/chains/llm_chain.cjs +2 -2
- package/dist/chains/llm_chain.d.ts +8 -5
- package/dist/chains/llm_chain.js +1 -1
- package/dist/chains/query_constructor/index.d.ts +3 -3
- package/dist/chains/question_answering/load.d.ts +7 -7
- package/dist/chains/retrieval_qa.d.ts +5 -5
- package/dist/chains/router/llm_router.d.ts +2 -2
- package/dist/chains/router/multi_prompt.d.ts +3 -3
- package/dist/chains/router/multi_retrieval_qa.cjs +1 -1
- package/dist/chains/router/multi_retrieval_qa.d.ts +7 -7
- package/dist/chains/router/multi_retrieval_qa.js +1 -1
- package/dist/chains/sql_db/sql_db_chain.d.ts +3 -3
- package/dist/chains/summarization/load.d.ts +4 -4
- package/dist/chains/vector_db_qa.d.ts +5 -5
- package/dist/document_loaders/fs/docx.cjs +1 -2
- package/dist/document_loaders/fs/docx.js +1 -2
- package/dist/embeddings/cache_backed.cjs +2 -2
- package/dist/embeddings/cache_backed.d.ts +4 -4
- package/dist/embeddings/cache_backed.js +1 -1
- package/dist/evaluation/agents/trajectory.d.ts +4 -4
- package/dist/evaluation/base.d.ts +4 -4
- package/dist/evaluation/comparison/pairwise.d.ts +4 -4
- package/dist/evaluation/criteria/criteria.d.ts +4 -4
- package/dist/evaluation/embedding_distance/base.d.ts +4 -4
- package/dist/evaluation/loader.d.ts +4 -4
- package/dist/evaluation/qa/eval_chain.d.ts +2 -2
- package/dist/experimental/autogpt/agent.d.ts +3 -3
- package/dist/experimental/autogpt/prompt.d.ts +2 -2
- package/dist/experimental/babyagi/agent.d.ts +5 -5
- package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.d.ts +4 -4
- package/dist/experimental/chat_models/anthropic_functions.d.ts +2 -2
- package/dist/experimental/generative_agents/generative_agent.d.ts +3 -3
- package/dist/experimental/generative_agents/generative_agent_memory.d.ts +5 -5
- package/dist/experimental/hubs/makersuite/googlemakersuitehub.d.ts +1 -1
- package/dist/experimental/plan_and_execute/agent_executor.d.ts +4 -4
- package/dist/llms/load.cjs +2 -2
- package/dist/llms/load.d.ts +1 -1
- package/dist/llms/load.js +1 -1
- package/dist/memory/buffer_token_memory.d.ts +3 -3
- package/dist/memory/entity_memory.d.ts +3 -3
- package/dist/memory/summary.d.ts +3 -3
- package/dist/memory/vector_store.d.ts +3 -3
- package/dist/output_parsers/fix.d.ts +2 -2
- package/dist/retrievers/contextual_compression.cjs +2 -2
- package/dist/retrievers/contextual_compression.d.ts +5 -5
- package/dist/retrievers/contextual_compression.js +1 -1
- package/dist/retrievers/document_compressors/chain_extract.cjs +2 -2
- package/dist/retrievers/document_compressors/chain_extract.d.ts +6 -6
- package/dist/retrievers/document_compressors/chain_extract.js +1 -1
- package/dist/retrievers/document_compressors/embeddings_filter.d.ts +5 -5
- package/dist/retrievers/document_compressors/index.d.ts +3 -3
- package/dist/retrievers/hyde.d.ts +3 -3
- package/dist/retrievers/multi_query.cjs +2 -2
- package/dist/retrievers/multi_query.d.ts +4 -4
- package/dist/retrievers/multi_query.js +1 -1
- package/dist/retrievers/multi_vector.cjs +2 -2
- package/dist/retrievers/multi_vector.d.ts +4 -4
- package/dist/retrievers/multi_vector.js +1 -1
- package/dist/retrievers/parent_document.d.ts +4 -4
- package/dist/retrievers/remote/base.cjs +2 -2
- package/dist/retrievers/remote/base.d.ts +1 -1
- package/dist/retrievers/remote/base.js +1 -1
- package/dist/retrievers/self_query/index.cjs +2 -2
- package/dist/retrievers/self_query/index.d.ts +1 -1
- package/dist/retrievers/self_query/index.js +1 -1
- package/dist/retrievers/time_weighted.cjs +2 -2
- package/dist/retrievers/time_weighted.d.ts +9 -9
- package/dist/retrievers/time_weighted.js +1 -1
- package/dist/schema/runnable/base.d.ts +1 -1
- package/dist/tools/convert_to_openai.d.ts +4 -4
- package/dist/tools/render.d.ts +3 -3
- package/dist/tools/sql.d.ts +2 -2
- package/dist/tools/vectorstore.d.ts +6 -6
- package/dist/tools/webbrowser.cjs +4 -4
- package/dist/tools/webbrowser.d.ts +4 -4
- package/dist/tools/webbrowser.js +1 -1
- package/dist/util/googlevertexai-connection.d.ts +1 -1
- package/dist/vectorstores/memory.d.ts +5 -5
- package/dist/vectorstores/mongo.d.ts +4 -4
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
1
2
|
import { BaseChain, ChainInputs } from "../base.js";
|
|
2
3
|
import type { SqlDatabase } from "../../sql_db.js";
|
|
3
4
|
import { ChainValues } from "../../schema/index.js";
|
|
4
|
-
import { BaseLanguageModel } from "../../base_language/index.js";
|
|
5
5
|
import { CallbackManagerForChainRun } from "../../callbacks/manager.js";
|
|
6
6
|
import { PromptTemplate } from "../../prompts/index.js";
|
|
7
7
|
/**
|
|
@@ -10,7 +10,7 @@ import { PromptTemplate } from "../../prompts/index.js";
|
|
|
10
10
|
* for a SQL database chain.
|
|
11
11
|
*/
|
|
12
12
|
export interface SqlDatabaseChainInput extends ChainInputs {
|
|
13
|
-
llm:
|
|
13
|
+
llm: BaseLanguageModelInterface;
|
|
14
14
|
database: SqlDatabase;
|
|
15
15
|
topK?: number;
|
|
16
16
|
inputKey?: string;
|
|
@@ -45,7 +45,7 @@ export interface SqlDatabaseChainInput extends ChainInputs {
|
|
|
45
45
|
*/
|
|
46
46
|
export declare class SqlDatabaseChain extends BaseChain {
|
|
47
47
|
static lc_name(): string;
|
|
48
|
-
llm:
|
|
48
|
+
llm: BaseLanguageModelInterface;
|
|
49
49
|
database: SqlDatabase;
|
|
50
50
|
prompt: PromptTemplate<{
|
|
51
51
|
input: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
2
2
|
import { BasePromptTemplate } from "../../prompts/base.js";
|
|
3
3
|
import { StuffDocumentsChain, MapReduceDocumentsChain, RefineDocumentsChain, MapReduceDocumentsChainInput } from "../combine_docs_chain.js";
|
|
4
4
|
/**
|
|
@@ -16,12 +16,12 @@ export type SummarizationChainParams = BaseParams & ({
|
|
|
16
16
|
type?: "map_reduce";
|
|
17
17
|
combineMapPrompt?: BasePromptTemplate;
|
|
18
18
|
combinePrompt?: BasePromptTemplate;
|
|
19
|
-
combineLLM?:
|
|
19
|
+
combineLLM?: BaseLanguageModelInterface;
|
|
20
20
|
} & Pick<MapReduceDocumentsChainInput, "returnIntermediateSteps">) | {
|
|
21
21
|
type?: "refine";
|
|
22
22
|
refinePrompt?: BasePromptTemplate;
|
|
23
|
-
refineLLM?:
|
|
23
|
+
refineLLM?: BaseLanguageModelInterface;
|
|
24
24
|
questionPrompt?: BasePromptTemplate;
|
|
25
25
|
});
|
|
26
|
-
export declare const loadSummarizationChain: (llm:
|
|
26
|
+
export declare const loadSummarizationChain: (llm: BaseLanguageModelInterface, params?: SummarizationChainParams) => StuffDocumentsChain | MapReduceDocumentsChain | RefineDocumentsChain;
|
|
27
27
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
2
|
+
import type { VectorStoreInterface } from "@langchain/core/vectorstores";
|
|
1
3
|
import { BaseChain, ChainInputs } from "./base.js";
|
|
2
|
-
import { VectorStore } from "../vectorstores/base.js";
|
|
3
4
|
import { SerializedVectorDBQAChain } from "./serde.js";
|
|
4
|
-
import { BaseLanguageModel } from "../base_language/index.js";
|
|
5
5
|
import { CallbackManagerForChainRun } from "../callbacks/manager.js";
|
|
6
6
|
import { ChainValues } from "../schema/index.js";
|
|
7
7
|
export type LoadValues = Record<string, any>;
|
|
@@ -12,7 +12,7 @@ export type LoadValues = Record<string, any>;
|
|
|
12
12
|
* `returnSourceDocuments`, `k`, and `inputKey`.
|
|
13
13
|
*/
|
|
14
14
|
export interface VectorDBQAChainInput extends Omit<ChainInputs, "memory"> {
|
|
15
|
-
vectorstore:
|
|
15
|
+
vectorstore: VectorStoreInterface;
|
|
16
16
|
combineDocumentsChain: BaseChain;
|
|
17
17
|
returnSourceDocuments?: boolean;
|
|
18
18
|
k?: number;
|
|
@@ -30,7 +30,7 @@ export declare class VectorDBQAChain extends BaseChain implements VectorDBQAChai
|
|
|
30
30
|
inputKey: string;
|
|
31
31
|
get inputKeys(): string[];
|
|
32
32
|
get outputKeys(): string[];
|
|
33
|
-
vectorstore:
|
|
33
|
+
vectorstore: VectorStoreInterface;
|
|
34
34
|
combineDocumentsChain: BaseChain;
|
|
35
35
|
returnSourceDocuments: boolean;
|
|
36
36
|
constructor(fields: VectorDBQAChainInput);
|
|
@@ -48,5 +48,5 @@ export declare class VectorDBQAChain extends BaseChain implements VectorDBQAChai
|
|
|
48
48
|
* @param options Optional options to customize the chain.
|
|
49
49
|
* @returns A new instance of VectorDBQAChain.
|
|
50
50
|
*/
|
|
51
|
-
static fromLLM(llm:
|
|
51
|
+
static fromLLM(llm: BaseLanguageModelInterface, vectorstore: VectorStoreInterface, options?: Partial<Omit<VectorDBQAChainInput, "combineDocumentsChain" | "vectorstore">>): VectorDBQAChain;
|
|
52
52
|
}
|
|
@@ -41,8 +41,7 @@ class DocxLoader extends buffer_js_1.BufferLoader {
|
|
|
41
41
|
exports.DocxLoader = DocxLoader;
|
|
42
42
|
async function DocxLoaderImports() {
|
|
43
43
|
try {
|
|
44
|
-
const {
|
|
45
|
-
const { extractRawText } = mod;
|
|
44
|
+
const { extractRawText } = await import("mammoth");
|
|
46
45
|
return { extractRawText };
|
|
47
46
|
}
|
|
48
47
|
catch (e) {
|
|
@@ -37,8 +37,7 @@ export class DocxLoader extends BufferLoader {
|
|
|
37
37
|
}
|
|
38
38
|
async function DocxLoaderImports() {
|
|
39
39
|
try {
|
|
40
|
-
const {
|
|
41
|
-
const { extractRawText } = mod;
|
|
40
|
+
const { extractRawText } = await import("mammoth");
|
|
42
41
|
return { extractRawText };
|
|
43
42
|
}
|
|
44
43
|
catch (e) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CacheBackedEmbeddings = void 0;
|
|
4
4
|
const hash_1 = require("@langchain/core/utils/hash");
|
|
5
|
+
const embeddings_1 = require("@langchain/core/embeddings");
|
|
5
6
|
const encoder_backed_js_1 = require("../storage/encoder_backed.cjs");
|
|
6
|
-
const base_js_1 = require("./base.cjs");
|
|
7
7
|
/**
|
|
8
8
|
* Interface for caching results from embedding models.
|
|
9
9
|
*
|
|
@@ -51,7 +51,7 @@ const base_js_1 = require("./base.cjs");
|
|
|
51
51
|
*
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
class CacheBackedEmbeddings extends
|
|
54
|
+
class CacheBackedEmbeddings extends embeddings_1.Embeddings {
|
|
55
55
|
constructor(fields) {
|
|
56
56
|
super(fields);
|
|
57
57
|
Object.defineProperty(this, "underlyingEmbeddings", {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { type EmbeddingsInterface, Embeddings } from "@langchain/core/embeddings";
|
|
1
2
|
import { BaseStore } from "../schema/storage.js";
|
|
2
3
|
import { AsyncCallerParams } from "../util/async_caller.js";
|
|
3
|
-
import { Embeddings } from "./base.js";
|
|
4
4
|
/**
|
|
5
5
|
* Interface for the fields required to initialize an instance of the
|
|
6
6
|
* CacheBackedEmbeddings class.
|
|
7
7
|
*/
|
|
8
8
|
export interface CacheBackedEmbeddingsFields extends AsyncCallerParams {
|
|
9
|
-
underlyingEmbeddings:
|
|
9
|
+
underlyingEmbeddings: EmbeddingsInterface;
|
|
10
10
|
documentEmbeddingStore: BaseStore<string, number[]>;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -57,7 +57,7 @@ export interface CacheBackedEmbeddingsFields extends AsyncCallerParams {
|
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
59
|
export declare class CacheBackedEmbeddings extends Embeddings {
|
|
60
|
-
protected underlyingEmbeddings:
|
|
60
|
+
protected underlyingEmbeddings: EmbeddingsInterface;
|
|
61
61
|
protected documentEmbeddingStore: BaseStore<string, number[]>;
|
|
62
62
|
constructor(fields: CacheBackedEmbeddingsFields);
|
|
63
63
|
/**
|
|
@@ -95,7 +95,7 @@ export declare class CacheBackedEmbeddings extends Embeddings {
|
|
|
95
95
|
* @param options.namespace Optional namespace for store keys.
|
|
96
96
|
* @returns A new CacheBackedEmbeddings instance.
|
|
97
97
|
*/
|
|
98
|
-
static fromBytesStore(underlyingEmbeddings:
|
|
98
|
+
static fromBytesStore(underlyingEmbeddings: EmbeddingsInterface, documentEmbeddingStore: BaseStore<string, Uint8Array>, options?: {
|
|
99
99
|
namespace?: string;
|
|
100
100
|
}): CacheBackedEmbeddings;
|
|
101
101
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { insecureHash } from "@langchain/core/utils/hash";
|
|
2
|
+
import { Embeddings, } from "@langchain/core/embeddings";
|
|
2
3
|
import { EncoderBackedStore } from "../storage/encoder_backed.js";
|
|
3
|
-
import { Embeddings } from "./base.js";
|
|
4
4
|
/**
|
|
5
5
|
* Interface for caching results from embedding models.
|
|
6
6
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { StructuredToolInterface } from "@langchain/core/tools";
|
|
1
2
|
import { BaseLLMOutputParser } from "../../schema/output_parser.js";
|
|
2
3
|
import { AgentTrajectoryEvaluator, EvalOutputType, LLMEvalChainInput, LLMTrajectoryEvaluatorArgs } from "../base.js";
|
|
3
4
|
import { AgentStep, ChainValues, ChatGeneration, Generation } from "../../schema/index.js";
|
|
4
5
|
import { Callbacks } from "../../callbacks/index.js";
|
|
5
6
|
import { BaseCallbackConfig } from "../../callbacks/manager.js";
|
|
6
7
|
import { BasePromptTemplate } from "../../prompts/index.js";
|
|
7
|
-
import { StructuredTool } from "../../tools/index.js";
|
|
8
8
|
import { BaseChatModel } from "../../chat_models/base.js";
|
|
9
9
|
/**
|
|
10
10
|
* A parser for the output of the TrajectoryEvalChain.
|
|
@@ -27,20 +27,20 @@ export declare class TrajectoryEvalChain extends AgentTrajectoryEvaluator {
|
|
|
27
27
|
requiresInput: boolean;
|
|
28
28
|
requiresReference: boolean;
|
|
29
29
|
outputParser: TrajectoryOutputParser;
|
|
30
|
-
static resolveTrajectoryPrompt(prompt?: BasePromptTemplate | undefined, agentTools?:
|
|
30
|
+
static resolveTrajectoryPrompt(prompt?: BasePromptTemplate | undefined, agentTools?: StructuredToolInterface[]): BasePromptTemplate<any, import("@langchain/core/prompt_values").BasePromptValueInterface, any> | import("../../prompts/index.js").ChatPromptTemplate<any, any>;
|
|
31
31
|
/**
|
|
32
32
|
* Get the description of the agent tools.
|
|
33
33
|
*
|
|
34
34
|
* @returns The description of the agent tools.
|
|
35
35
|
*/
|
|
36
|
-
static toolsDescription(agentTools:
|
|
36
|
+
static toolsDescription(agentTools: StructuredToolInterface[]): string;
|
|
37
37
|
/**
|
|
38
38
|
* Create a new TrajectoryEvalChain.
|
|
39
39
|
* @param llm
|
|
40
40
|
* @param agentTools - The tools used by the agent.
|
|
41
41
|
* @param chainOptions - The options for the chain.
|
|
42
42
|
*/
|
|
43
|
-
static fromLLM(llm: BaseChatModel, agentTools?:
|
|
43
|
+
static fromLLM(llm: BaseChatModel, agentTools?: StructuredToolInterface[], chainOptions?: Partial<Omit<LLMEvalChainInput, "llm">>): Promise<TrajectoryEvalChain>;
|
|
44
44
|
_prepareOutput(result: ChainValues): any;
|
|
45
45
|
/**
|
|
46
46
|
* Get the agent trajectory as a formatted string.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
1
2
|
import { BaseChain, LLMChain, LLMChainInput } from "../chains/index.js";
|
|
2
3
|
import { AgentStep, ChainValues } from "../schema/index.js";
|
|
3
|
-
import { BaseLanguageModel } from "../base_language/index.js";
|
|
4
4
|
import { Callbacks } from "../callbacks/index.js";
|
|
5
5
|
import { BaseCallbackConfig } from "../callbacks/manager.js";
|
|
6
6
|
/**
|
|
7
7
|
* Base input for evaluators.
|
|
8
8
|
*/
|
|
9
|
-
export interface LLMEvalChainInput<T extends EvalOutputType = EvalOutputType, L extends
|
|
9
|
+
export interface LLMEvalChainInput<T extends EvalOutputType = EvalOutputType, L extends BaseLanguageModelInterface = BaseLanguageModelInterface> extends LLMChainInput<T, L> {
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Compare two sets for equality
|
|
@@ -22,7 +22,7 @@ export type EvalOutputType = Record<string, string | number | boolean>;
|
|
|
22
22
|
/**
|
|
23
23
|
* Base llm chain class for evaluators.
|
|
24
24
|
*/
|
|
25
|
-
export declare abstract class LLMEvalChain<T extends EvalOutputType = EvalOutputType, L extends
|
|
25
|
+
export declare abstract class LLMEvalChain<T extends EvalOutputType = EvalOutputType, L extends BaseLanguageModelInterface = BaseLanguageModelInterface> extends LLMChain<T, L> {
|
|
26
26
|
requiresInput?: boolean;
|
|
27
27
|
requiresReference?: boolean;
|
|
28
28
|
skipInputWarning?: string;
|
|
@@ -98,7 +98,7 @@ export interface LLMTrajectoryEvaluatorArgs {
|
|
|
98
98
|
* Grade, tag, or otherwise evaluate predictions relative to their inputs
|
|
99
99
|
* and/or reference labels
|
|
100
100
|
*/
|
|
101
|
-
export declare abstract class LLMStringEvaluator<T extends EvalOutputType = EvalOutputType, L extends
|
|
101
|
+
export declare abstract class LLMStringEvaluator<T extends EvalOutputType = EvalOutputType, L extends BaseLanguageModelInterface = BaseLanguageModelInterface> extends LLMEvalChain<T, L> {
|
|
102
102
|
/**
|
|
103
103
|
* The name of the evaluation.
|
|
104
104
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
1
2
|
import { BaseLLMOutputParser } from "../../schema/output_parser.js";
|
|
2
3
|
import { EvalOutputType, LLMEvalChainInput, LLMPairwiseStringEvaluator, LLMPairwiseStringEvaluatorArgs } from "../base.js";
|
|
3
4
|
import { ChainValues, ChatGeneration, Generation } from "../../schema/index.js";
|
|
4
|
-
import { BaseLanguageModel } from "../../base_language/index.js";
|
|
5
5
|
import { Callbacks } from "../../callbacks/index.js";
|
|
6
6
|
import { BaseCallbackConfig } from "../../callbacks/manager.js";
|
|
7
7
|
import { BasePromptTemplate } from "../../prompts/index.js";
|
|
@@ -27,14 +27,14 @@ export declare class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator
|
|
|
27
27
|
skipReferenceWarning: string;
|
|
28
28
|
outputParser: PairwiseStringResultOutputParser;
|
|
29
29
|
static resolvePairwiseCriteria(criteria?: CriteriaLike): Record<string, string>;
|
|
30
|
-
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import("
|
|
30
|
+
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import("@langchain/core/prompt_values").BasePromptValueInterface, any>;
|
|
31
31
|
/**
|
|
32
32
|
* Create a new instance of the PairwiseStringEvalChain.
|
|
33
33
|
* @param llm
|
|
34
34
|
* @param criteria The criteria to use for evaluation.
|
|
35
35
|
* @param chainOptions Options to pass to the chain.
|
|
36
36
|
*/
|
|
37
|
-
static fromLLM(llm:
|
|
37
|
+
static fromLLM(llm: BaseLanguageModelInterface, criteria?: CriteriaLike, chainOptions?: Partial<Omit<LLMEvalChainInput, "llm">>): Promise<PairwiseStringEvalChain>;
|
|
38
38
|
_prepareOutput(result: ChainValues): any;
|
|
39
39
|
_evaluateStringPairs(args: LLMPairwiseStringEvaluatorArgs, callOptions: this["llm"]["CallOptions"], config?: Callbacks | BaseCallbackConfig): Promise<ChainValues>;
|
|
40
40
|
}
|
|
@@ -46,5 +46,5 @@ export declare class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator
|
|
|
46
46
|
export declare class LabeledPairwiseStringEvalChain extends PairwiseStringEvalChain {
|
|
47
47
|
static lc_name(): string;
|
|
48
48
|
requiresReference: boolean;
|
|
49
|
-
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import("
|
|
49
|
+
static resolvePairwisePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import("@langchain/core/prompt_values").BasePromptValueInterface, any>;
|
|
50
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
1
2
|
import { BaseLLMOutputParser } from "../../schema/output_parser.js";
|
|
2
3
|
import { EvalOutputType, LLMEvalChainInput, LLMStringEvaluator, StringEvaluatorArgs } from "../base.js";
|
|
3
4
|
import { ChainValues, ChatGeneration, Generation } from "../../schema/index.js";
|
|
4
|
-
import { BaseLanguageModel } from "../../base_language/index.js";
|
|
5
5
|
import { Callbacks } from "../../callbacks/index.js";
|
|
6
6
|
import { BaseCallbackConfig } from "../../callbacks/manager.js";
|
|
7
7
|
import { BasePromptTemplate } from "../../prompts/index.js";
|
|
@@ -47,14 +47,14 @@ export declare class CriteriaEvalChain extends LLMStringEvaluator {
|
|
|
47
47
|
* Resolve the prompt to use for the evaluation.
|
|
48
48
|
* @param prompt
|
|
49
49
|
*/
|
|
50
|
-
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import("
|
|
50
|
+
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import("@langchain/core/prompt_values").BasePromptValueInterface, any>;
|
|
51
51
|
/**
|
|
52
52
|
* Create a new instance of the CriteriaEvalChain.
|
|
53
53
|
* @param llm
|
|
54
54
|
* @param criteria
|
|
55
55
|
* @param chainOptions Options to pass to the constructor of the LLMChain.
|
|
56
56
|
*/
|
|
57
|
-
static fromLLM(llm:
|
|
57
|
+
static fromLLM(llm: BaseLanguageModelInterface, criteria?: CriteriaLike, chainOptions?: Partial<Omit<LLMEvalChainInput, "llm">>): Promise<CriteriaEvalChain>;
|
|
58
58
|
getEvalInput({ input, prediction, reference, }: StringEvaluatorArgs): CriteriaEvalInput;
|
|
59
59
|
/**
|
|
60
60
|
* Prepare the output of the evaluation.
|
|
@@ -69,5 +69,5 @@ export declare class CriteriaEvalChain extends LLMStringEvaluator {
|
|
|
69
69
|
export declare class LabeledCriteriaEvalChain extends CriteriaEvalChain {
|
|
70
70
|
static lc_name(): string;
|
|
71
71
|
requiresReference: boolean;
|
|
72
|
-
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import("
|
|
72
|
+
static resolvePrompt(prompt?: BasePromptTemplate): BasePromptTemplate<any, import("@langchain/core/prompt_values").BasePromptValueInterface, any>;
|
|
73
73
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { EmbeddingsInterface } from "@langchain/core/embeddings";
|
|
1
2
|
import { PairwiseStringEvaluator, PairwiseStringEvaluatorArgs, StringEvaluator, StringEvaluatorArgs } from "../base.js";
|
|
2
3
|
import { ChainValues } from "../../schema/index.js";
|
|
3
4
|
import { CallbackManagerForChainRun, Callbacks } from "../../callbacks/index.js";
|
|
4
5
|
import { BaseCallbackConfig } from "../../callbacks/manager.js";
|
|
5
|
-
import { Embeddings } from "../../embeddings/base.js";
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* Embedding Distance Metric.
|
|
@@ -21,7 +21,7 @@ export interface EmbeddingDistanceEvalChainInput {
|
|
|
21
21
|
/**
|
|
22
22
|
* The embedding objects to vectorize the outputs.
|
|
23
23
|
*/
|
|
24
|
-
embedding?:
|
|
24
|
+
embedding?: EmbeddingsInterface;
|
|
25
25
|
/**
|
|
26
26
|
* The distance metric to use
|
|
27
27
|
* for comparing the embeddings.
|
|
@@ -50,7 +50,7 @@ export declare class EmbeddingDistanceEvalChain extends StringEvaluator implemen
|
|
|
50
50
|
requiresReference: boolean;
|
|
51
51
|
requiresInput: boolean;
|
|
52
52
|
outputKey: string;
|
|
53
|
-
embedding?:
|
|
53
|
+
embedding?: EmbeddingsInterface;
|
|
54
54
|
distanceMetric: EmbeddingDistanceType;
|
|
55
55
|
constructor(fields: EmbeddingDistanceEvalChainInput);
|
|
56
56
|
_chainType(): "embedding_cosine_distance" | "embedding_euclidean_distance" | "embedding_manhattan_distance" | "embedding_chebyshev_distance";
|
|
@@ -66,7 +66,7 @@ export declare class PairwiseEmbeddingDistanceEvalChain extends PairwiseStringEv
|
|
|
66
66
|
requiresReference: boolean;
|
|
67
67
|
requiresInput: boolean;
|
|
68
68
|
outputKey: string;
|
|
69
|
-
embedding?:
|
|
69
|
+
embedding?: EmbeddingsInterface;
|
|
70
70
|
distanceMetric: EmbeddingDistanceType;
|
|
71
71
|
constructor(fields: EmbeddingDistanceEvalChainInput);
|
|
72
72
|
_chainType(): "pairwise_embedding_cosine_distance" | "pairwise_embedding_euclidean_distance" | "pairwise_embedding_manhattan_distance" | "pairwise_embedding_chebyshev_distance";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
2
|
+
import type { StructuredToolInterface } from "@langchain/core/tools";
|
|
2
3
|
import { CriteriaLike } from "./criteria/index.js";
|
|
3
4
|
import type { EvaluatorType } from "./types.js";
|
|
4
|
-
import { StructuredTool } from "../tools/index.js";
|
|
5
5
|
import { LLMEvalChainInput } from "./base.js";
|
|
6
6
|
import { EmbeddingDistanceEvalChainInput } from "./embedding_distance/index.js";
|
|
7
7
|
export type LoadEvaluatorOptions = EmbeddingDistanceEvalChainInput & {
|
|
8
|
-
llm?:
|
|
8
|
+
llm?: BaseLanguageModelInterface;
|
|
9
9
|
chainOptions?: Partial<Omit<LLMEvalChainInput, "llm">>;
|
|
10
10
|
/**
|
|
11
11
|
* The criteria to use for the evaluator.
|
|
@@ -14,7 +14,7 @@ export type LoadEvaluatorOptions = EmbeddingDistanceEvalChainInput & {
|
|
|
14
14
|
/**
|
|
15
15
|
* A list of tools available to the agent, for TrajectoryEvalChain.
|
|
16
16
|
*/
|
|
17
|
-
agentTools?:
|
|
17
|
+
agentTools?: StructuredToolInterface[];
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* Load the requested evaluation chain specified by a string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
1
2
|
import { LLMChain, LLMChainInput } from "../../chains/llm_chain.js";
|
|
2
3
|
import { PromptTemplate } from "../../prompts/prompt.js";
|
|
3
|
-
import { BaseLanguageModel } from "../../base_language/index.js";
|
|
4
4
|
import { ChainValues } from "../../schema/index.js";
|
|
5
5
|
export interface EvaluateArgs {
|
|
6
6
|
questionKey: string;
|
|
@@ -9,7 +9,7 @@ export interface EvaluateArgs {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class QAEvalChain extends LLMChain {
|
|
11
11
|
static lc_name(): string;
|
|
12
|
-
static fromLlm(llm:
|
|
12
|
+
static fromLlm(llm: BaseLanguageModelInterface, options?: {
|
|
13
13
|
prompt?: PromptTemplate;
|
|
14
14
|
chainInput?: Omit<LLMChainInput, "llm">;
|
|
15
15
|
}): QAEvalChain;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { VectorStoreRetrieverInterface } from "@langchain/core/vectorstores";
|
|
1
2
|
import { LLMChain } from "../../chains/llm_chain.js";
|
|
2
3
|
import { BaseChatModel } from "../../chat_models/base.js";
|
|
3
|
-
import { VectorStoreRetriever } from "../../vectorstores/base.js";
|
|
4
4
|
import { Tool } from "../../tools/base.js";
|
|
5
5
|
import { AutoGPTOutputParser } from "./output_parser.js";
|
|
6
6
|
import { BaseMessage } from "../../schema/index.js";
|
|
@@ -12,7 +12,7 @@ import { TokenTextSplitter } from "../../text_splitter.js";
|
|
|
12
12
|
export interface AutoGPTInput {
|
|
13
13
|
aiName: string;
|
|
14
14
|
aiRole: string;
|
|
15
|
-
memory:
|
|
15
|
+
memory: VectorStoreRetrieverInterface;
|
|
16
16
|
humanInTheLoop?: boolean;
|
|
17
17
|
outputParser?: AutoGPTOutputParser;
|
|
18
18
|
maxIterations?: number;
|
|
@@ -45,7 +45,7 @@ export interface AutoGPTInput {
|
|
|
45
45
|
*/
|
|
46
46
|
export declare class AutoGPT {
|
|
47
47
|
aiName: string;
|
|
48
|
-
memory:
|
|
48
|
+
memory: VectorStoreRetrieverInterface;
|
|
49
49
|
fullMessageHistory: BaseMessage[];
|
|
50
50
|
nextActionCount: number;
|
|
51
51
|
chain: LLMChain;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { VectorStoreRetrieverInterface } from "@langchain/core/vectorstores";
|
|
1
2
|
import { BaseChatPromptTemplate } from "../../prompts/chat.js";
|
|
2
3
|
import { BaseMessage, PartialValues } from "../../schema/index.js";
|
|
3
|
-
import { VectorStoreRetriever } from "../../vectorstores/base.js";
|
|
4
4
|
import { ObjectTool } from "./schema.js";
|
|
5
5
|
import { SerializedBasePromptTemplate } from "../../prompts/serde.js";
|
|
6
6
|
/**
|
|
@@ -43,7 +43,7 @@ export declare class AutoGPTPrompt extends BaseChatPromptTemplate implements Aut
|
|
|
43
43
|
*/
|
|
44
44
|
formatMessages({ goals, memory, messages: previousMessages, user_input, }: {
|
|
45
45
|
goals: string[];
|
|
46
|
-
memory:
|
|
46
|
+
memory: VectorStoreRetrieverInterface;
|
|
47
47
|
messages: BaseMessage[];
|
|
48
48
|
user_input: string;
|
|
49
49
|
}): Promise<BaseMessage[]>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
2
|
+
import type { VectorStoreInterface } from "@langchain/core/vectorstores";
|
|
2
3
|
import { CallbackManagerForChainRun } from "../../callbacks/manager.js";
|
|
3
4
|
import { BaseChain, ChainInputs } from "../../chains/base.js";
|
|
4
5
|
import { SerializedBaseChain } from "../../chains/serde.js";
|
|
5
6
|
import { ChainValues } from "../../schema/index.js";
|
|
6
7
|
import { Optional } from "../../types/type-utils.js";
|
|
7
|
-
import { VectorStore } from "../../vectorstores/base.js";
|
|
8
8
|
/**
|
|
9
9
|
* Interface defining the structure of a task. A task has a `taskID` and a
|
|
10
10
|
* `taskName`.
|
|
@@ -23,7 +23,7 @@ export interface BabyAGIInputs extends Omit<ChainInputs, "memory" | "callbackMan
|
|
|
23
23
|
creationChain: BaseChain;
|
|
24
24
|
prioritizationChain: BaseChain;
|
|
25
25
|
executionChain: BaseChain;
|
|
26
|
-
vectorstore:
|
|
26
|
+
vectorstore: VectorStoreInterface;
|
|
27
27
|
maxIterations?: number;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
@@ -51,7 +51,7 @@ export declare class BabyAGI extends BaseChain implements BabyAGIInputs {
|
|
|
51
51
|
prioritizationChain: BaseChain;
|
|
52
52
|
executionChain: BaseChain;
|
|
53
53
|
taskIDCounter: number;
|
|
54
|
-
vectorstore:
|
|
54
|
+
vectorstore: VectorStoreInterface;
|
|
55
55
|
maxIterations: number;
|
|
56
56
|
constructor({ creationChain, prioritizationChain, executionChain, vectorstore, maxIterations, verbose, callbacks, }: BabyAGIInputs);
|
|
57
57
|
_chainType(): "BabyAGI";
|
|
@@ -130,6 +130,6 @@ export declare class BabyAGI extends BaseChain implements BabyAGIInputs {
|
|
|
130
130
|
* @returns A new instance of BabyAGI.
|
|
131
131
|
*/
|
|
132
132
|
static fromLLM({ llm, vectorstore, executionChain, verbose, callbacks, ...rest }: Optional<BabyAGIInputs, "executionChain" | "creationChain" | "prioritizationChain"> & {
|
|
133
|
-
llm:
|
|
133
|
+
llm: BaseLanguageModelInterface;
|
|
134
134
|
}): BabyAGI;
|
|
135
135
|
}
|
package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { BaseRetrieverInterface } from "@langchain/core/retrievers";
|
|
1
2
|
import { CallbackManagerForChainRun } from "../../../callbacks/manager.js";
|
|
2
3
|
import { ChatOpenAI } from "../../../chat_models/openai.js";
|
|
3
4
|
import { JsonOutputFunctionsParser } from "../../../output_parsers/openai_functions.js";
|
|
4
5
|
import { BaseMessage, ChainValues } from "../../../schema/index.js";
|
|
5
6
|
import { StringOutputParser } from "../../../schema/output_parser.js";
|
|
6
|
-
import { BaseRetriever } from "../../../schema/retriever.js";
|
|
7
7
|
import { BaseChain, ChainInputs } from "../../../chains/base.js";
|
|
8
8
|
import { MessageChunkResult } from "./types.js";
|
|
9
9
|
/**
|
|
@@ -14,7 +14,7 @@ export interface ViolationOfExpectationsChainInput extends ChainInputs {
|
|
|
14
14
|
* The retriever to use for retrieving stored
|
|
15
15
|
* thoughts and insights.
|
|
16
16
|
*/
|
|
17
|
-
retriever:
|
|
17
|
+
retriever: BaseRetrieverInterface;
|
|
18
18
|
/**
|
|
19
19
|
* The LLM to use
|
|
20
20
|
*/
|
|
@@ -31,7 +31,7 @@ export declare class ViolationOfExpectationsChain extends BaseChain implements V
|
|
|
31
31
|
thoughtsKey: string;
|
|
32
32
|
get inputKeys(): string[];
|
|
33
33
|
get outputKeys(): string[];
|
|
34
|
-
retriever:
|
|
34
|
+
retriever: BaseRetrieverInterface;
|
|
35
35
|
llm: ChatOpenAI;
|
|
36
36
|
jsonOutputParser: JsonOutputFunctionsParser;
|
|
37
37
|
stringOutputParser: StringOutputParser;
|
|
@@ -144,5 +144,5 @@ export declare class ViolationOfExpectationsChain extends BaseChain implements V
|
|
|
144
144
|
*
|
|
145
145
|
* @returns A new instance of ViolationOfExpectationsChain.
|
|
146
146
|
*/
|
|
147
|
-
static fromLLM(llm: ChatOpenAI, retriever:
|
|
147
|
+
static fromLLM(llm: ChatOpenAI, retriever: BaseRetrieverInterface, options?: Partial<Omit<ViolationOfExpectationsChainInput, "llm" | "retriever">>): ViolationOfExpectationsChain;
|
|
148
148
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import type { StructuredToolInterface } from "@langchain/core/tools";
|
|
1
2
|
import { BaseChatModel, BaseChatModelParams } from "../../chat_models/base.js";
|
|
2
3
|
import { CallbackManagerForLLMRun } from "../../callbacks/manager.js";
|
|
3
4
|
import { BaseMessage, ChatGenerationChunk, ChatResult } from "../../schema/index.js";
|
|
4
5
|
import { type AnthropicInput } from "../../chat_models/anthropic.js";
|
|
5
6
|
import { BaseFunctionCallOptions } from "../../base_language/index.js";
|
|
6
|
-
import { StructuredTool } from "../../tools/base.js";
|
|
7
7
|
export interface ChatAnthropicFunctionsCallOptions extends BaseFunctionCallOptions {
|
|
8
|
-
tools?:
|
|
8
|
+
tools?: StructuredToolInterface[];
|
|
9
9
|
}
|
|
10
10
|
export type AnthropicFunctionsInput = Partial<AnthropicInput> & BaseChatModelParams & {
|
|
11
11
|
llm?: BaseChatModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
1
2
|
import { LLMChain } from "../../chains/llm_chain.js";
|
|
2
3
|
import { PromptTemplate } from "../../prompts/index.js";
|
|
3
|
-
import { BaseLanguageModel } from "../../base_language/index.js";
|
|
4
4
|
import { GenerativeAgentMemory } from "./generative_agent_memory.js";
|
|
5
5
|
import { ChainValues } from "../../schema/index.js";
|
|
6
6
|
import { BaseChain } from "../../chains/base.js";
|
|
@@ -60,7 +60,7 @@ export declare class GenerativeAgent extends BaseChain {
|
|
|
60
60
|
traits: string;
|
|
61
61
|
status: string;
|
|
62
62
|
longTermMemory: GenerativeAgentMemory;
|
|
63
|
-
llm:
|
|
63
|
+
llm: BaseLanguageModelInterface;
|
|
64
64
|
verbose: boolean;
|
|
65
65
|
private summary;
|
|
66
66
|
private summaryRefreshSeconds;
|
|
@@ -68,7 +68,7 @@ export declare class GenerativeAgent extends BaseChain {
|
|
|
68
68
|
_chainType(): string;
|
|
69
69
|
get inputKeys(): string[];
|
|
70
70
|
get outputKeys(): string[];
|
|
71
|
-
constructor(llm:
|
|
71
|
+
constructor(llm: BaseLanguageModelInterface, longTermMemory: GenerativeAgentMemory, config: GenerativeAgentConfig);
|
|
72
72
|
/**
|
|
73
73
|
* Parses a newline-separated string into a list of strings.
|
|
74
74
|
* @param text The string to parse.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
1
2
|
import { LLMChain } from "../../chains/llm_chain.js";
|
|
2
3
|
import { PromptTemplate } from "../../prompts/index.js";
|
|
3
4
|
import { BaseChain } from "../../chains/base.js";
|
|
@@ -5,7 +6,6 @@ import { Document } from "../../document.js";
|
|
|
5
6
|
import { TimeWeightedVectorStoreRetriever } from "../../retrievers/time_weighted.js";
|
|
6
7
|
import { BaseMemory, InputValues, OutputValues } from "../../memory/base.js";
|
|
7
8
|
import { CallbackManagerForChainRun, Callbacks } from "../../callbacks/manager.js";
|
|
8
|
-
import { BaseLanguageModel } from "../../base_language/index.js";
|
|
9
9
|
import { ChainValues } from "../../schema/index.js";
|
|
10
10
|
export type GenerativeAgentMemoryConfig = {
|
|
11
11
|
reflectionThreshold?: number;
|
|
@@ -26,10 +26,10 @@ declare class GenerativeAgentMemoryChain extends BaseChain {
|
|
|
26
26
|
reflectionThreshold?: number;
|
|
27
27
|
importanceWeight: number;
|
|
28
28
|
memoryRetriever: TimeWeightedVectorStoreRetriever;
|
|
29
|
-
llm:
|
|
29
|
+
llm: BaseLanguageModelInterface;
|
|
30
30
|
verbose: boolean;
|
|
31
31
|
private aggregateImportance;
|
|
32
|
-
constructor(llm:
|
|
32
|
+
constructor(llm: BaseLanguageModelInterface, memoryRetriever: TimeWeightedVectorStoreRetriever, config: Omit<GenerativeAgentMemoryConfig, "maxTokensLimit">);
|
|
33
33
|
_chainType(): string;
|
|
34
34
|
get inputKeys(): string[];
|
|
35
35
|
get outputKeys(): string[];
|
|
@@ -115,7 +115,7 @@ declare class GenerativeAgentMemoryChain extends BaseChain {
|
|
|
115
115
|
* ```
|
|
116
116
|
*/
|
|
117
117
|
export declare class GenerativeAgentMemory extends BaseMemory {
|
|
118
|
-
llm:
|
|
118
|
+
llm: BaseLanguageModelInterface;
|
|
119
119
|
memoryRetriever: TimeWeightedVectorStoreRetriever;
|
|
120
120
|
verbose: boolean;
|
|
121
121
|
reflectionThreshold?: number;
|
|
@@ -128,7 +128,7 @@ export declare class GenerativeAgentMemory extends BaseMemory {
|
|
|
128
128
|
mostRecentMemoriesKey: string;
|
|
129
129
|
nowKey: string;
|
|
130
130
|
memoryChain: GenerativeAgentMemoryChain;
|
|
131
|
-
constructor(llm:
|
|
131
|
+
constructor(llm: BaseLanguageModelInterface, memoryRetriever: TimeWeightedVectorStoreRetriever, config?: GenerativeAgentMemoryConfig);
|
|
132
132
|
/**
|
|
133
133
|
* Method that returns the key for relevant memories.
|
|
134
134
|
* @returns The key for relevant memories as a string.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { protos } from "@google-ai/generativelanguage";
|
|
2
2
|
import type { google } from "@google-ai/generativelanguage/build/protos/protos.js";
|
|
3
3
|
import { GoogleAuthOptions } from "google-auth-library";
|
|
4
|
+
import type { BaseLanguageModel } from "@langchain/core/language_models/base";
|
|
4
5
|
import { PromptTemplate } from "../../../prompts/index.js";
|
|
5
|
-
import { BaseLanguageModel } from "../../../base_language/index.js";
|
|
6
6
|
import { AsyncCaller, AsyncCallerCallOptions } from "../../../util/async_caller.js";
|
|
7
7
|
import { GoogleAbstractedClientOpsMethod, GoogleResponse, GoogleVertexAIConnectionParams } from "../../../types/googlevertexai-types.js";
|
|
8
8
|
import { GoogleConnection } from "../../../util/googlevertexai-connection.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
|
|
1
2
|
import { BaseChain, ChainInputs } from "../../chains/base.js";
|
|
2
3
|
import { BasePlanner, BaseStepContainer, BaseStepExecutor, LLMPlanner, ChainStepExecutor } from "./base.js";
|
|
3
4
|
import { ChainValues } from "../../schema/index.js";
|
|
4
|
-
import { BaseLanguageModel } from "../../base_language/index.js";
|
|
5
5
|
import { CallbackManagerForChainRun } from "../../callbacks/manager.js";
|
|
6
6
|
import { Tool } from "../../tools/base.js";
|
|
7
7
|
import { DynamicStructuredTool } from "../../tools/dynamic.js";
|
|
@@ -48,7 +48,7 @@ export declare class PlanAndExecuteAgentExecutor extends BaseChain {
|
|
|
48
48
|
* @returns A new LLMPlanner instance.
|
|
49
49
|
*/
|
|
50
50
|
static getDefaultPlanner({ llm, tools, }: {
|
|
51
|
-
llm:
|
|
51
|
+
llm: BaseLanguageModelInterface;
|
|
52
52
|
tools: Tool[] | DynamicStructuredTool[];
|
|
53
53
|
}): Promise<LLMPlanner>;
|
|
54
54
|
/**
|
|
@@ -61,7 +61,7 @@ export declare class PlanAndExecuteAgentExecutor extends BaseChain {
|
|
|
61
61
|
* @returns A new ChainStepExecutor instance.
|
|
62
62
|
*/
|
|
63
63
|
static getDefaultStepExecutor({ llm, tools, humanMessageTemplate, }: {
|
|
64
|
-
llm:
|
|
64
|
+
llm: BaseLanguageModelInterface;
|
|
65
65
|
tools: Tool[] | DynamicStructuredTool[];
|
|
66
66
|
humanMessageTemplate?: string;
|
|
67
67
|
}): ChainStepExecutor;
|
|
@@ -76,7 +76,7 @@ export declare class PlanAndExecuteAgentExecutor extends BaseChain {
|
|
|
76
76
|
* @returns A new PlanAndExecuteAgentExecutor instance.
|
|
77
77
|
*/
|
|
78
78
|
static fromLLMAndTools({ llm, tools, humanMessageTemplate, }: {
|
|
79
|
-
llm:
|
|
79
|
+
llm: BaseLanguageModelInterface;
|
|
80
80
|
tools: Tool[] | DynamicStructuredTool[];
|
|
81
81
|
humanMessageTemplate?: string;
|
|
82
82
|
} & Omit<PlanAndExecuteAgentExecutorInput, "planner" | "stepExecutor">): Promise<PlanAndExecuteAgentExecutor>;
|