langchain 0.0.129 → 0.0.131
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/chat/index.cjs +3 -0
- package/dist/agents/chat/index.d.ts +1 -0
- package/dist/agents/chat/index.js +3 -0
- package/dist/agents/chat_convo/index.cjs +3 -0
- package/dist/agents/chat_convo/index.d.ts +1 -0
- package/dist/agents/chat_convo/index.js +3 -0
- package/dist/agents/executor.cjs +3 -0
- package/dist/agents/executor.d.ts +1 -0
- package/dist/agents/executor.js +3 -0
- package/dist/agents/mrkl/index.cjs +3 -0
- package/dist/agents/mrkl/index.d.ts +1 -0
- package/dist/agents/mrkl/index.js +3 -0
- package/dist/agents/openai/index.cjs +3 -0
- package/dist/agents/openai/index.d.ts +1 -0
- package/dist/agents/openai/index.js +3 -0
- package/dist/agents/structured_chat/index.cjs +3 -0
- package/dist/agents/structured_chat/index.d.ts +1 -0
- package/dist/agents/structured_chat/index.js +3 -0
- package/dist/callbacks/base.cjs +18 -0
- package/dist/callbacks/base.d.ts +15 -0
- package/dist/callbacks/base.js +19 -1
- package/dist/callbacks/manager.cjs +1 -1
- package/dist/callbacks/manager.js +1 -1
- package/dist/chains/analyze_documents_chain.cjs +3 -0
- package/dist/chains/analyze_documents_chain.d.ts +1 -0
- package/dist/chains/analyze_documents_chain.js +3 -0
- package/dist/chains/combine_docs_chain.cjs +9 -0
- package/dist/chains/combine_docs_chain.d.ts +3 -0
- package/dist/chains/combine_docs_chain.js +9 -0
- package/dist/chains/constitutional_ai/constitutional_chain.cjs +3 -0
- package/dist/chains/constitutional_ai/constitutional_chain.d.ts +1 -0
- package/dist/chains/constitutional_ai/constitutional_chain.js +3 -0
- package/dist/chains/conversation.cjs +3 -0
- package/dist/chains/conversation.d.ts +1 -0
- package/dist/chains/conversation.js +3 -0
- package/dist/chains/conversational_retrieval_chain.cjs +3 -0
- package/dist/chains/conversational_retrieval_chain.d.ts +1 -0
- package/dist/chains/conversational_retrieval_chain.js +3 -0
- package/dist/chains/llm_chain.cjs +3 -0
- package/dist/chains/llm_chain.d.ts +1 -0
- package/dist/chains/llm_chain.js +3 -0
- package/dist/chains/openai_functions/openapi.cjs +3 -0
- package/dist/chains/openai_functions/openapi.js +3 -0
- package/dist/chains/openai_moderation.cjs +3 -0
- package/dist/chains/openai_moderation.d.ts +1 -0
- package/dist/chains/openai_moderation.js +3 -0
- package/dist/chains/retrieval_qa.cjs +3 -0
- package/dist/chains/retrieval_qa.d.ts +1 -0
- package/dist/chains/retrieval_qa.js +3 -0
- package/dist/chains/router/multi_route.cjs +3 -0
- package/dist/chains/router/multi_route.d.ts +1 -0
- package/dist/chains/router/multi_route.js +3 -0
- package/dist/chains/sequential_chain.cjs +6 -0
- package/dist/chains/sequential_chain.d.ts +2 -0
- package/dist/chains/sequential_chain.js +6 -0
- package/dist/chains/sql_db/sql_db_chain.cjs +3 -0
- package/dist/chains/sql_db/sql_db_chain.d.ts +1 -0
- package/dist/chains/sql_db/sql_db_chain.js +3 -0
- package/dist/chains/transform.cjs +3 -0
- package/dist/chains/transform.d.ts +1 -0
- package/dist/chains/transform.js +3 -0
- package/dist/chains/vector_db_qa.cjs +3 -0
- package/dist/chains/vector_db_qa.d.ts +1 -0
- package/dist/chains/vector_db_qa.js +3 -0
- package/dist/chat_models/anthropic.cjs +3 -0
- package/dist/chat_models/anthropic.d.ts +1 -0
- package/dist/chat_models/anthropic.js +3 -0
- package/dist/chat_models/baiduwenxin.cjs +3 -13
- package/dist/chat_models/baiduwenxin.d.ts +1 -3
- package/dist/chat_models/baiduwenxin.js +3 -13
- package/dist/chat_models/googlepalm.cjs +9 -0
- package/dist/chat_models/googlepalm.d.ts +2 -0
- package/dist/chat_models/googlepalm.js +9 -0
- package/dist/chat_models/googlevertexai.cjs +9 -0
- package/dist/chat_models/googlevertexai.d.ts +2 -0
- package/dist/chat_models/googlevertexai.js +9 -0
- package/dist/chat_models/ollama.cjs +3 -0
- package/dist/chat_models/ollama.d.ts +1 -0
- package/dist/chat_models/ollama.js +3 -0
- package/dist/chat_models/openai.cjs +19 -5
- package/dist/chat_models/openai.d.ts +7 -5
- package/dist/chat_models/openai.js +19 -5
- package/dist/document_loaders/web/youtube.cjs +77 -0
- package/dist/document_loaders/web/youtube.d.ts +17 -0
- package/dist/document_loaders/web/youtube.js +73 -0
- package/dist/document_transformers/html_to_text.cjs +3 -0
- package/dist/document_transformers/html_to_text.d.ts +1 -0
- package/dist/document_transformers/html_to_text.js +3 -0
- package/dist/document_transformers/mozilla_readability.cjs +3 -0
- package/dist/document_transformers/mozilla_readability.d.ts +1 -0
- package/dist/document_transformers/mozilla_readability.js +3 -0
- package/dist/document_transformers/openai_functions.cjs +3 -0
- package/dist/document_transformers/openai_functions.d.ts +1 -0
- package/dist/document_transformers/openai_functions.js +3 -0
- package/dist/embeddings/cohere.cjs +16 -13
- package/dist/embeddings/cohere.js +16 -13
- package/dist/embeddings/googlevertexai.cjs +1 -1
- package/dist/embeddings/googlevertexai.js +1 -1
- package/dist/embeddings/openai.cjs +27 -21
- package/dist/embeddings/openai.js +27 -21
- package/dist/evaluation/qa/eval_chain.cjs +3 -0
- package/dist/evaluation/qa/eval_chain.d.ts +1 -0
- package/dist/evaluation/qa/eval_chain.js +3 -0
- package/dist/experimental/babyagi/agent.cjs +3 -0
- package/dist/experimental/babyagi/agent.d.ts +1 -0
- package/dist/experimental/babyagi/agent.js +3 -0
- package/dist/experimental/babyagi/task_creation.cjs +3 -0
- package/dist/experimental/babyagi/task_creation.d.ts +1 -0
- package/dist/experimental/babyagi/task_creation.js +3 -0
- package/dist/experimental/babyagi/task_execution.cjs +3 -0
- package/dist/experimental/babyagi/task_execution.d.ts +1 -0
- package/dist/experimental/babyagi/task_execution.js +3 -0
- package/dist/experimental/babyagi/task_prioritization.cjs +3 -0
- package/dist/experimental/babyagi/task_prioritization.d.ts +1 -0
- package/dist/experimental/babyagi/task_prioritization.js +3 -0
- package/dist/experimental/generative_agents/generative_agent.cjs +3 -0
- package/dist/experimental/generative_agents/generative_agent.d.ts +1 -0
- package/dist/experimental/generative_agents/generative_agent.js +3 -0
- package/dist/experimental/generative_agents/generative_agent_memory.cjs +3 -0
- package/dist/experimental/generative_agents/generative_agent_memory.d.ts +1 -0
- package/dist/experimental/generative_agents/generative_agent_memory.js +3 -0
- package/dist/experimental/plan_and_execute/agent_executor.cjs +3 -0
- package/dist/experimental/plan_and_execute/agent_executor.d.ts +1 -0
- package/dist/experimental/plan_and_execute/agent_executor.js +3 -0
- package/dist/llms/cohere.cjs +3 -0
- package/dist/llms/cohere.d.ts +1 -0
- package/dist/llms/cohere.js +3 -0
- package/dist/llms/ollama.cjs +3 -0
- package/dist/llms/ollama.d.ts +1 -0
- package/dist/llms/ollama.js +3 -0
- package/dist/llms/openai-chat.cjs +18 -4
- package/dist/llms/openai-chat.d.ts +6 -4
- package/dist/llms/openai-chat.js +18 -4
- package/dist/llms/openai.cjs +20 -6
- package/dist/llms/openai.d.ts +5 -3
- package/dist/llms/openai.js +20 -6
- package/dist/llms/replicate.cjs +3 -0
- package/dist/llms/replicate.d.ts +1 -0
- package/dist/llms/replicate.js +3 -0
- package/dist/load/import_constants.cjs +1 -0
- package/dist/load/import_constants.js +1 -0
- package/dist/load/index.cjs +7 -1
- package/dist/load/index.js +7 -1
- package/dist/load/serializable.cjs +42 -3
- package/dist/load/serializable.d.ts +16 -0
- package/dist/load/serializable.js +40 -2
- package/dist/output_parsers/combining.cjs +3 -0
- package/dist/output_parsers/combining.d.ts +1 -0
- package/dist/output_parsers/combining.js +3 -0
- package/dist/output_parsers/fix.cjs +3 -0
- package/dist/output_parsers/fix.d.ts +1 -0
- package/dist/output_parsers/fix.js +3 -0
- package/dist/output_parsers/list.cjs +3 -0
- package/dist/output_parsers/list.d.ts +1 -0
- package/dist/output_parsers/list.js +3 -0
- package/dist/output_parsers/noop.cjs +3 -0
- package/dist/output_parsers/noop.d.ts +1 -0
- package/dist/output_parsers/noop.js +3 -0
- package/dist/output_parsers/openai_functions.cjs +9 -0
- package/dist/output_parsers/openai_functions.d.ts +3 -0
- package/dist/output_parsers/openai_functions.js +9 -0
- package/dist/output_parsers/regex.cjs +3 -0
- package/dist/output_parsers/regex.d.ts +1 -0
- package/dist/output_parsers/regex.js +3 -0
- package/dist/output_parsers/structured.cjs +6 -0
- package/dist/output_parsers/structured.d.ts +2 -0
- package/dist/output_parsers/structured.js +6 -0
- package/dist/prompts/chat.cjs +21 -0
- package/dist/prompts/chat.d.ts +7 -0
- package/dist/prompts/chat.js +21 -0
- package/dist/prompts/pipeline.cjs +3 -0
- package/dist/prompts/pipeline.d.ts +1 -0
- package/dist/prompts/pipeline.js +3 -0
- package/dist/prompts/prompt.cjs +3 -0
- package/dist/prompts/prompt.d.ts +1 -0
- package/dist/prompts/prompt.js +3 -0
- package/dist/retrievers/amazon_kendra.cjs +3 -0
- package/dist/retrievers/amazon_kendra.d.ts +1 -0
- package/dist/retrievers/amazon_kendra.js +3 -0
- package/dist/retrievers/contextual_compression.cjs +3 -0
- package/dist/retrievers/contextual_compression.d.ts +1 -0
- package/dist/retrievers/contextual_compression.js +3 -0
- package/dist/retrievers/databerry.cjs +3 -0
- package/dist/retrievers/databerry.d.ts +1 -0
- package/dist/retrievers/databerry.js +3 -0
- package/dist/retrievers/hyde.cjs +3 -0
- package/dist/retrievers/hyde.d.ts +1 -0
- package/dist/retrievers/hyde.js +3 -0
- package/dist/retrievers/metal.cjs +3 -0
- package/dist/retrievers/metal.d.ts +1 -0
- package/dist/retrievers/metal.js +3 -0
- package/dist/retrievers/parent_document.cjs +3 -0
- package/dist/retrievers/parent_document.d.ts +1 -0
- package/dist/retrievers/parent_document.js +3 -0
- package/dist/retrievers/self_query/index.cjs +3 -0
- package/dist/retrievers/self_query/index.d.ts +1 -0
- package/dist/retrievers/self_query/index.js +3 -0
- package/dist/retrievers/self_query/supabase.cjs +28 -7
- package/dist/retrievers/self_query/supabase.d.ts +2 -2
- package/dist/retrievers/self_query/supabase.js +29 -8
- package/dist/retrievers/self_query/supabase_utils.cjs +177 -0
- package/dist/retrievers/self_query/supabase_utils.d.ts +24 -0
- package/dist/retrievers/self_query/supabase_utils.js +172 -0
- package/dist/retrievers/self_query/utils.cjs +19 -3
- package/dist/retrievers/self_query/utils.d.ts +3 -0
- package/dist/retrievers/self_query/utils.js +15 -2
- package/dist/retrievers/self_query/weaviate.cjs +3 -14
- package/dist/retrievers/self_query/weaviate.js +1 -12
- package/dist/retrievers/supabase.cjs +3 -0
- package/dist/retrievers/supabase.d.ts +1 -0
- package/dist/retrievers/supabase.js +3 -0
- package/dist/retrievers/time_weighted.cjs +3 -0
- package/dist/retrievers/time_weighted.d.ts +1 -0
- package/dist/retrievers/time_weighted.js +3 -0
- package/dist/retrievers/vespa.cjs +3 -0
- package/dist/retrievers/vespa.d.ts +1 -0
- package/dist/retrievers/vespa.js +3 -0
- package/dist/retrievers/zep.cjs +3 -0
- package/dist/retrievers/zep.d.ts +1 -0
- package/dist/retrievers/zep.js +3 -0
- package/dist/schema/index.cjs +32 -2
- package/dist/schema/index.d.ts +14 -0
- package/dist/schema/index.js +32 -2
- package/dist/schema/output_parser.cjs +6 -0
- package/dist/schema/output_parser.d.ts +2 -0
- package/dist/schema/output_parser.js +6 -0
- package/dist/schema/runnable.cjs +25 -7
- package/dist/schema/runnable.d.ts +6 -0
- package/dist/schema/runnable.js +25 -7
- package/dist/stores/message/utils.cjs +5 -0
- package/dist/stores/message/utils.js +6 -1
- package/dist/text_splitter.cjs +9 -0
- package/dist/text_splitter.d.ts +3 -0
- package/dist/text_splitter.js +9 -0
- package/dist/tools/IFTTTWebhook.cjs +3 -0
- package/dist/tools/IFTTTWebhook.d.ts +1 -0
- package/dist/tools/IFTTTWebhook.js +3 -0
- package/dist/tools/aiplugin.cjs +3 -0
- package/dist/tools/aiplugin.d.ts +1 -0
- package/dist/tools/aiplugin.js +3 -0
- package/dist/tools/aws_sfn.cjs +9 -0
- package/dist/tools/aws_sfn.d.ts +3 -0
- package/dist/tools/aws_sfn.js +9 -0
- package/dist/tools/bingserpapi.cjs +3 -0
- package/dist/tools/bingserpapi.d.ts +1 -0
- package/dist/tools/bingserpapi.js +3 -0
- package/dist/tools/brave_search.cjs +3 -0
- package/dist/tools/brave_search.d.ts +1 -0
- package/dist/tools/brave_search.js +3 -0
- package/dist/tools/calculator.cjs +3 -0
- package/dist/tools/calculator.d.ts +1 -0
- package/dist/tools/calculator.js +3 -0
- package/dist/tools/chain.cjs +3 -0
- package/dist/tools/chain.d.ts +1 -0
- package/dist/tools/chain.js +3 -0
- package/dist/tools/dadjokeapi.cjs +3 -0
- package/dist/tools/dadjokeapi.d.ts +1 -0
- package/dist/tools/dadjokeapi.js +3 -0
- package/dist/tools/dataforseo_api_search.cjs +3 -0
- package/dist/tools/dataforseo_api_search.d.ts +1 -0
- package/dist/tools/dataforseo_api_search.js +3 -0
- package/dist/tools/dynamic.cjs +6 -0
- package/dist/tools/dynamic.d.ts +2 -0
- package/dist/tools/dynamic.js +6 -0
- package/dist/tools/fs.cjs +6 -0
- package/dist/tools/fs.d.ts +2 -0
- package/dist/tools/fs.js +6 -0
- package/dist/tools/google_custom_search.cjs +3 -0
- package/dist/tools/google_custom_search.d.ts +1 -0
- package/dist/tools/google_custom_search.js +3 -0
- package/dist/tools/json.cjs +7 -1
- package/dist/tools/json.d.ts +2 -0
- package/dist/tools/json.js +7 -1
- package/dist/tools/requests.cjs +8 -2
- package/dist/tools/requests.d.ts +2 -0
- package/dist/tools/requests.js +8 -2
- package/dist/tools/searxng_search.cjs +3 -0
- package/dist/tools/searxng_search.d.ts +1 -0
- package/dist/tools/searxng_search.js +3 -0
- package/dist/tools/serpapi.cjs +3 -0
- package/dist/tools/serpapi.d.ts +1 -0
- package/dist/tools/serpapi.js +3 -0
- package/dist/tools/serper.cjs +3 -0
- package/dist/tools/serper.d.ts +1 -0
- package/dist/tools/serper.js +3 -0
- package/dist/tools/sql.cjs +12 -0
- package/dist/tools/sql.d.ts +4 -0
- package/dist/tools/sql.js +12 -0
- package/dist/tools/vectorstore.cjs +3 -0
- package/dist/tools/vectorstore.d.ts +1 -0
- package/dist/tools/vectorstore.js +3 -0
- package/dist/tools/webbrowser.cjs +3 -0
- package/dist/tools/webbrowser.d.ts +1 -0
- package/dist/tools/webbrowser.js +3 -0
- package/dist/tools/wikipedia_query_run.cjs +3 -0
- package/dist/tools/wikipedia_query_run.d.ts +1 -0
- package/dist/tools/wikipedia_query_run.js +3 -0
- package/dist/tools/zapier.cjs +3 -0
- package/dist/tools/zapier.d.ts +1 -0
- package/dist/tools/zapier.js +3 -0
- package/dist/vectorstores/base.cjs +3 -0
- package/dist/vectorstores/base.d.ts +1 -0
- package/dist/vectorstores/base.js +3 -0
- package/dist/vectorstores/elasticsearch.cjs +1 -0
- package/dist/vectorstores/elasticsearch.js +1 -0
- package/dist/vectorstores/hnswlib.cjs +19 -0
- package/dist/vectorstores/hnswlib.d.ts +3 -0
- package/dist/vectorstores/hnswlib.js +19 -0
- package/dist/vectorstores/myscale.cjs +1 -1
- package/dist/vectorstores/myscale.js +1 -1
- package/dist/vectorstores/supabase.d.ts +1 -2
- package/document_loaders/web/youtube.cjs +1 -0
- package/document_loaders/web/youtube.d.ts +1 -0
- package/document_loaders/web/youtube.js +1 -0
- package/package.json +27 -3
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Comparators, Comparison, Operation, Operators, StructuredQuery, } from "../../chains/query_constructor/ir.js";
|
|
2
|
+
export class ProxyParamsDuplicator {
|
|
3
|
+
constructor() {
|
|
4
|
+
Object.defineProperty(this, "duplicationAllowedOps", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true,
|
|
8
|
+
value: [
|
|
9
|
+
"eq",
|
|
10
|
+
"neq",
|
|
11
|
+
"lt",
|
|
12
|
+
"lte",
|
|
13
|
+
"gt",
|
|
14
|
+
"gte",
|
|
15
|
+
"like",
|
|
16
|
+
"ilike",
|
|
17
|
+
"or",
|
|
18
|
+
"in",
|
|
19
|
+
"contains",
|
|
20
|
+
"match",
|
|
21
|
+
"not",
|
|
22
|
+
"textSearch",
|
|
23
|
+
"filter",
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(this, "values", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: []
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
buildProxyHandler() {
|
|
34
|
+
const proxyHandler = {
|
|
35
|
+
get: (target, prop, receiver) => {
|
|
36
|
+
if (typeof target[prop] === "function") {
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
return (...args) => {
|
|
39
|
+
if (this.duplicationAllowedOps.includes(String(prop))) {
|
|
40
|
+
switch (String(prop)) {
|
|
41
|
+
case "or":
|
|
42
|
+
// args[0]: filters, args[1]: { foreignTable }
|
|
43
|
+
this.addOrClause(args[0], args[1]);
|
|
44
|
+
break;
|
|
45
|
+
case "filter":
|
|
46
|
+
// args[0]: column, args[1]: operator, args[2]: value
|
|
47
|
+
this.addFilterClause(args[0], args[1], args[2]);
|
|
48
|
+
break;
|
|
49
|
+
case "in":
|
|
50
|
+
// args[0]: column, args[1]: values
|
|
51
|
+
this.addInClause(args[0], args[1]);
|
|
52
|
+
break;
|
|
53
|
+
case "contains":
|
|
54
|
+
// args[0]: column, args[1]: value
|
|
55
|
+
this.addContainsClause(args[0], args[1]);
|
|
56
|
+
break;
|
|
57
|
+
case "textSearch":
|
|
58
|
+
// args[0]: column, args[1]: query, args[2]: { config, type }
|
|
59
|
+
this.addTextSearchClause(args[0], args[1], args[2]);
|
|
60
|
+
break;
|
|
61
|
+
case "match":
|
|
62
|
+
// args[0]: query
|
|
63
|
+
this.addMatchClause(args[0]);
|
|
64
|
+
break;
|
|
65
|
+
case "not":
|
|
66
|
+
// args[0]: column, args[1]: operator, args[2]: value
|
|
67
|
+
this.addNotClause(args[0], args[1], args[2]);
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
// args[0]: column, args[1]: value
|
|
71
|
+
this.addDefaultOpClause(prop, args[0], args[1]);
|
|
72
|
+
}
|
|
73
|
+
return new Proxy(target, proxyHandler);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
throw new Error("Filter operation not supported for 'or' mergeFiltersOperator");
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return Reflect.get(target, prop, receiver);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
return proxyHandler;
|
|
86
|
+
}
|
|
87
|
+
removeType(value) {
|
|
88
|
+
let cleanedValue = value;
|
|
89
|
+
if (cleanedValue.includes("::float")) {
|
|
90
|
+
cleanedValue = cleanedValue.replace("::float", "");
|
|
91
|
+
}
|
|
92
|
+
if (cleanedValue.includes("::int")) {
|
|
93
|
+
cleanedValue = cleanedValue.replace("::int", "");
|
|
94
|
+
}
|
|
95
|
+
return cleanedValue;
|
|
96
|
+
}
|
|
97
|
+
addDefaultOpClause(prop, column, value) {
|
|
98
|
+
this.values.push([this.removeType(column), `${String(prop)}.${value}`]);
|
|
99
|
+
}
|
|
100
|
+
addOrClause(filters, { foreignTable } = {}) {
|
|
101
|
+
const key = foreignTable ? `${foreignTable}.or` : "or";
|
|
102
|
+
this.values.push([this.removeType(key), `(${filters})`]);
|
|
103
|
+
}
|
|
104
|
+
addFilterClause(column, operator, value) {
|
|
105
|
+
this.values.push([this.removeType(column), `${operator}.${value}`]);
|
|
106
|
+
}
|
|
107
|
+
addInClause(column, values) {
|
|
108
|
+
const cleanedValues = values
|
|
109
|
+
.map((s) => {
|
|
110
|
+
if (typeof s === "string" && /[,()]/.test(s))
|
|
111
|
+
return `"${s}"`;
|
|
112
|
+
else
|
|
113
|
+
return `${s}`;
|
|
114
|
+
})
|
|
115
|
+
.join(",");
|
|
116
|
+
this.values.push([this.removeType(column), `in.(${cleanedValues})`]);
|
|
117
|
+
}
|
|
118
|
+
addContainsClause(column, value) {
|
|
119
|
+
if (typeof value === "string") {
|
|
120
|
+
this.values.push([this.removeType(column), `cs.${value}`]);
|
|
121
|
+
}
|
|
122
|
+
else if (Array.isArray(value)) {
|
|
123
|
+
this.values.push([this.removeType(column), `cs.{${value.join(",")}}`]);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.values.push([
|
|
127
|
+
this.removeType(column),
|
|
128
|
+
`cs.${JSON.stringify(value)}`,
|
|
129
|
+
]);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
addTextSearchClause(column, query, { config, type, } = {}) {
|
|
133
|
+
let typePart = "";
|
|
134
|
+
if (type === "plain") {
|
|
135
|
+
typePart = "pl";
|
|
136
|
+
}
|
|
137
|
+
else if (type === "phrase") {
|
|
138
|
+
typePart = "ph";
|
|
139
|
+
}
|
|
140
|
+
else if (type === "websearch") {
|
|
141
|
+
typePart = "w";
|
|
142
|
+
}
|
|
143
|
+
const configPart = config === undefined ? "" : `(${config})`;
|
|
144
|
+
this.values.push([
|
|
145
|
+
this.removeType(column),
|
|
146
|
+
`${typePart}fts${configPart}.${query}`,
|
|
147
|
+
]);
|
|
148
|
+
}
|
|
149
|
+
addNotClause(column, operator, value) {
|
|
150
|
+
this.values.push([column, `not.${operator}.${value}`]);
|
|
151
|
+
}
|
|
152
|
+
addMatchClause(query) {
|
|
153
|
+
Object.entries(query).forEach(([column, value]) => {
|
|
154
|
+
this.values.push([column, `eq.${value}`]);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
flattenedParams() {
|
|
158
|
+
const mapped = this.values.map(([k, v]) => `${k}.${v}`);
|
|
159
|
+
if (mapped.length === 1)
|
|
160
|
+
return mapped[0];
|
|
161
|
+
return `and(${mapped.join(",")})`;
|
|
162
|
+
}
|
|
163
|
+
static getFlattenedParams(rpc, filter) {
|
|
164
|
+
const proxiedDuplicator = new ProxyParamsDuplicator();
|
|
165
|
+
const proxiedRpc = new Proxy(rpc, proxiedDuplicator.buildProxyHandler());
|
|
166
|
+
void filter(proxiedRpc);
|
|
167
|
+
return proxiedDuplicator.flattenedParams();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
export function convertObjectFilterToStructuredQuery(objFilter) {
|
|
171
|
+
return new StructuredQuery("", new Operation(Operators.and, Object.entries(objFilter).map(([column, value]) => new Comparison(Comparators.eq, column, value))));
|
|
172
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFilterEmpty = exports.isObject = void 0;
|
|
4
|
-
|
|
3
|
+
exports.isString = exports.isFloat = exports.isInt = exports.isFilterEmpty = exports.isObject = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
5
|
function isObject(obj) {
|
|
6
6
|
return obj && typeof obj === "object" && !Array.isArray(obj);
|
|
7
7
|
}
|
|
8
8
|
exports.isObject = isObject;
|
|
9
|
-
function isFilterEmpty(
|
|
9
|
+
function isFilterEmpty(
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
filter) {
|
|
10
12
|
if (!filter)
|
|
11
13
|
return true;
|
|
12
14
|
// for Milvus
|
|
@@ -19,3 +21,17 @@ function isFilterEmpty(filter) {
|
|
|
19
21
|
return isObject(filter) && Object.keys(filter).length === 0;
|
|
20
22
|
}
|
|
21
23
|
exports.isFilterEmpty = isFilterEmpty;
|
|
24
|
+
function isInt(value) {
|
|
25
|
+
const numberValue = parseFloat(value);
|
|
26
|
+
return !Number.isNaN(numberValue) && numberValue % 1 === 0;
|
|
27
|
+
}
|
|
28
|
+
exports.isInt = isInt;
|
|
29
|
+
function isFloat(value) {
|
|
30
|
+
const numberValue = parseFloat(value);
|
|
31
|
+
return !Number.isNaN(numberValue) && numberValue % 1 !== 0;
|
|
32
|
+
}
|
|
33
|
+
exports.isFloat = isFloat;
|
|
34
|
+
function isString(value) {
|
|
35
|
+
return typeof value === "string" && Number.isNaN(parseFloat(value));
|
|
36
|
+
}
|
|
37
|
+
exports.isString = isString;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export declare function isObject(obj: any): obj is object;
|
|
2
2
|
export declare function isFilterEmpty(filter: ((q: any) => any) | object | string | undefined): filter is undefined;
|
|
3
|
+
export declare function isInt(value: unknown): boolean;
|
|
4
|
+
export declare function isFloat(value: unknown): boolean;
|
|
5
|
+
export declare function isString(value: unknown): boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
2
|
export function isObject(obj) {
|
|
3
3
|
return obj && typeof obj === "object" && !Array.isArray(obj);
|
|
4
4
|
}
|
|
5
|
-
export function isFilterEmpty(
|
|
5
|
+
export function isFilterEmpty(
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
filter) {
|
|
6
8
|
if (!filter)
|
|
7
9
|
return true;
|
|
8
10
|
// for Milvus
|
|
@@ -14,3 +16,14 @@ export function isFilterEmpty(filter) {
|
|
|
14
16
|
}
|
|
15
17
|
return isObject(filter) && Object.keys(filter).length === 0;
|
|
16
18
|
}
|
|
19
|
+
export function isInt(value) {
|
|
20
|
+
const numberValue = parseFloat(value);
|
|
21
|
+
return !Number.isNaN(numberValue) && numberValue % 1 === 0;
|
|
22
|
+
}
|
|
23
|
+
export function isFloat(value) {
|
|
24
|
+
const numberValue = parseFloat(value);
|
|
25
|
+
return !Number.isNaN(numberValue) && numberValue % 1 !== 0;
|
|
26
|
+
}
|
|
27
|
+
export function isString(value) {
|
|
28
|
+
return typeof value === "string" && Number.isNaN(parseFloat(value));
|
|
29
|
+
}
|
|
@@ -4,17 +4,6 @@ exports.WeaviateTranslator = void 0;
|
|
|
4
4
|
const ir_js_1 = require("../../chains/query_constructor/ir.cjs");
|
|
5
5
|
const base_js_1 = require("./base.cjs");
|
|
6
6
|
const utils_js_1 = require("./utils.cjs");
|
|
7
|
-
function isInt(value) {
|
|
8
|
-
const numberValue = parseFloat(value);
|
|
9
|
-
return !Number.isNaN(numberValue) && numberValue % 1 === 0;
|
|
10
|
-
}
|
|
11
|
-
function isFloat(value) {
|
|
12
|
-
const numberValue = parseFloat(value);
|
|
13
|
-
return !Number.isNaN(numberValue) && numberValue % 1 !== 0;
|
|
14
|
-
}
|
|
15
|
-
function isString(value) {
|
|
16
|
-
return typeof value === "string" && Number.isNaN(parseFloat(value));
|
|
17
|
-
}
|
|
18
7
|
class WeaviateTranslator extends base_js_1.BaseTranslator {
|
|
19
8
|
constructor() {
|
|
20
9
|
super(...arguments);
|
|
@@ -74,21 +63,21 @@ class WeaviateTranslator extends base_js_1.BaseTranslator {
|
|
|
74
63
|
};
|
|
75
64
|
}
|
|
76
65
|
visitComparison(comparison) {
|
|
77
|
-
if (isString(comparison.value)) {
|
|
66
|
+
if ((0, utils_js_1.isString)(comparison.value)) {
|
|
78
67
|
return {
|
|
79
68
|
path: [comparison.attribute],
|
|
80
69
|
operator: this.formatFunction(comparison.comparator),
|
|
81
70
|
valueText: comparison.value,
|
|
82
71
|
};
|
|
83
72
|
}
|
|
84
|
-
if (isInt(comparison.value)) {
|
|
73
|
+
if ((0, utils_js_1.isInt)(comparison.value)) {
|
|
85
74
|
return {
|
|
86
75
|
path: [comparison.attribute],
|
|
87
76
|
operator: this.formatFunction(comparison.comparator),
|
|
88
77
|
valueInt: parseInt(comparison.value, 10),
|
|
89
78
|
};
|
|
90
79
|
}
|
|
91
|
-
if (isFloat(comparison.value)) {
|
|
80
|
+
if ((0, utils_js_1.isFloat)(comparison.value)) {
|
|
92
81
|
return {
|
|
93
82
|
path: [comparison.attribute],
|
|
94
83
|
operator: this.formatFunction(comparison.comparator),
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { Comparators, Operators, } from "../../chains/query_constructor/ir.js";
|
|
2
2
|
import { BaseTranslator } from "./base.js";
|
|
3
|
-
import { isFilterEmpty } from "./utils.js";
|
|
4
|
-
function isInt(value) {
|
|
5
|
-
const numberValue = parseFloat(value);
|
|
6
|
-
return !Number.isNaN(numberValue) && numberValue % 1 === 0;
|
|
7
|
-
}
|
|
8
|
-
function isFloat(value) {
|
|
9
|
-
const numberValue = parseFloat(value);
|
|
10
|
-
return !Number.isNaN(numberValue) && numberValue % 1 !== 0;
|
|
11
|
-
}
|
|
12
|
-
function isString(value) {
|
|
13
|
-
return typeof value === "string" && Number.isNaN(parseFloat(value));
|
|
14
|
-
}
|
|
3
|
+
import { isFilterEmpty, isString, isInt, isFloat } from "./utils.js";
|
|
15
4
|
export class WeaviateTranslator extends BaseTranslator {
|
|
16
5
|
constructor() {
|
|
17
6
|
super(...arguments);
|
|
@@ -4,6 +4,9 @@ exports.SupabaseHybridSearch = void 0;
|
|
|
4
4
|
const document_js_1 = require("../document.cjs");
|
|
5
5
|
const retriever_js_1 = require("../schema/retriever.cjs");
|
|
6
6
|
class SupabaseHybridSearch extends retriever_js_1.BaseRetriever {
|
|
7
|
+
static lc_name() {
|
|
8
|
+
return "SupabaseHybridSearch";
|
|
9
|
+
}
|
|
7
10
|
constructor(embeddings, args) {
|
|
8
11
|
super(args);
|
|
9
12
|
Object.defineProperty(this, "lc_namespace", {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Document } from "../document.js";
|
|
2
2
|
import { BaseRetriever } from "../schema/retriever.js";
|
|
3
3
|
export class SupabaseHybridSearch extends BaseRetriever {
|
|
4
|
+
static lc_name() {
|
|
5
|
+
return "SupabaseHybridSearch";
|
|
6
|
+
}
|
|
4
7
|
constructor(embeddings, args) {
|
|
5
8
|
super(args);
|
|
6
9
|
Object.defineProperty(this, "lc_namespace", {
|
|
@@ -9,6 +9,9 @@ exports.BUFFER_IDX = "buffer_idx";
|
|
|
9
9
|
* ref: https://github.com/hwchase17/langchain/blob/master/langchain/retrievers/time_weighted_retriever.py
|
|
10
10
|
*/
|
|
11
11
|
class TimeWeightedVectorStoreRetriever extends retriever_js_1.BaseRetriever {
|
|
12
|
+
static lc_name() {
|
|
13
|
+
return "TimeWeightedVectorStoreRetriever";
|
|
14
|
+
}
|
|
12
15
|
get lc_namespace() {
|
|
13
16
|
return ["langchain", "retrievers", "time_weighted"];
|
|
14
17
|
}
|
|
@@ -18,6 +18,7 @@ export declare const BUFFER_IDX = "buffer_idx";
|
|
|
18
18
|
* ref: https://github.com/hwchase17/langchain/blob/master/langchain/retrievers/time_weighted_retriever.py
|
|
19
19
|
*/
|
|
20
20
|
export declare class TimeWeightedVectorStoreRetriever extends BaseRetriever {
|
|
21
|
+
static lc_name(): string;
|
|
21
22
|
get lc_namespace(): string[];
|
|
22
23
|
/**
|
|
23
24
|
* The vectorstore to store documents and determine salience.
|
|
@@ -6,6 +6,9 @@ export const BUFFER_IDX = "buffer_idx";
|
|
|
6
6
|
* ref: https://github.com/hwchase17/langchain/blob/master/langchain/retrievers/time_weighted_retriever.py
|
|
7
7
|
*/
|
|
8
8
|
export class TimeWeightedVectorStoreRetriever extends BaseRetriever {
|
|
9
|
+
static lc_name() {
|
|
10
|
+
return "TimeWeightedVectorStoreRetriever";
|
|
11
|
+
}
|
|
9
12
|
get lc_namespace() {
|
|
10
13
|
return ["langchain", "retrievers", "time_weighted"];
|
|
11
14
|
}
|
|
@@ -4,6 +4,9 @@ exports.VespaRetriever = void 0;
|
|
|
4
4
|
const document_js_1 = require("../document.cjs");
|
|
5
5
|
const base_js_1 = require("./remote/base.cjs");
|
|
6
6
|
class VespaRetriever extends base_js_1.RemoteRetriever {
|
|
7
|
+
static lc_name() {
|
|
8
|
+
return "VespaRetriever";
|
|
9
|
+
}
|
|
7
10
|
constructor(fields) {
|
|
8
11
|
super(fields);
|
|
9
12
|
Object.defineProperty(this, "lc_namespace", {
|
|
@@ -11,6 +11,7 @@ export interface VespaRetrieverParams extends RemoteRetrieverParams {
|
|
|
11
11
|
content_field: string;
|
|
12
12
|
}
|
|
13
13
|
export declare class VespaRetriever extends RemoteRetriever {
|
|
14
|
+
static lc_name(): string;
|
|
14
15
|
lc_namespace: string[];
|
|
15
16
|
query_body: object;
|
|
16
17
|
content_field: string;
|
package/dist/retrievers/vespa.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Document } from "../document.js";
|
|
2
2
|
import { RemoteRetriever, } from "./remote/base.js";
|
|
3
3
|
export class VespaRetriever extends RemoteRetriever {
|
|
4
|
+
static lc_name() {
|
|
5
|
+
return "VespaRetriever";
|
|
6
|
+
}
|
|
4
7
|
constructor(fields) {
|
|
5
8
|
super(fields);
|
|
6
9
|
Object.defineProperty(this, "lc_namespace", {
|
package/dist/retrievers/zep.cjs
CHANGED
|
@@ -5,6 +5,9 @@ const zep_js_1 = require("@getzep/zep-js");
|
|
|
5
5
|
const retriever_js_1 = require("../schema/retriever.cjs");
|
|
6
6
|
const document_js_1 = require("../document.cjs");
|
|
7
7
|
class ZepRetriever extends retriever_js_1.BaseRetriever {
|
|
8
|
+
static lc_name() {
|
|
9
|
+
return "ZepRetriever";
|
|
10
|
+
}
|
|
8
11
|
get lc_secrets() {
|
|
9
12
|
return {
|
|
10
13
|
apiKey: "ZEP_API_KEY",
|
package/dist/retrievers/zep.d.ts
CHANGED
package/dist/retrievers/zep.js
CHANGED
|
@@ -2,6 +2,9 @@ import { NotFoundError, ZepClient, } from "@getzep/zep-js";
|
|
|
2
2
|
import { BaseRetriever } from "../schema/retriever.js";
|
|
3
3
|
import { Document } from "../document.js";
|
|
4
4
|
export class ZepRetriever extends BaseRetriever {
|
|
5
|
+
static lc_name() {
|
|
6
|
+
return "ZepRetriever";
|
|
7
|
+
}
|
|
5
8
|
get lc_secrets() {
|
|
6
9
|
return {
|
|
7
10
|
apiKey: "ZEP_API_KEY",
|
package/dist/schema/index.cjs
CHANGED
|
@@ -128,12 +128,18 @@ class BaseMessageChunk extends BaseMessage {
|
|
|
128
128
|
}
|
|
129
129
|
exports.BaseMessageChunk = BaseMessageChunk;
|
|
130
130
|
class HumanMessage extends BaseMessage {
|
|
131
|
+
static lc_name() {
|
|
132
|
+
return "HumanMessage";
|
|
133
|
+
}
|
|
131
134
|
_getType() {
|
|
132
135
|
return "human";
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
138
|
exports.HumanMessage = HumanMessage;
|
|
136
139
|
class HumanMessageChunk extends BaseMessageChunk {
|
|
140
|
+
static lc_name() {
|
|
141
|
+
return "HumanMessageChunk";
|
|
142
|
+
}
|
|
137
143
|
_getType() {
|
|
138
144
|
return "human";
|
|
139
145
|
}
|
|
@@ -146,12 +152,18 @@ class HumanMessageChunk extends BaseMessageChunk {
|
|
|
146
152
|
}
|
|
147
153
|
exports.HumanMessageChunk = HumanMessageChunk;
|
|
148
154
|
class AIMessage extends BaseMessage {
|
|
155
|
+
static lc_name() {
|
|
156
|
+
return "AIMessage";
|
|
157
|
+
}
|
|
149
158
|
_getType() {
|
|
150
159
|
return "ai";
|
|
151
160
|
}
|
|
152
161
|
}
|
|
153
162
|
exports.AIMessage = AIMessage;
|
|
154
163
|
class AIMessageChunk extends BaseMessageChunk {
|
|
164
|
+
static lc_name() {
|
|
165
|
+
return "AIMessageChunk";
|
|
166
|
+
}
|
|
155
167
|
_getType() {
|
|
156
168
|
return "ai";
|
|
157
169
|
}
|
|
@@ -164,12 +176,18 @@ class AIMessageChunk extends BaseMessageChunk {
|
|
|
164
176
|
}
|
|
165
177
|
exports.AIMessageChunk = AIMessageChunk;
|
|
166
178
|
class SystemMessage extends BaseMessage {
|
|
179
|
+
static lc_name() {
|
|
180
|
+
return "SystemMessage";
|
|
181
|
+
}
|
|
167
182
|
_getType() {
|
|
168
183
|
return "system";
|
|
169
184
|
}
|
|
170
185
|
}
|
|
171
186
|
exports.SystemMessage = SystemMessage;
|
|
172
187
|
class SystemMessageChunk extends BaseMessageChunk {
|
|
188
|
+
static lc_name() {
|
|
189
|
+
return "SystemMessageChunk";
|
|
190
|
+
}
|
|
173
191
|
_getType() {
|
|
174
192
|
return "system";
|
|
175
193
|
}
|
|
@@ -202,12 +220,15 @@ exports.AIChatMessage = AIMessage;
|
|
|
202
220
|
*/
|
|
203
221
|
exports.SystemChatMessage = SystemMessage;
|
|
204
222
|
class FunctionMessage extends BaseMessage {
|
|
223
|
+
static lc_name() {
|
|
224
|
+
return "FunctionMessage";
|
|
225
|
+
}
|
|
205
226
|
constructor(fields,
|
|
206
227
|
/** @deprecated */
|
|
207
228
|
name) {
|
|
208
229
|
if (typeof fields === "string") {
|
|
209
|
-
// eslint-disable-next-line no-param-reassign
|
|
210
|
-
fields = { content: fields, name };
|
|
230
|
+
// eslint-disable-next-line no-param-reassign, @typescript-eslint/no-non-null-assertion
|
|
231
|
+
fields = { content: fields, name: name };
|
|
211
232
|
}
|
|
212
233
|
super(fields);
|
|
213
234
|
}
|
|
@@ -217,6 +238,9 @@ class FunctionMessage extends BaseMessage {
|
|
|
217
238
|
}
|
|
218
239
|
exports.FunctionMessage = FunctionMessage;
|
|
219
240
|
class FunctionMessageChunk extends BaseMessageChunk {
|
|
241
|
+
static lc_name() {
|
|
242
|
+
return "FunctionMessageChunk";
|
|
243
|
+
}
|
|
220
244
|
_getType() {
|
|
221
245
|
return "function";
|
|
222
246
|
}
|
|
@@ -230,6 +254,9 @@ class FunctionMessageChunk extends BaseMessageChunk {
|
|
|
230
254
|
}
|
|
231
255
|
exports.FunctionMessageChunk = FunctionMessageChunk;
|
|
232
256
|
class ChatMessage extends BaseMessage {
|
|
257
|
+
static lc_name() {
|
|
258
|
+
return "ChatMessage";
|
|
259
|
+
}
|
|
233
260
|
constructor(fields, role) {
|
|
234
261
|
if (typeof fields === "string") {
|
|
235
262
|
// eslint-disable-next-line no-param-reassign, @typescript-eslint/no-non-null-assertion
|
|
@@ -253,6 +280,9 @@ class ChatMessage extends BaseMessage {
|
|
|
253
280
|
}
|
|
254
281
|
exports.ChatMessage = ChatMessage;
|
|
255
282
|
class ChatMessageChunk extends BaseMessageChunk {
|
|
283
|
+
static lc_name() {
|
|
284
|
+
return "ChatMessageChunk";
|
|
285
|
+
}
|
|
256
286
|
constructor(fields, role) {
|
|
257
287
|
if (typeof fields === "string") {
|
|
258
288
|
// eslint-disable-next-line no-param-reassign, @typescript-eslint/no-non-null-assertion
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -71,6 +71,9 @@ export interface BaseMessageFields {
|
|
|
71
71
|
export interface ChatMessageFieldsWithRole extends BaseMessageFields {
|
|
72
72
|
role: string;
|
|
73
73
|
}
|
|
74
|
+
export interface FunctionMessageFieldsWithName extends BaseMessageFields {
|
|
75
|
+
name: string;
|
|
76
|
+
}
|
|
74
77
|
export declare abstract class BaseMessage extends Serializable implements BaseMessageFields {
|
|
75
78
|
lc_namespace: string[];
|
|
76
79
|
lc_serializable: boolean;
|
|
@@ -97,23 +100,29 @@ export declare abstract class BaseMessageChunk extends BaseMessage {
|
|
|
97
100
|
static _mergeAdditionalKwargs(left: NonNullable<BaseMessageFields["additional_kwargs"]>, right: NonNullable<BaseMessageFields["additional_kwargs"]>): NonNullable<BaseMessageFields["additional_kwargs"]>;
|
|
98
101
|
}
|
|
99
102
|
export declare class HumanMessage extends BaseMessage {
|
|
103
|
+
static lc_name(): string;
|
|
100
104
|
_getType(): MessageType;
|
|
101
105
|
}
|
|
102
106
|
export declare class HumanMessageChunk extends BaseMessageChunk {
|
|
107
|
+
static lc_name(): string;
|
|
103
108
|
_getType(): MessageType;
|
|
104
109
|
concat(chunk: HumanMessageChunk): HumanMessageChunk;
|
|
105
110
|
}
|
|
106
111
|
export declare class AIMessage extends BaseMessage {
|
|
112
|
+
static lc_name(): string;
|
|
107
113
|
_getType(): MessageType;
|
|
108
114
|
}
|
|
109
115
|
export declare class AIMessageChunk extends BaseMessageChunk {
|
|
116
|
+
static lc_name(): string;
|
|
110
117
|
_getType(): MessageType;
|
|
111
118
|
concat(chunk: AIMessageChunk): AIMessageChunk;
|
|
112
119
|
}
|
|
113
120
|
export declare class SystemMessage extends BaseMessage {
|
|
121
|
+
static lc_name(): string;
|
|
114
122
|
_getType(): MessageType;
|
|
115
123
|
}
|
|
116
124
|
export declare class SystemMessageChunk extends BaseMessageChunk {
|
|
125
|
+
static lc_name(): string;
|
|
117
126
|
_getType(): MessageType;
|
|
118
127
|
concat(chunk: SystemMessageChunk): SystemMessageChunk;
|
|
119
128
|
}
|
|
@@ -138,16 +147,20 @@ export declare const AIChatMessage: typeof AIMessage;
|
|
|
138
147
|
*/
|
|
139
148
|
export declare const SystemChatMessage: typeof SystemMessage;
|
|
140
149
|
export declare class FunctionMessage extends BaseMessage {
|
|
150
|
+
static lc_name(): string;
|
|
151
|
+
constructor(fields: FunctionMessageFieldsWithName);
|
|
141
152
|
constructor(fields: string | BaseMessageFields,
|
|
142
153
|
/** @deprecated */
|
|
143
154
|
name: string);
|
|
144
155
|
_getType(): MessageType;
|
|
145
156
|
}
|
|
146
157
|
export declare class FunctionMessageChunk extends BaseMessageChunk {
|
|
158
|
+
static lc_name(): string;
|
|
147
159
|
_getType(): MessageType;
|
|
148
160
|
concat(chunk: FunctionMessageChunk): FunctionMessageChunk;
|
|
149
161
|
}
|
|
150
162
|
export declare class ChatMessage extends BaseMessage implements ChatMessageFieldsWithRole {
|
|
163
|
+
static lc_name(): string;
|
|
151
164
|
role: string;
|
|
152
165
|
constructor(content: string, role: string);
|
|
153
166
|
constructor(fields: ChatMessageFieldsWithRole);
|
|
@@ -155,6 +168,7 @@ export declare class ChatMessage extends BaseMessage implements ChatMessageField
|
|
|
155
168
|
static isInstance(message: BaseMessage): message is ChatMessage;
|
|
156
169
|
}
|
|
157
170
|
export declare class ChatMessageChunk extends BaseMessageChunk {
|
|
171
|
+
static lc_name(): string;
|
|
158
172
|
role: string;
|
|
159
173
|
constructor(content: string, role: string);
|
|
160
174
|
constructor(fields: ChatMessageFieldsWithRole);
|