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
package/dist/schema/index.js
CHANGED
|
@@ -122,11 +122,17 @@ export class BaseMessageChunk extends BaseMessage {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
export class HumanMessage extends BaseMessage {
|
|
125
|
+
static lc_name() {
|
|
126
|
+
return "HumanMessage";
|
|
127
|
+
}
|
|
125
128
|
_getType() {
|
|
126
129
|
return "human";
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
132
|
export class HumanMessageChunk extends BaseMessageChunk {
|
|
133
|
+
static lc_name() {
|
|
134
|
+
return "HumanMessageChunk";
|
|
135
|
+
}
|
|
130
136
|
_getType() {
|
|
131
137
|
return "human";
|
|
132
138
|
}
|
|
@@ -138,11 +144,17 @@ export class HumanMessageChunk extends BaseMessageChunk {
|
|
|
138
144
|
}
|
|
139
145
|
}
|
|
140
146
|
export class AIMessage extends BaseMessage {
|
|
147
|
+
static lc_name() {
|
|
148
|
+
return "AIMessage";
|
|
149
|
+
}
|
|
141
150
|
_getType() {
|
|
142
151
|
return "ai";
|
|
143
152
|
}
|
|
144
153
|
}
|
|
145
154
|
export class AIMessageChunk extends BaseMessageChunk {
|
|
155
|
+
static lc_name() {
|
|
156
|
+
return "AIMessageChunk";
|
|
157
|
+
}
|
|
146
158
|
_getType() {
|
|
147
159
|
return "ai";
|
|
148
160
|
}
|
|
@@ -154,11 +166,17 @@ export class AIMessageChunk extends BaseMessageChunk {
|
|
|
154
166
|
}
|
|
155
167
|
}
|
|
156
168
|
export class SystemMessage extends BaseMessage {
|
|
169
|
+
static lc_name() {
|
|
170
|
+
return "SystemMessage";
|
|
171
|
+
}
|
|
157
172
|
_getType() {
|
|
158
173
|
return "system";
|
|
159
174
|
}
|
|
160
175
|
}
|
|
161
176
|
export class SystemMessageChunk extends BaseMessageChunk {
|
|
177
|
+
static lc_name() {
|
|
178
|
+
return "SystemMessageChunk";
|
|
179
|
+
}
|
|
162
180
|
_getType() {
|
|
163
181
|
return "system";
|
|
164
182
|
}
|
|
@@ -190,12 +208,15 @@ export const AIChatMessage = AIMessage;
|
|
|
190
208
|
*/
|
|
191
209
|
export const SystemChatMessage = SystemMessage;
|
|
192
210
|
export class FunctionMessage extends BaseMessage {
|
|
211
|
+
static lc_name() {
|
|
212
|
+
return "FunctionMessage";
|
|
213
|
+
}
|
|
193
214
|
constructor(fields,
|
|
194
215
|
/** @deprecated */
|
|
195
216
|
name) {
|
|
196
217
|
if (typeof fields === "string") {
|
|
197
|
-
// eslint-disable-next-line no-param-reassign
|
|
198
|
-
fields = { content: fields, name };
|
|
218
|
+
// eslint-disable-next-line no-param-reassign, @typescript-eslint/no-non-null-assertion
|
|
219
|
+
fields = { content: fields, name: name };
|
|
199
220
|
}
|
|
200
221
|
super(fields);
|
|
201
222
|
}
|
|
@@ -204,6 +225,9 @@ export class FunctionMessage extends BaseMessage {
|
|
|
204
225
|
}
|
|
205
226
|
}
|
|
206
227
|
export class FunctionMessageChunk extends BaseMessageChunk {
|
|
228
|
+
static lc_name() {
|
|
229
|
+
return "FunctionMessageChunk";
|
|
230
|
+
}
|
|
207
231
|
_getType() {
|
|
208
232
|
return "function";
|
|
209
233
|
}
|
|
@@ -216,6 +240,9 @@ export class FunctionMessageChunk extends BaseMessageChunk {
|
|
|
216
240
|
}
|
|
217
241
|
}
|
|
218
242
|
export class ChatMessage extends BaseMessage {
|
|
243
|
+
static lc_name() {
|
|
244
|
+
return "ChatMessage";
|
|
245
|
+
}
|
|
219
246
|
constructor(fields, role) {
|
|
220
247
|
if (typeof fields === "string") {
|
|
221
248
|
// eslint-disable-next-line no-param-reassign, @typescript-eslint/no-non-null-assertion
|
|
@@ -238,6 +265,9 @@ export class ChatMessage extends BaseMessage {
|
|
|
238
265
|
}
|
|
239
266
|
}
|
|
240
267
|
export class ChatMessageChunk extends BaseMessageChunk {
|
|
268
|
+
static lc_name() {
|
|
269
|
+
return "ChatMessageChunk";
|
|
270
|
+
}
|
|
241
271
|
constructor(fields, role) {
|
|
242
272
|
if (typeof fields === "string") {
|
|
243
273
|
// eslint-disable-next-line no-param-reassign, @typescript-eslint/no-non-null-assertion
|
|
@@ -75,6 +75,9 @@ class StringOutputParser extends BaseTransformOutputParser {
|
|
|
75
75
|
value: true
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
static lc_name() {
|
|
79
|
+
return "StrOutputParser";
|
|
80
|
+
}
|
|
78
81
|
parse(text) {
|
|
79
82
|
return Promise.resolve(text);
|
|
80
83
|
}
|
|
@@ -109,6 +112,9 @@ class BytesOutputParser extends BaseTransformOutputParser {
|
|
|
109
112
|
value: new TextEncoder()
|
|
110
113
|
});
|
|
111
114
|
}
|
|
115
|
+
static lc_name() {
|
|
116
|
+
return "BytesOutputParser";
|
|
117
|
+
}
|
|
112
118
|
parse(text) {
|
|
113
119
|
return Promise.resolve(this.textEncoder.encode(text));
|
|
114
120
|
}
|
|
@@ -52,6 +52,7 @@ export declare abstract class BaseTransformOutputParser<T = unknown> extends Bas
|
|
|
52
52
|
* OutputParser that parses LLMResult into the top likely string.
|
|
53
53
|
*/
|
|
54
54
|
export declare class StringOutputParser extends BaseTransformOutputParser<string> {
|
|
55
|
+
static lc_name(): string;
|
|
55
56
|
lc_namespace: string[];
|
|
56
57
|
lc_serializable: boolean;
|
|
57
58
|
parse(text: string): Promise<string>;
|
|
@@ -62,6 +63,7 @@ export declare class StringOutputParser extends BaseTransformOutputParser<string
|
|
|
62
63
|
* encodes it into bytes.
|
|
63
64
|
*/
|
|
64
65
|
export declare class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {
|
|
66
|
+
static lc_name(): string;
|
|
65
67
|
lc_namespace: string[];
|
|
66
68
|
lc_serializable: boolean;
|
|
67
69
|
protected textEncoder: TextEncoder;
|
|
@@ -69,6 +69,9 @@ export class StringOutputParser extends BaseTransformOutputParser {
|
|
|
69
69
|
value: true
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
+
static lc_name() {
|
|
73
|
+
return "StrOutputParser";
|
|
74
|
+
}
|
|
72
75
|
parse(text) {
|
|
73
76
|
return Promise.resolve(text);
|
|
74
77
|
}
|
|
@@ -102,6 +105,9 @@ export class BytesOutputParser extends BaseTransformOutputParser {
|
|
|
102
105
|
value: new TextEncoder()
|
|
103
106
|
});
|
|
104
107
|
}
|
|
108
|
+
static lc_name() {
|
|
109
|
+
return "BytesOutputParser";
|
|
110
|
+
}
|
|
105
111
|
parse(text) {
|
|
106
112
|
return Promise.resolve(this.textEncoder.encode(text));
|
|
107
113
|
}
|
package/dist/schema/runnable.cjs
CHANGED
|
@@ -180,6 +180,9 @@ exports.Runnable = Runnable;
|
|
|
180
180
|
* A sequence of runnables, where the output of each is the input of the next.
|
|
181
181
|
*/
|
|
182
182
|
class RunnableSequence extends Runnable {
|
|
183
|
+
static lc_name() {
|
|
184
|
+
return "RunnableSequence";
|
|
185
|
+
}
|
|
183
186
|
constructor(fields) {
|
|
184
187
|
super(fields);
|
|
185
188
|
Object.defineProperty(this, "first", {
|
|
@@ -211,7 +214,7 @@ class RunnableSequence extends Runnable {
|
|
|
211
214
|
enumerable: true,
|
|
212
215
|
configurable: true,
|
|
213
216
|
writable: true,
|
|
214
|
-
value: ["schema", "runnable"]
|
|
217
|
+
value: ["langchain", "schema", "runnable"]
|
|
215
218
|
});
|
|
216
219
|
this.first = fields.first;
|
|
217
220
|
this.middle = fields.middle ?? this.middle;
|
|
@@ -352,13 +355,16 @@ exports.RunnableSequence = RunnableSequence;
|
|
|
352
355
|
* and returns a mapping of their outputs.
|
|
353
356
|
*/
|
|
354
357
|
class RunnableMap extends Runnable {
|
|
358
|
+
static lc_name() {
|
|
359
|
+
return "RunnableMap";
|
|
360
|
+
}
|
|
355
361
|
constructor(fields) {
|
|
356
362
|
super(fields);
|
|
357
363
|
Object.defineProperty(this, "lc_namespace", {
|
|
358
364
|
enumerable: true,
|
|
359
365
|
configurable: true,
|
|
360
366
|
writable: true,
|
|
361
|
-
value: ["schema", "runnable"]
|
|
367
|
+
value: ["langchain", "schema", "runnable"]
|
|
362
368
|
});
|
|
363
369
|
Object.defineProperty(this, "lc_serializable", {
|
|
364
370
|
enumerable: true,
|
|
@@ -411,7 +417,7 @@ class RunnableLambda extends Runnable {
|
|
|
411
417
|
enumerable: true,
|
|
412
418
|
configurable: true,
|
|
413
419
|
writable: true,
|
|
414
|
-
value: ["schema", "runnable"]
|
|
420
|
+
value: ["langchain", "schema", "runnable"]
|
|
415
421
|
});
|
|
416
422
|
Object.defineProperty(this, "func", {
|
|
417
423
|
enumerable: true,
|
|
@@ -436,7 +442,7 @@ class RunnablePassthrough extends Runnable {
|
|
|
436
442
|
enumerable: true,
|
|
437
443
|
configurable: true,
|
|
438
444
|
writable: true,
|
|
439
|
-
value: ["schema", "runnable"]
|
|
445
|
+
value: ["langchain", "schema", "runnable"]
|
|
440
446
|
});
|
|
441
447
|
Object.defineProperty(this, "lc_serializable", {
|
|
442
448
|
enumerable: true,
|
|
@@ -445,6 +451,9 @@ class RunnablePassthrough extends Runnable {
|
|
|
445
451
|
value: true
|
|
446
452
|
});
|
|
447
453
|
}
|
|
454
|
+
static lc_name() {
|
|
455
|
+
return "RunnablePassthrough";
|
|
456
|
+
}
|
|
448
457
|
async invoke(input, options) {
|
|
449
458
|
return this._callWithConfig((input) => Promise.resolve(input), input, options);
|
|
450
459
|
}
|
|
@@ -454,13 +463,16 @@ exports.RunnablePassthrough = RunnablePassthrough;
|
|
|
454
463
|
* A runnable that delegates calls to another runnable with a set of kwargs.
|
|
455
464
|
*/
|
|
456
465
|
class RunnableBinding extends Runnable {
|
|
466
|
+
static lc_name() {
|
|
467
|
+
return "RunnableBinding";
|
|
468
|
+
}
|
|
457
469
|
constructor(fields) {
|
|
458
470
|
super(fields);
|
|
459
471
|
Object.defineProperty(this, "lc_namespace", {
|
|
460
472
|
enumerable: true,
|
|
461
473
|
configurable: true,
|
|
462
474
|
writable: true,
|
|
463
|
-
value: ["schema", "runnable"]
|
|
475
|
+
value: ["langchain", "schema", "runnable"]
|
|
464
476
|
});
|
|
465
477
|
Object.defineProperty(this, "lc_serializable", {
|
|
466
478
|
enumerable: true,
|
|
@@ -511,13 +523,16 @@ exports.RunnableBinding = RunnableBinding;
|
|
|
511
523
|
* Returns the output of the selected runnable.
|
|
512
524
|
*/
|
|
513
525
|
class RouterRunnable extends Runnable {
|
|
526
|
+
static lc_name() {
|
|
527
|
+
return "RouterRunnable";
|
|
528
|
+
}
|
|
514
529
|
constructor(fields) {
|
|
515
530
|
super(fields);
|
|
516
531
|
Object.defineProperty(this, "lc_namespace", {
|
|
517
532
|
enumerable: true,
|
|
518
533
|
configurable: true,
|
|
519
534
|
writable: true,
|
|
520
|
-
value: ["schema", "
|
|
535
|
+
value: ["langchain", "schema", "runnable"]
|
|
521
536
|
});
|
|
522
537
|
Object.defineProperty(this, "lc_serializable", {
|
|
523
538
|
enumerable: true,
|
|
@@ -577,13 +592,16 @@ exports.RouterRunnable = RouterRunnable;
|
|
|
577
592
|
* A Runnable that can fallback to other Runnables if it fails.
|
|
578
593
|
*/
|
|
579
594
|
class RunnableWithFallbacks extends Runnable {
|
|
595
|
+
static lc_name() {
|
|
596
|
+
return "RunnableWithFallbacks";
|
|
597
|
+
}
|
|
580
598
|
constructor(fields) {
|
|
581
599
|
super(fields);
|
|
582
600
|
Object.defineProperty(this, "lc_namespace", {
|
|
583
601
|
enumerable: true,
|
|
584
602
|
configurable: true,
|
|
585
603
|
writable: true,
|
|
586
|
-
value: ["schema", "
|
|
604
|
+
value: ["langchain", "schema", "runnable"]
|
|
587
605
|
});
|
|
588
606
|
Object.defineProperty(this, "lc_serializable", {
|
|
589
607
|
enumerable: true,
|
|
@@ -83,6 +83,7 @@ export declare abstract class Runnable<RunInput = any, RunOutput = any, CallOpti
|
|
|
83
83
|
* A sequence of runnables, where the output of each is the input of the next.
|
|
84
84
|
*/
|
|
85
85
|
export declare class RunnableSequence<RunInput = any, RunOutput = any> extends Runnable<RunInput, RunOutput> {
|
|
86
|
+
static lc_name(): string;
|
|
86
87
|
protected first: Runnable<RunInput>;
|
|
87
88
|
protected middle: Runnable[];
|
|
88
89
|
protected last: Runnable<any, RunOutput>;
|
|
@@ -112,6 +113,7 @@ export declare class RunnableSequence<RunInput = any, RunOutput = any> extends R
|
|
|
112
113
|
* and returns a mapping of their outputs.
|
|
113
114
|
*/
|
|
114
115
|
export declare class RunnableMap<RunInput> extends Runnable<RunInput, Record<string, any>> {
|
|
116
|
+
static lc_name(): string;
|
|
115
117
|
lc_namespace: string[];
|
|
116
118
|
lc_serializable: boolean;
|
|
117
119
|
protected steps: Record<string, Runnable<RunInput>>;
|
|
@@ -135,6 +137,7 @@ export declare class RunnableLambda<RunInput, RunOutput> extends Runnable<RunInp
|
|
|
135
137
|
* A runnable that passes through the input.
|
|
136
138
|
*/
|
|
137
139
|
export declare class RunnablePassthrough<RunInput> extends Runnable<RunInput, RunInput> {
|
|
140
|
+
static lc_name(): string;
|
|
138
141
|
lc_namespace: string[];
|
|
139
142
|
lc_serializable: boolean;
|
|
140
143
|
invoke(input: RunInput, options?: Partial<BaseCallbackConfig>): Promise<RunInput>;
|
|
@@ -143,6 +146,7 @@ export declare class RunnablePassthrough<RunInput> extends Runnable<RunInput, Ru
|
|
|
143
146
|
* A runnable that delegates calls to another runnable with a set of kwargs.
|
|
144
147
|
*/
|
|
145
148
|
export declare class RunnableBinding<RunInput, RunOutput, CallOptions extends BaseCallbackConfig> extends Runnable<RunInput, RunOutput, CallOptions> {
|
|
149
|
+
static lc_name(): string;
|
|
146
150
|
lc_namespace: string[];
|
|
147
151
|
lc_serializable: boolean;
|
|
148
152
|
protected bound: Runnable<RunInput, RunOutput, CallOptions>;
|
|
@@ -167,6 +171,7 @@ export type RouterInput = {
|
|
|
167
171
|
* Returns the output of the selected runnable.
|
|
168
172
|
*/
|
|
169
173
|
export declare class RouterRunnable<RunInput extends RouterInput, RunnableInput, RunOutput> extends Runnable<RunInput, RunOutput> {
|
|
174
|
+
static lc_name(): string;
|
|
170
175
|
lc_namespace: string[];
|
|
171
176
|
lc_serializable: boolean;
|
|
172
177
|
runnables: Record<string, Runnable<RunnableInput, RunOutput>>;
|
|
@@ -183,6 +188,7 @@ export declare class RouterRunnable<RunInput extends RouterInput, RunnableInput,
|
|
|
183
188
|
* A Runnable that can fallback to other Runnables if it fails.
|
|
184
189
|
*/
|
|
185
190
|
export declare class RunnableWithFallbacks<RunInput, RunOutput> extends Runnable<RunInput, RunOutput> {
|
|
191
|
+
static lc_name(): string;
|
|
186
192
|
lc_namespace: string[];
|
|
187
193
|
lc_serializable: boolean;
|
|
188
194
|
protected runnable: Runnable<RunInput, RunOutput>;
|
package/dist/schema/runnable.js
CHANGED
|
@@ -176,6 +176,9 @@ export class Runnable extends Serializable {
|
|
|
176
176
|
* A sequence of runnables, where the output of each is the input of the next.
|
|
177
177
|
*/
|
|
178
178
|
export class RunnableSequence extends Runnable {
|
|
179
|
+
static lc_name() {
|
|
180
|
+
return "RunnableSequence";
|
|
181
|
+
}
|
|
179
182
|
constructor(fields) {
|
|
180
183
|
super(fields);
|
|
181
184
|
Object.defineProperty(this, "first", {
|
|
@@ -207,7 +210,7 @@ export class RunnableSequence extends Runnable {
|
|
|
207
210
|
enumerable: true,
|
|
208
211
|
configurable: true,
|
|
209
212
|
writable: true,
|
|
210
|
-
value: ["schema", "runnable"]
|
|
213
|
+
value: ["langchain", "schema", "runnable"]
|
|
211
214
|
});
|
|
212
215
|
this.first = fields.first;
|
|
213
216
|
this.middle = fields.middle ?? this.middle;
|
|
@@ -347,13 +350,16 @@ export class RunnableSequence extends Runnable {
|
|
|
347
350
|
* and returns a mapping of their outputs.
|
|
348
351
|
*/
|
|
349
352
|
export class RunnableMap extends Runnable {
|
|
353
|
+
static lc_name() {
|
|
354
|
+
return "RunnableMap";
|
|
355
|
+
}
|
|
350
356
|
constructor(fields) {
|
|
351
357
|
super(fields);
|
|
352
358
|
Object.defineProperty(this, "lc_namespace", {
|
|
353
359
|
enumerable: true,
|
|
354
360
|
configurable: true,
|
|
355
361
|
writable: true,
|
|
356
|
-
value: ["schema", "runnable"]
|
|
362
|
+
value: ["langchain", "schema", "runnable"]
|
|
357
363
|
});
|
|
358
364
|
Object.defineProperty(this, "lc_serializable", {
|
|
359
365
|
enumerable: true,
|
|
@@ -405,7 +411,7 @@ export class RunnableLambda extends Runnable {
|
|
|
405
411
|
enumerable: true,
|
|
406
412
|
configurable: true,
|
|
407
413
|
writable: true,
|
|
408
|
-
value: ["schema", "runnable"]
|
|
414
|
+
value: ["langchain", "schema", "runnable"]
|
|
409
415
|
});
|
|
410
416
|
Object.defineProperty(this, "func", {
|
|
411
417
|
enumerable: true,
|
|
@@ -429,7 +435,7 @@ export class RunnablePassthrough extends Runnable {
|
|
|
429
435
|
enumerable: true,
|
|
430
436
|
configurable: true,
|
|
431
437
|
writable: true,
|
|
432
|
-
value: ["schema", "runnable"]
|
|
438
|
+
value: ["langchain", "schema", "runnable"]
|
|
433
439
|
});
|
|
434
440
|
Object.defineProperty(this, "lc_serializable", {
|
|
435
441
|
enumerable: true,
|
|
@@ -438,6 +444,9 @@ export class RunnablePassthrough extends Runnable {
|
|
|
438
444
|
value: true
|
|
439
445
|
});
|
|
440
446
|
}
|
|
447
|
+
static lc_name() {
|
|
448
|
+
return "RunnablePassthrough";
|
|
449
|
+
}
|
|
441
450
|
async invoke(input, options) {
|
|
442
451
|
return this._callWithConfig((input) => Promise.resolve(input), input, options);
|
|
443
452
|
}
|
|
@@ -446,13 +455,16 @@ export class RunnablePassthrough extends Runnable {
|
|
|
446
455
|
* A runnable that delegates calls to another runnable with a set of kwargs.
|
|
447
456
|
*/
|
|
448
457
|
export class RunnableBinding extends Runnable {
|
|
458
|
+
static lc_name() {
|
|
459
|
+
return "RunnableBinding";
|
|
460
|
+
}
|
|
449
461
|
constructor(fields) {
|
|
450
462
|
super(fields);
|
|
451
463
|
Object.defineProperty(this, "lc_namespace", {
|
|
452
464
|
enumerable: true,
|
|
453
465
|
configurable: true,
|
|
454
466
|
writable: true,
|
|
455
|
-
value: ["schema", "runnable"]
|
|
467
|
+
value: ["langchain", "schema", "runnable"]
|
|
456
468
|
});
|
|
457
469
|
Object.defineProperty(this, "lc_serializable", {
|
|
458
470
|
enumerable: true,
|
|
@@ -502,13 +514,16 @@ export class RunnableBinding extends Runnable {
|
|
|
502
514
|
* Returns the output of the selected runnable.
|
|
503
515
|
*/
|
|
504
516
|
export class RouterRunnable extends Runnable {
|
|
517
|
+
static lc_name() {
|
|
518
|
+
return "RouterRunnable";
|
|
519
|
+
}
|
|
505
520
|
constructor(fields) {
|
|
506
521
|
super(fields);
|
|
507
522
|
Object.defineProperty(this, "lc_namespace", {
|
|
508
523
|
enumerable: true,
|
|
509
524
|
configurable: true,
|
|
510
525
|
writable: true,
|
|
511
|
-
value: ["schema", "
|
|
526
|
+
value: ["langchain", "schema", "runnable"]
|
|
512
527
|
});
|
|
513
528
|
Object.defineProperty(this, "lc_serializable", {
|
|
514
529
|
enumerable: true,
|
|
@@ -567,13 +582,16 @@ export class RouterRunnable extends Runnable {
|
|
|
567
582
|
* A Runnable that can fallback to other Runnables if it fails.
|
|
568
583
|
*/
|
|
569
584
|
export class RunnableWithFallbacks extends Runnable {
|
|
585
|
+
static lc_name() {
|
|
586
|
+
return "RunnableWithFallbacks";
|
|
587
|
+
}
|
|
570
588
|
constructor(fields) {
|
|
571
589
|
super(fields);
|
|
572
590
|
Object.defineProperty(this, "lc_namespace", {
|
|
573
591
|
enumerable: true,
|
|
574
592
|
configurable: true,
|
|
575
593
|
writable: true,
|
|
576
|
-
value: ["schema", "
|
|
594
|
+
value: ["langchain", "schema", "runnable"]
|
|
577
595
|
});
|
|
578
596
|
Object.defineProperty(this, "lc_serializable", {
|
|
579
597
|
enumerable: true,
|
|
@@ -30,6 +30,11 @@ function mapStoredMessagesToChatMessages(messages) {
|
|
|
30
30
|
return new index_js_1.AIMessage(storedMessage.data);
|
|
31
31
|
case "system":
|
|
32
32
|
return new index_js_1.SystemMessage(storedMessage.data);
|
|
33
|
+
case "function":
|
|
34
|
+
if (storedMessage.data.name === undefined) {
|
|
35
|
+
throw new Error("Name must be defined for function messages");
|
|
36
|
+
}
|
|
37
|
+
return new index_js_1.FunctionMessage(storedMessage.data);
|
|
33
38
|
case "chat": {
|
|
34
39
|
if (storedMessage.data.role === undefined) {
|
|
35
40
|
throw new Error("Role must be defined for chat messages");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AIMessage, ChatMessage, HumanMessage, SystemMessage, } from "../../schema/index.js";
|
|
1
|
+
import { AIMessage, ChatMessage, FunctionMessage, HumanMessage, SystemMessage, } from "../../schema/index.js";
|
|
2
2
|
export function mapV1MessageToStoredMessage(message) {
|
|
3
3
|
// TODO: Remove this mapper when we deprecate the old message format.
|
|
4
4
|
if (message.data !== undefined) {
|
|
@@ -26,6 +26,11 @@ export function mapStoredMessagesToChatMessages(messages) {
|
|
|
26
26
|
return new AIMessage(storedMessage.data);
|
|
27
27
|
case "system":
|
|
28
28
|
return new SystemMessage(storedMessage.data);
|
|
29
|
+
case "function":
|
|
30
|
+
if (storedMessage.data.name === undefined) {
|
|
31
|
+
throw new Error("Name must be defined for function messages");
|
|
32
|
+
}
|
|
33
|
+
return new FunctionMessage(storedMessage.data);
|
|
29
34
|
case "chat": {
|
|
30
35
|
if (storedMessage.data.role === undefined) {
|
|
31
36
|
throw new Error("Role must be defined for chat messages");
|
package/dist/text_splitter.cjs
CHANGED
|
@@ -162,6 +162,9 @@ which is longer than the specified ${this.chunkSize}`);
|
|
|
162
162
|
}
|
|
163
163
|
exports.TextSplitter = TextSplitter;
|
|
164
164
|
class CharacterTextSplitter extends TextSplitter {
|
|
165
|
+
static lc_name() {
|
|
166
|
+
return "CharacterTextSplitter";
|
|
167
|
+
}
|
|
165
168
|
constructor(fields) {
|
|
166
169
|
super(fields);
|
|
167
170
|
Object.defineProperty(this, "separator", {
|
|
@@ -198,6 +201,9 @@ exports.SupportedTextSplitterLanguages = [
|
|
|
198
201
|
"sol",
|
|
199
202
|
];
|
|
200
203
|
class RecursiveCharacterTextSplitter extends TextSplitter {
|
|
204
|
+
static lc_name() {
|
|
205
|
+
return "RecursiveCharacterTextSplitter";
|
|
206
|
+
}
|
|
201
207
|
constructor(fields) {
|
|
202
208
|
super(fields);
|
|
203
209
|
Object.defineProperty(this, "separators", {
|
|
@@ -632,6 +638,9 @@ exports.RecursiveCharacterTextSplitter = RecursiveCharacterTextSplitter;
|
|
|
632
638
|
* Implementation of splitter which looks at tokens.
|
|
633
639
|
*/
|
|
634
640
|
class TokenTextSplitter extends TextSplitter {
|
|
641
|
+
static lc_name() {
|
|
642
|
+
return "TokenTextSplitter";
|
|
643
|
+
}
|
|
635
644
|
constructor(fields) {
|
|
636
645
|
super(fields);
|
|
637
646
|
Object.defineProperty(this, "encodingName", {
|
package/dist/text_splitter.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export interface CharacterTextSplitterParams extends TextSplitterParams {
|
|
|
31
31
|
separator: string;
|
|
32
32
|
}
|
|
33
33
|
export declare class CharacterTextSplitter extends TextSplitter implements CharacterTextSplitterParams {
|
|
34
|
+
static lc_name(): string;
|
|
34
35
|
separator: string;
|
|
35
36
|
constructor(fields?: Partial<CharacterTextSplitterParams>);
|
|
36
37
|
splitText(text: string): Promise<string[]>;
|
|
@@ -41,6 +42,7 @@ export interface RecursiveCharacterTextSplitterParams extends TextSplitterParams
|
|
|
41
42
|
export declare const SupportedTextSplitterLanguages: readonly ["cpp", "go", "java", "js", "php", "proto", "python", "rst", "ruby", "rust", "scala", "swift", "markdown", "latex", "html", "sol"];
|
|
42
43
|
export type SupportedTextSplitterLanguage = (typeof SupportedTextSplitterLanguages)[number];
|
|
43
44
|
export declare class RecursiveCharacterTextSplitter extends TextSplitter implements RecursiveCharacterTextSplitterParams {
|
|
45
|
+
static lc_name(): string;
|
|
44
46
|
separators: string[];
|
|
45
47
|
constructor(fields?: Partial<RecursiveCharacterTextSplitterParams>);
|
|
46
48
|
private _splitText;
|
|
@@ -57,6 +59,7 @@ export interface TokenTextSplitterParams extends TextSplitterParams {
|
|
|
57
59
|
* Implementation of splitter which looks at tokens.
|
|
58
60
|
*/
|
|
59
61
|
export declare class TokenTextSplitter extends TextSplitter implements TokenTextSplitterParams {
|
|
62
|
+
static lc_name(): string;
|
|
60
63
|
encodingName: tiktoken.TiktokenEncoding;
|
|
61
64
|
allowedSpecial: "all" | Array<string>;
|
|
62
65
|
disallowedSpecial: "all" | Array<string>;
|
package/dist/text_splitter.js
CHANGED
|
@@ -158,6 +158,9 @@ which is longer than the specified ${this.chunkSize}`);
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
export class CharacterTextSplitter extends TextSplitter {
|
|
161
|
+
static lc_name() {
|
|
162
|
+
return "CharacterTextSplitter";
|
|
163
|
+
}
|
|
161
164
|
constructor(fields) {
|
|
162
165
|
super(fields);
|
|
163
166
|
Object.defineProperty(this, "separator", {
|
|
@@ -193,6 +196,9 @@ export const SupportedTextSplitterLanguages = [
|
|
|
193
196
|
"sol",
|
|
194
197
|
];
|
|
195
198
|
export class RecursiveCharacterTextSplitter extends TextSplitter {
|
|
199
|
+
static lc_name() {
|
|
200
|
+
return "RecursiveCharacterTextSplitter";
|
|
201
|
+
}
|
|
196
202
|
constructor(fields) {
|
|
197
203
|
super(fields);
|
|
198
204
|
Object.defineProperty(this, "separators", {
|
|
@@ -626,6 +632,9 @@ export class RecursiveCharacterTextSplitter extends TextSplitter {
|
|
|
626
632
|
* Implementation of splitter which looks at tokens.
|
|
627
633
|
*/
|
|
628
634
|
export class TokenTextSplitter extends TextSplitter {
|
|
635
|
+
static lc_name() {
|
|
636
|
+
return "TokenTextSplitter";
|
|
637
|
+
}
|
|
629
638
|
constructor(fields) {
|
|
630
639
|
super(fields);
|
|
631
640
|
Object.defineProperty(this, "encodingName", {
|
|
@@ -37,6 +37,9 @@ https://maker.ifttt.com/use/YOUR_IFTTT_KEY. Grab the YOUR_IFTTT_KEY value.
|
|
|
37
37
|
*/
|
|
38
38
|
const base_js_1 = require("./base.cjs");
|
|
39
39
|
class IFTTTWebhook extends base_js_1.Tool {
|
|
40
|
+
static lc_name() {
|
|
41
|
+
return "IFTTTWebhook";
|
|
42
|
+
}
|
|
40
43
|
constructor(url, name, description) {
|
|
41
44
|
super(...arguments);
|
|
42
45
|
Object.defineProperty(this, "url", {
|
|
@@ -34,6 +34,9 @@ https://maker.ifttt.com/use/YOUR_IFTTT_KEY. Grab the YOUR_IFTTT_KEY value.
|
|
|
34
34
|
*/
|
|
35
35
|
import { Tool } from "./base.js";
|
|
36
36
|
export class IFTTTWebhook extends Tool {
|
|
37
|
+
static lc_name() {
|
|
38
|
+
return "IFTTTWebhook";
|
|
39
|
+
}
|
|
37
40
|
constructor(url, name, description) {
|
|
38
41
|
super(...arguments);
|
|
39
42
|
Object.defineProperty(this, "url", {
|
package/dist/tools/aiplugin.cjs
CHANGED
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AIPluginTool = void 0;
|
|
4
4
|
const base_js_1 = require("./base.cjs");
|
|
5
5
|
class AIPluginTool extends base_js_1.Tool {
|
|
6
|
+
static lc_name() {
|
|
7
|
+
return "AIPluginTool";
|
|
8
|
+
}
|
|
6
9
|
get name() {
|
|
7
10
|
return this._name;
|
|
8
11
|
}
|
package/dist/tools/aiplugin.d.ts
CHANGED
package/dist/tools/aiplugin.js
CHANGED
package/dist/tools/aws_sfn.cjs
CHANGED
|
@@ -4,6 +4,9 @@ exports.SendTaskSuccessAWSSfnTool = exports.DescribeExecutionAWSSfnTool = export
|
|
|
4
4
|
const client_sfn_1 = require("@aws-sdk/client-sfn");
|
|
5
5
|
const base_js_1 = require("./base.cjs");
|
|
6
6
|
class StartExecutionAWSSfnTool extends base_js_1.Tool {
|
|
7
|
+
static lc_name() {
|
|
8
|
+
return "StartExecutionAWSSfnTool";
|
|
9
|
+
}
|
|
7
10
|
constructor({ name, description, ...rest }) {
|
|
8
11
|
super();
|
|
9
12
|
Object.defineProperty(this, "sfnConfig", {
|
|
@@ -60,6 +63,9 @@ class StartExecutionAWSSfnTool extends base_js_1.Tool {
|
|
|
60
63
|
}
|
|
61
64
|
exports.StartExecutionAWSSfnTool = StartExecutionAWSSfnTool;
|
|
62
65
|
class DescribeExecutionAWSSfnTool extends base_js_1.Tool {
|
|
66
|
+
static lc_name() {
|
|
67
|
+
return "DescribeExecutionAWSSfnTool";
|
|
68
|
+
}
|
|
63
69
|
constructor(config) {
|
|
64
70
|
super(config);
|
|
65
71
|
Object.defineProperty(this, "name", {
|
|
@@ -112,6 +118,9 @@ class DescribeExecutionAWSSfnTool extends base_js_1.Tool {
|
|
|
112
118
|
}
|
|
113
119
|
exports.DescribeExecutionAWSSfnTool = DescribeExecutionAWSSfnTool;
|
|
114
120
|
class SendTaskSuccessAWSSfnTool extends base_js_1.Tool {
|
|
121
|
+
static lc_name() {
|
|
122
|
+
return "SendTaskSuccessAWSSfnTool";
|
|
123
|
+
}
|
|
115
124
|
constructor(config) {
|
|
116
125
|
super(config);
|
|
117
126
|
Object.defineProperty(this, "name", {
|
package/dist/tools/aws_sfn.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface SfnConfig {
|
|
|
6
6
|
secretAccessKey?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare class StartExecutionAWSSfnTool extends Tool {
|
|
9
|
+
static lc_name(): string;
|
|
9
10
|
private sfnConfig;
|
|
10
11
|
name: string;
|
|
11
12
|
description: string;
|
|
@@ -18,6 +19,7 @@ export declare class StartExecutionAWSSfnTool extends Tool {
|
|
|
18
19
|
_call(input: string): Promise<string>;
|
|
19
20
|
}
|
|
20
21
|
export declare class DescribeExecutionAWSSfnTool extends Tool {
|
|
22
|
+
static lc_name(): string;
|
|
21
23
|
name: string;
|
|
22
24
|
description: string;
|
|
23
25
|
sfnConfig: Omit<SfnConfig, "stateMachineArn">;
|
|
@@ -26,6 +28,7 @@ export declare class DescribeExecutionAWSSfnTool extends Tool {
|
|
|
26
28
|
_call(input: string): Promise<string>;
|
|
27
29
|
}
|
|
28
30
|
export declare class SendTaskSuccessAWSSfnTool extends Tool {
|
|
31
|
+
static lc_name(): string;
|
|
29
32
|
name: string;
|
|
30
33
|
description: string;
|
|
31
34
|
sfnConfig: Omit<SfnConfig, "stateMachineArn">;
|