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
|
@@ -5,6 +5,9 @@ const llm_chain_js_1 = require("../../chains/llm_chain.cjs");
|
|
|
5
5
|
const prompt_js_1 = require("../../prompts/prompt.cjs");
|
|
6
6
|
/** Chain to execute tasks. */
|
|
7
7
|
class TaskExecutionChain extends llm_chain_js_1.LLMChain {
|
|
8
|
+
static lc_name() {
|
|
9
|
+
return "TaskExecutionChain";
|
|
10
|
+
}
|
|
8
11
|
static fromLLM(fields) {
|
|
9
12
|
const executionTemplate = `You are an AI who performs one task based on the following objective: ` +
|
|
10
13
|
`{objective}.` +
|
|
@@ -2,6 +2,9 @@ import { LLMChain } from "../../chains/llm_chain.js";
|
|
|
2
2
|
import { PromptTemplate } from "../../prompts/prompt.js";
|
|
3
3
|
/** Chain to execute tasks. */
|
|
4
4
|
export class TaskExecutionChain extends LLMChain {
|
|
5
|
+
static lc_name() {
|
|
6
|
+
return "TaskExecutionChain";
|
|
7
|
+
}
|
|
5
8
|
static fromLLM(fields) {
|
|
6
9
|
const executionTemplate = `You are an AI who performs one task based on the following objective: ` +
|
|
7
10
|
`{objective}.` +
|
|
@@ -5,6 +5,9 @@ const llm_chain_js_1 = require("../../chains/llm_chain.cjs");
|
|
|
5
5
|
const prompt_js_1 = require("../../prompts/prompt.cjs");
|
|
6
6
|
/** Chain to prioritize tasks. */
|
|
7
7
|
class TaskPrioritizationChain extends llm_chain_js_1.LLMChain {
|
|
8
|
+
static lc_name() {
|
|
9
|
+
return "TaskPrioritizationChain";
|
|
10
|
+
}
|
|
8
11
|
static fromLLM(fields) {
|
|
9
12
|
const taskPrioritizationTemplate = `You are a task prioritization AI tasked with cleaning the formatting of ` +
|
|
10
13
|
`and reprioritizing the following tasks: {task_names}.` +
|
|
@@ -2,6 +2,9 @@ import { LLMChain } from "../../chains/llm_chain.js";
|
|
|
2
2
|
import { PromptTemplate } from "../../prompts/prompt.js";
|
|
3
3
|
/** Chain to prioritize tasks. */
|
|
4
4
|
export class TaskPrioritizationChain extends LLMChain {
|
|
5
|
+
static lc_name() {
|
|
6
|
+
return "TaskPrioritizationChain";
|
|
7
|
+
}
|
|
5
8
|
static fromLLM(fields) {
|
|
6
9
|
const taskPrioritizationTemplate = `You are a task prioritization AI tasked with cleaning the formatting of ` +
|
|
7
10
|
`and reprioritizing the following tasks: {task_names}.` +
|
|
@@ -5,6 +5,9 @@ const llm_chain_js_1 = require("../../chains/llm_chain.cjs");
|
|
|
5
5
|
const index_js_1 = require("../../prompts/index.cjs");
|
|
6
6
|
const base_js_1 = require("../../chains/base.cjs");
|
|
7
7
|
class GenerativeAgent extends base_js_1.BaseChain {
|
|
8
|
+
static lc_name() {
|
|
9
|
+
return "GenerativeAgent";
|
|
10
|
+
}
|
|
8
11
|
// TODO: Add support for daily summaries
|
|
9
12
|
// private dailySummaries: string[] = []; // summary of the events in the plan that the agent took.
|
|
10
13
|
_chainType() {
|
|
@@ -2,6 +2,9 @@ import { LLMChain } from "../../chains/llm_chain.js";
|
|
|
2
2
|
import { PromptTemplate } from "../../prompts/index.js";
|
|
3
3
|
import { BaseChain } from "../../chains/base.js";
|
|
4
4
|
export class GenerativeAgent extends BaseChain {
|
|
5
|
+
static lc_name() {
|
|
6
|
+
return "GenerativeAgent";
|
|
7
|
+
}
|
|
5
8
|
// TODO: Add support for daily summaries
|
|
6
9
|
// private dailySummaries: string[] = []; // summary of the events in the plan that the agent took.
|
|
7
10
|
_chainType() {
|
|
@@ -7,6 +7,9 @@ const base_js_1 = require("../../chains/base.cjs");
|
|
|
7
7
|
const document_js_1 = require("../../document.cjs");
|
|
8
8
|
const base_js_2 = require("../../memory/base.cjs");
|
|
9
9
|
class GenerativeAgentMemoryChain extends base_js_1.BaseChain {
|
|
10
|
+
static lc_name() {
|
|
11
|
+
return "GenerativeAgentMemoryChain";
|
|
12
|
+
}
|
|
10
13
|
constructor(llm, memoryRetriever, config) {
|
|
11
14
|
super();
|
|
12
15
|
Object.defineProperty(this, "reflecting", {
|
|
@@ -4,6 +4,9 @@ import { BaseChain } from "../../chains/base.js";
|
|
|
4
4
|
import { Document } from "../../document.js";
|
|
5
5
|
import { BaseMemory } from "../../memory/base.js";
|
|
6
6
|
class GenerativeAgentMemoryChain extends BaseChain {
|
|
7
|
+
static lc_name() {
|
|
8
|
+
return "GenerativeAgentMemoryChain";
|
|
9
|
+
}
|
|
7
10
|
constructor(llm, memoryRetriever, config) {
|
|
8
11
|
super();
|
|
9
12
|
Object.defineProperty(this, "reflecting", {
|
|
@@ -9,6 +9,9 @@ const llm_chain_js_1 = require("../../chains/llm_chain.cjs");
|
|
|
9
9
|
const outputParser_js_1 = require("./outputParser.cjs");
|
|
10
10
|
const index_js_1 = require("../../agents/chat/index.cjs");
|
|
11
11
|
class PlanAndExecuteAgentExecutor extends base_js_1.BaseChain {
|
|
12
|
+
static lc_name() {
|
|
13
|
+
return "PlanAndExecuteAgentExecutor";
|
|
14
|
+
}
|
|
12
15
|
constructor(input) {
|
|
13
16
|
super(input);
|
|
14
17
|
Object.defineProperty(this, "planner", {
|
|
@@ -13,6 +13,7 @@ export interface PlanAndExecuteAgentExecutorInput extends ChainInputs {
|
|
|
13
13
|
outputKey?: string;
|
|
14
14
|
}
|
|
15
15
|
export declare class PlanAndExecuteAgentExecutor extends BaseChain {
|
|
16
|
+
static lc_name(): string;
|
|
16
17
|
private planner;
|
|
17
18
|
private stepExecutor;
|
|
18
19
|
private stepContainer;
|
|
@@ -6,6 +6,9 @@ import { LLMChain } from "../../chains/llm_chain.js";
|
|
|
6
6
|
import { PlanOutputParser } from "./outputParser.js";
|
|
7
7
|
import { ChatAgent } from "../../agents/chat/index.js";
|
|
8
8
|
export class PlanAndExecuteAgentExecutor extends BaseChain {
|
|
9
|
+
static lc_name() {
|
|
10
|
+
return "PlanAndExecuteAgentExecutor";
|
|
11
|
+
}
|
|
9
12
|
constructor(input) {
|
|
10
13
|
super(input);
|
|
11
14
|
Object.defineProperty(this, "planner", {
|
package/dist/llms/cohere.cjs
CHANGED
package/dist/llms/cohere.d.ts
CHANGED
package/dist/llms/cohere.js
CHANGED
package/dist/llms/ollama.cjs
CHANGED
|
@@ -5,6 +5,9 @@ const base_js_1 = require("./base.cjs");
|
|
|
5
5
|
const ollama_js_1 = require("../util/ollama.cjs");
|
|
6
6
|
const index_js_1 = require("../schema/index.cjs");
|
|
7
7
|
class Ollama extends base_js_1.LLM {
|
|
8
|
+
static lc_name() {
|
|
9
|
+
return "Ollama";
|
|
10
|
+
}
|
|
8
11
|
constructor(fields) {
|
|
9
12
|
super(fields);
|
|
10
13
|
Object.defineProperty(this, "lc_serializable", {
|
package/dist/llms/ollama.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { CallbackManagerForLLMRun } from "../callbacks/manager.js";
|
|
|
4
4
|
import { GenerationChunk } from "../schema/index.js";
|
|
5
5
|
export declare class Ollama extends LLM implements OllamaInput {
|
|
6
6
|
CallOptions: OllamaCallOptions;
|
|
7
|
+
static lc_name(): string;
|
|
7
8
|
lc_serializable: boolean;
|
|
8
9
|
model: string;
|
|
9
10
|
baseUrl: string;
|
package/dist/llms/ollama.js
CHANGED
|
@@ -2,6 +2,9 @@ import { LLM } from "./base.js";
|
|
|
2
2
|
import { createOllamaStream, } from "../util/ollama.js";
|
|
3
3
|
import { GenerationChunk } from "../schema/index.js";
|
|
4
4
|
export class Ollama extends LLM {
|
|
5
|
+
static lc_name() {
|
|
6
|
+
return "Ollama";
|
|
7
|
+
}
|
|
5
8
|
constructor(fields) {
|
|
6
9
|
super(fields);
|
|
7
10
|
Object.defineProperty(this, "lc_serializable", {
|
|
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PromptLayerOpenAIChat = exports.OpenAIChat = void 0;
|
|
7
7
|
const openai_1 = require("openai");
|
|
8
|
-
const env_js_1 = require("../util/env.cjs");
|
|
9
|
-
const axios_fetch_adapter_js_1 = __importDefault(require("../util/axios-fetch-adapter.cjs"));
|
|
10
|
-
const base_js_1 = require("./base.cjs");
|
|
11
8
|
const index_js_1 = require("../schema/index.cjs");
|
|
12
|
-
const
|
|
9
|
+
const axios_fetch_adapter_js_1 = __importDefault(require("../util/axios-fetch-adapter.cjs"));
|
|
13
10
|
const azure_js_1 = require("../util/azure.cjs");
|
|
11
|
+
const env_js_1 = require("../util/env.cjs");
|
|
12
|
+
const prompt_layer_js_1 = require("../util/prompt-layer.cjs");
|
|
14
13
|
const stream_js_1 = require("../util/stream.cjs");
|
|
14
|
+
const base_js_1 = require("./base.cjs");
|
|
15
15
|
/**
|
|
16
16
|
* Wrapper around OpenAI large language models that use the Chat endpoint.
|
|
17
17
|
*
|
|
@@ -35,6 +35,9 @@ const stream_js_1 = require("../util/stream.cjs");
|
|
|
35
35
|
* @augments AzureOpenAIChatInput
|
|
36
36
|
*/
|
|
37
37
|
class OpenAIChat extends base_js_1.LLM {
|
|
38
|
+
static lc_name() {
|
|
39
|
+
return "OpenAIChat";
|
|
40
|
+
}
|
|
38
41
|
get callKeys() {
|
|
39
42
|
return [
|
|
40
43
|
...super.callKeys,
|
|
@@ -46,6 +49,7 @@ class OpenAIChat extends base_js_1.LLM {
|
|
|
46
49
|
return {
|
|
47
50
|
openAIApiKey: "OPENAI_API_KEY",
|
|
48
51
|
azureOpenAIApiKey: "AZURE_OPENAI_API_KEY",
|
|
52
|
+
organization: "OPENAI_ORGANIZATION",
|
|
49
53
|
};
|
|
50
54
|
}
|
|
51
55
|
get lc_aliases() {
|
|
@@ -188,6 +192,12 @@ class OpenAIChat extends base_js_1.LLM {
|
|
|
188
192
|
writable: true,
|
|
189
193
|
value: void 0
|
|
190
194
|
});
|
|
195
|
+
Object.defineProperty(this, "organization", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
configurable: true,
|
|
198
|
+
writable: true,
|
|
199
|
+
value: void 0
|
|
200
|
+
});
|
|
191
201
|
Object.defineProperty(this, "client", {
|
|
192
202
|
enumerable: true,
|
|
193
203
|
configurable: true,
|
|
@@ -222,6 +232,9 @@ class OpenAIChat extends base_js_1.LLM {
|
|
|
222
232
|
this.azureOpenAIBasePath =
|
|
223
233
|
fields?.azureOpenAIBasePath ??
|
|
224
234
|
(0, env_js_1.getEnvironmentVariable)("AZURE_OPENAI_BASE_PATH");
|
|
235
|
+
this.organization =
|
|
236
|
+
fields?.configuration?.organization ??
|
|
237
|
+
(0, env_js_1.getEnvironmentVariable)("OPENAI_ORGANIZATION");
|
|
225
238
|
this.modelName = fields?.modelName ?? this.modelName;
|
|
226
239
|
this.prefixMessages = fields?.prefixMessages ?? this.prefixMessages;
|
|
227
240
|
this.modelKwargs = fields?.modelKwargs ?? {};
|
|
@@ -252,6 +265,7 @@ class OpenAIChat extends base_js_1.LLM {
|
|
|
252
265
|
}
|
|
253
266
|
this.clientConfig = {
|
|
254
267
|
apiKey: this.openAIApiKey,
|
|
268
|
+
organization: this.organization,
|
|
255
269
|
...configuration,
|
|
256
270
|
...fields?.configuration,
|
|
257
271
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ChatCompletionRequestMessage,
|
|
1
|
+
import { ChatCompletionRequestMessage, ConfigurationParameters, CreateChatCompletionRequest, CreateChatCompletionResponse } from "openai";
|
|
2
|
+
import { CallbackManagerForLLMRun } from "../callbacks/manager.js";
|
|
3
|
+
import { GenerationChunk, LLMResult } from "../schema/index.js";
|
|
2
4
|
import { AzureOpenAIInput, OpenAICallOptions, OpenAIChatInput } from "../types/openai-types.js";
|
|
3
5
|
import type { StreamingAxiosConfiguration } from "../util/axios-types.js";
|
|
4
6
|
import { BaseLLMParams, LLM } from "./base.js";
|
|
5
|
-
|
|
6
|
-
import { LLMResult, GenerationChunk } from "../schema/index.js";
|
|
7
|
-
export { OpenAIChatInput, AzureOpenAIInput };
|
|
7
|
+
export { AzureOpenAIInput, OpenAIChatInput };
|
|
8
8
|
export interface OpenAIChatCallOptions extends OpenAICallOptions {
|
|
9
9
|
promptIndex?: number;
|
|
10
10
|
}
|
|
@@ -31,6 +31,7 @@ export interface OpenAIChatCallOptions extends OpenAICallOptions {
|
|
|
31
31
|
* @augments AzureOpenAIChatInput
|
|
32
32
|
*/
|
|
33
33
|
export declare class OpenAIChat extends LLM<OpenAIChatCallOptions> implements OpenAIChatInput, AzureOpenAIInput {
|
|
34
|
+
static lc_name(): string;
|
|
34
35
|
get callKeys(): (keyof OpenAIChatCallOptions)[];
|
|
35
36
|
lc_serializable: boolean;
|
|
36
37
|
get lc_secrets(): {
|
|
@@ -57,6 +58,7 @@ export declare class OpenAIChat extends LLM<OpenAIChatCallOptions> implements Op
|
|
|
57
58
|
azureOpenAIApiInstanceName?: string;
|
|
58
59
|
azureOpenAIApiDeploymentName?: string;
|
|
59
60
|
azureOpenAIBasePath?: string;
|
|
61
|
+
organization?: string;
|
|
60
62
|
private client;
|
|
61
63
|
private clientConfig;
|
|
62
64
|
constructor(fields?: Partial<OpenAIChatInput> & Partial<AzureOpenAIInput> & BaseLLMParams & {
|
package/dist/llms/openai-chat.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Configuration, OpenAIApi, } from "openai";
|
|
2
|
-
import { isNode, getEnvironmentVariable } from "../util/env.js";
|
|
3
|
-
import fetchAdapter from "../util/axios-fetch-adapter.js";
|
|
4
|
-
import { LLM } from "./base.js";
|
|
5
2
|
import { GenerationChunk } from "../schema/index.js";
|
|
6
|
-
import
|
|
3
|
+
import fetchAdapter from "../util/axios-fetch-adapter.js";
|
|
7
4
|
import { getEndpoint } from "../util/azure.js";
|
|
5
|
+
import { getEnvironmentVariable, isNode } from "../util/env.js";
|
|
6
|
+
import { promptLayerTrackRequest } from "../util/prompt-layer.js";
|
|
8
7
|
import { readableStreamToAsyncIterable } from "../util/stream.js";
|
|
8
|
+
import { LLM } from "./base.js";
|
|
9
9
|
/**
|
|
10
10
|
* Wrapper around OpenAI large language models that use the Chat endpoint.
|
|
11
11
|
*
|
|
@@ -29,6 +29,9 @@ import { readableStreamToAsyncIterable } from "../util/stream.js";
|
|
|
29
29
|
* @augments AzureOpenAIChatInput
|
|
30
30
|
*/
|
|
31
31
|
export class OpenAIChat extends LLM {
|
|
32
|
+
static lc_name() {
|
|
33
|
+
return "OpenAIChat";
|
|
34
|
+
}
|
|
32
35
|
get callKeys() {
|
|
33
36
|
return [
|
|
34
37
|
...super.callKeys,
|
|
@@ -40,6 +43,7 @@ export class OpenAIChat extends LLM {
|
|
|
40
43
|
return {
|
|
41
44
|
openAIApiKey: "OPENAI_API_KEY",
|
|
42
45
|
azureOpenAIApiKey: "AZURE_OPENAI_API_KEY",
|
|
46
|
+
organization: "OPENAI_ORGANIZATION",
|
|
43
47
|
};
|
|
44
48
|
}
|
|
45
49
|
get lc_aliases() {
|
|
@@ -182,6 +186,12 @@ export class OpenAIChat extends LLM {
|
|
|
182
186
|
writable: true,
|
|
183
187
|
value: void 0
|
|
184
188
|
});
|
|
189
|
+
Object.defineProperty(this, "organization", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
configurable: true,
|
|
192
|
+
writable: true,
|
|
193
|
+
value: void 0
|
|
194
|
+
});
|
|
185
195
|
Object.defineProperty(this, "client", {
|
|
186
196
|
enumerable: true,
|
|
187
197
|
configurable: true,
|
|
@@ -216,6 +226,9 @@ export class OpenAIChat extends LLM {
|
|
|
216
226
|
this.azureOpenAIBasePath =
|
|
217
227
|
fields?.azureOpenAIBasePath ??
|
|
218
228
|
getEnvironmentVariable("AZURE_OPENAI_BASE_PATH");
|
|
229
|
+
this.organization =
|
|
230
|
+
fields?.configuration?.organization ??
|
|
231
|
+
getEnvironmentVariable("OPENAI_ORGANIZATION");
|
|
219
232
|
this.modelName = fields?.modelName ?? this.modelName;
|
|
220
233
|
this.prefixMessages = fields?.prefixMessages ?? this.prefixMessages;
|
|
221
234
|
this.modelKwargs = fields?.modelKwargs ?? {};
|
|
@@ -246,6 +259,7 @@ export class OpenAIChat extends LLM {
|
|
|
246
259
|
}
|
|
247
260
|
this.clientConfig = {
|
|
248
261
|
apiKey: this.openAIApiKey,
|
|
262
|
+
organization: this.organization,
|
|
249
263
|
...configuration,
|
|
250
264
|
...fields?.configuration,
|
|
251
265
|
};
|
package/dist/llms/openai.cjs
CHANGED
|
@@ -5,16 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PromptLayerOpenAIChat = exports.OpenAIChat = exports.PromptLayerOpenAI = exports.OpenAI = void 0;
|
|
7
7
|
const openai_1 = require("openai");
|
|
8
|
-
const env_js_1 = require("../util/env.cjs");
|
|
9
|
-
const axios_fetch_adapter_js_1 = __importDefault(require("../util/axios-fetch-adapter.cjs"));
|
|
10
|
-
const chunk_js_1 = require("../util/chunk.cjs");
|
|
11
|
-
const base_js_1 = require("./base.cjs");
|
|
12
8
|
const count_tokens_js_1 = require("../base_language/count_tokens.cjs");
|
|
13
|
-
const openai_chat_js_1 = require("./openai-chat.cjs");
|
|
14
9
|
const index_js_1 = require("../schema/index.cjs");
|
|
15
|
-
const
|
|
10
|
+
const axios_fetch_adapter_js_1 = __importDefault(require("../util/axios-fetch-adapter.cjs"));
|
|
16
11
|
const azure_js_1 = require("../util/azure.cjs");
|
|
12
|
+
const chunk_js_1 = require("../util/chunk.cjs");
|
|
13
|
+
const env_js_1 = require("../util/env.cjs");
|
|
14
|
+
const prompt_layer_js_1 = require("../util/prompt-layer.cjs");
|
|
17
15
|
const stream_js_1 = require("../util/stream.cjs");
|
|
16
|
+
const base_js_1 = require("./base.cjs");
|
|
17
|
+
const openai_chat_js_1 = require("./openai-chat.cjs");
|
|
18
18
|
/**
|
|
19
19
|
* Wrapper around OpenAI large language models.
|
|
20
20
|
*
|
|
@@ -34,6 +34,9 @@ const stream_js_1 = require("../util/stream.cjs");
|
|
|
34
34
|
* if not explicitly available on this class.
|
|
35
35
|
*/
|
|
36
36
|
class OpenAI extends base_js_1.BaseLLM {
|
|
37
|
+
static lc_name() {
|
|
38
|
+
return "OpenAI";
|
|
39
|
+
}
|
|
37
40
|
get callKeys() {
|
|
38
41
|
return [...super.callKeys, "options"];
|
|
39
42
|
}
|
|
@@ -41,6 +44,7 @@ class OpenAI extends base_js_1.BaseLLM {
|
|
|
41
44
|
return {
|
|
42
45
|
openAIApiKey: "OPENAI_API_KEY",
|
|
43
46
|
azureOpenAIApiKey: "AZURE_OPENAI_API_KEY",
|
|
47
|
+
organization: "OPENAI_ORGANIZATION",
|
|
44
48
|
};
|
|
45
49
|
}
|
|
46
50
|
get lc_aliases() {
|
|
@@ -195,6 +199,12 @@ class OpenAI extends base_js_1.BaseLLM {
|
|
|
195
199
|
writable: true,
|
|
196
200
|
value: void 0
|
|
197
201
|
});
|
|
202
|
+
Object.defineProperty(this, "organization", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
configurable: true,
|
|
205
|
+
writable: true,
|
|
206
|
+
value: void 0
|
|
207
|
+
});
|
|
198
208
|
Object.defineProperty(this, "client", {
|
|
199
209
|
enumerable: true,
|
|
200
210
|
configurable: true,
|
|
@@ -229,6 +239,9 @@ class OpenAI extends base_js_1.BaseLLM {
|
|
|
229
239
|
this.azureOpenAIBasePath =
|
|
230
240
|
fields?.azureOpenAIBasePath ??
|
|
231
241
|
(0, env_js_1.getEnvironmentVariable)("AZURE_OPENAI_BASE_PATH");
|
|
242
|
+
this.organization =
|
|
243
|
+
fields?.configuration?.organization ??
|
|
244
|
+
(0, env_js_1.getEnvironmentVariable)("OPENAI_ORGANIZATION");
|
|
232
245
|
this.modelName = fields?.modelName ?? this.modelName;
|
|
233
246
|
this.modelKwargs = fields?.modelKwargs ?? {};
|
|
234
247
|
this.batchSize = fields?.batchSize ?? this.batchSize;
|
|
@@ -260,6 +273,7 @@ class OpenAI extends base_js_1.BaseLLM {
|
|
|
260
273
|
}
|
|
261
274
|
this.clientConfig = {
|
|
262
275
|
apiKey: this.openAIApiKey,
|
|
276
|
+
organization: this.organization,
|
|
263
277
|
...configuration,
|
|
264
278
|
...fields?.configuration,
|
|
265
279
|
};
|
package/dist/llms/openai.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ConfigurationParameters, CreateCompletionRequest, CreateCompletionResponse } from "openai";
|
|
2
|
+
import { CallbackManagerForLLMRun } from "../callbacks/manager.js";
|
|
3
|
+
import { GenerationChunk, LLMResult } from "../schema/index.js";
|
|
2
4
|
import { AzureOpenAIInput, OpenAICallOptions, OpenAIInput } from "../types/openai-types.js";
|
|
3
5
|
import type { StreamingAxiosConfiguration } from "../util/axios-types.js";
|
|
4
6
|
import { BaseLLM, BaseLLMParams } from "./base.js";
|
|
5
|
-
|
|
6
|
-
import { CallbackManagerForLLMRun } from "../callbacks/manager.js";
|
|
7
|
-
export { OpenAICallOptions, AzureOpenAIInput, OpenAIInput };
|
|
7
|
+
export { AzureOpenAIInput, OpenAICallOptions, OpenAIInput };
|
|
8
8
|
/**
|
|
9
9
|
* Wrapper around OpenAI large language models.
|
|
10
10
|
*
|
|
@@ -24,6 +24,7 @@ export { OpenAICallOptions, AzureOpenAIInput, OpenAIInput };
|
|
|
24
24
|
* if not explicitly available on this class.
|
|
25
25
|
*/
|
|
26
26
|
export declare class OpenAI extends BaseLLM<OpenAICallOptions> implements OpenAIInput, AzureOpenAIInput {
|
|
27
|
+
static lc_name(): string;
|
|
27
28
|
get callKeys(): (keyof OpenAICallOptions)[];
|
|
28
29
|
lc_serializable: boolean;
|
|
29
30
|
get lc_secrets(): {
|
|
@@ -51,6 +52,7 @@ export declare class OpenAI extends BaseLLM<OpenAICallOptions> implements OpenAI
|
|
|
51
52
|
azureOpenAIApiInstanceName?: string;
|
|
52
53
|
azureOpenAIApiDeploymentName?: string;
|
|
53
54
|
azureOpenAIBasePath?: string;
|
|
55
|
+
organization?: string;
|
|
54
56
|
private client;
|
|
55
57
|
private clientConfig;
|
|
56
58
|
constructor(fields?: Partial<OpenAIInput> & Partial<AzureOpenAIInput> & BaseLLMParams & {
|
package/dist/llms/openai.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Configuration, OpenAIApi, } from "openai";
|
|
2
|
-
import { isNode, getEnvironmentVariable } from "../util/env.js";
|
|
3
|
-
import fetchAdapter from "../util/axios-fetch-adapter.js";
|
|
4
|
-
import { chunkArray } from "../util/chunk.js";
|
|
5
|
-
import { BaseLLM } from "./base.js";
|
|
6
2
|
import { calculateMaxTokens } from "../base_language/count_tokens.js";
|
|
7
|
-
import { OpenAIChat } from "./openai-chat.js";
|
|
8
3
|
import { GenerationChunk } from "../schema/index.js";
|
|
9
|
-
import
|
|
4
|
+
import fetchAdapter from "../util/axios-fetch-adapter.js";
|
|
10
5
|
import { getEndpoint } from "../util/azure.js";
|
|
6
|
+
import { chunkArray } from "../util/chunk.js";
|
|
7
|
+
import { getEnvironmentVariable, isNode } from "../util/env.js";
|
|
8
|
+
import { promptLayerTrackRequest } from "../util/prompt-layer.js";
|
|
11
9
|
import { readableStreamToAsyncIterable } from "../util/stream.js";
|
|
10
|
+
import { BaseLLM } from "./base.js";
|
|
11
|
+
import { OpenAIChat } from "./openai-chat.js";
|
|
12
12
|
/**
|
|
13
13
|
* Wrapper around OpenAI large language models.
|
|
14
14
|
*
|
|
@@ -28,6 +28,9 @@ import { readableStreamToAsyncIterable } from "../util/stream.js";
|
|
|
28
28
|
* if not explicitly available on this class.
|
|
29
29
|
*/
|
|
30
30
|
export class OpenAI extends BaseLLM {
|
|
31
|
+
static lc_name() {
|
|
32
|
+
return "OpenAI";
|
|
33
|
+
}
|
|
31
34
|
get callKeys() {
|
|
32
35
|
return [...super.callKeys, "options"];
|
|
33
36
|
}
|
|
@@ -35,6 +38,7 @@ export class OpenAI extends BaseLLM {
|
|
|
35
38
|
return {
|
|
36
39
|
openAIApiKey: "OPENAI_API_KEY",
|
|
37
40
|
azureOpenAIApiKey: "AZURE_OPENAI_API_KEY",
|
|
41
|
+
organization: "OPENAI_ORGANIZATION",
|
|
38
42
|
};
|
|
39
43
|
}
|
|
40
44
|
get lc_aliases() {
|
|
@@ -189,6 +193,12 @@ export class OpenAI extends BaseLLM {
|
|
|
189
193
|
writable: true,
|
|
190
194
|
value: void 0
|
|
191
195
|
});
|
|
196
|
+
Object.defineProperty(this, "organization", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
configurable: true,
|
|
199
|
+
writable: true,
|
|
200
|
+
value: void 0
|
|
201
|
+
});
|
|
192
202
|
Object.defineProperty(this, "client", {
|
|
193
203
|
enumerable: true,
|
|
194
204
|
configurable: true,
|
|
@@ -223,6 +233,9 @@ export class OpenAI extends BaseLLM {
|
|
|
223
233
|
this.azureOpenAIBasePath =
|
|
224
234
|
fields?.azureOpenAIBasePath ??
|
|
225
235
|
getEnvironmentVariable("AZURE_OPENAI_BASE_PATH");
|
|
236
|
+
this.organization =
|
|
237
|
+
fields?.configuration?.organization ??
|
|
238
|
+
getEnvironmentVariable("OPENAI_ORGANIZATION");
|
|
226
239
|
this.modelName = fields?.modelName ?? this.modelName;
|
|
227
240
|
this.modelKwargs = fields?.modelKwargs ?? {};
|
|
228
241
|
this.batchSize = fields?.batchSize ?? this.batchSize;
|
|
@@ -254,6 +267,7 @@ export class OpenAI extends BaseLLM {
|
|
|
254
267
|
}
|
|
255
268
|
this.clientConfig = {
|
|
256
269
|
apiKey: this.openAIApiKey,
|
|
270
|
+
organization: this.organization,
|
|
257
271
|
...configuration,
|
|
258
272
|
...fields?.configuration,
|
|
259
273
|
};
|
package/dist/llms/replicate.cjs
CHANGED
|
@@ -4,6 +4,9 @@ exports.Replicate = void 0;
|
|
|
4
4
|
const env_js_1 = require("../util/env.cjs");
|
|
5
5
|
const base_js_1 = require("./base.cjs");
|
|
6
6
|
class Replicate extends base_js_1.LLM {
|
|
7
|
+
static lc_name() {
|
|
8
|
+
return "Replicate";
|
|
9
|
+
}
|
|
7
10
|
get lc_secrets() {
|
|
8
11
|
return {
|
|
9
12
|
apiKey: "REPLICATE_API_TOKEN",
|
package/dist/llms/replicate.d.ts
CHANGED
package/dist/llms/replicate.js
CHANGED
|
@@ -71,6 +71,7 @@ exports.optionalImportEntrypoints = [
|
|
|
71
71
|
"langchain/document_loaders/web/s3",
|
|
72
72
|
"langchain/document_loaders/web/sonix_audio",
|
|
73
73
|
"langchain/document_loaders/web/confluence",
|
|
74
|
+
"langchain/document_loaders/web/youtube",
|
|
74
75
|
"langchain/document_loaders/fs/directory",
|
|
75
76
|
"langchain/document_loaders/fs/buffer",
|
|
76
77
|
"langchain/document_loaders/fs/text",
|
|
@@ -68,6 +68,7 @@ export const optionalImportEntrypoints = [
|
|
|
68
68
|
"langchain/document_loaders/web/s3",
|
|
69
69
|
"langchain/document_loaders/web/sonix_audio",
|
|
70
70
|
"langchain/document_loaders/web/confluence",
|
|
71
|
+
"langchain/document_loaders/web/youtube",
|
|
71
72
|
"langchain/document_loaders/fs/directory",
|
|
72
73
|
"langchain/document_loaders/fs/buffer",
|
|
73
74
|
"langchain/document_loaders/fs/text",
|
package/dist/load/index.cjs
CHANGED
|
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.load = void 0;
|
|
27
|
+
const serializable_js_1 = require("./serializable.cjs");
|
|
27
28
|
const import_constants_js_1 = require("./import_constants.cjs");
|
|
28
29
|
const importMap = __importStar(require("./import_map.cjs"));
|
|
29
30
|
const map_keys_js_1 = require("./map_keys.cjs");
|
|
@@ -132,7 +133,12 @@ async function reviver(value) {
|
|
|
132
133
|
throw new Error(`Invalid namespace: ${pathStr} -> ${str}`);
|
|
133
134
|
}
|
|
134
135
|
// Extract the builder from the import map.
|
|
135
|
-
const builder =
|
|
136
|
+
const builder =
|
|
137
|
+
// look for a named export with the same name as the class
|
|
138
|
+
module[name] ??
|
|
139
|
+
// look for an export with a lc_name property matching the class name
|
|
140
|
+
// this is necessary for classes that are minified
|
|
141
|
+
Object.values(module).find((v) => typeof v === "function" && (0, serializable_js_1.get_lc_unique_name)(v) === name);
|
|
136
142
|
if (typeof builder !== "function") {
|
|
137
143
|
throw new Error(`Invalid identifer: ${pathStr} -> ${str}`);
|
|
138
144
|
}
|
package/dist/load/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { get_lc_unique_name, } from "./serializable.js";
|
|
1
2
|
import { optionalImportEntrypoints } from "./import_constants.js";
|
|
2
3
|
import * as importMap from "./import_map.js";
|
|
3
4
|
import { keyFromJson, mapKeys } from "./map_keys.js";
|
|
@@ -106,7 +107,12 @@ async function reviver(value) {
|
|
|
106
107
|
throw new Error(`Invalid namespace: ${pathStr} -> ${str}`);
|
|
107
108
|
}
|
|
108
109
|
// Extract the builder from the import map.
|
|
109
|
-
const builder =
|
|
110
|
+
const builder =
|
|
111
|
+
// look for a named export with the same name as the class
|
|
112
|
+
module[name] ??
|
|
113
|
+
// look for an export with a lc_name property matching the class name
|
|
114
|
+
// this is necessary for classes that are minified
|
|
115
|
+
Object.values(module).find((v) => typeof v === "function" && get_lc_unique_name(v) === name);
|
|
110
116
|
if (typeof builder !== "function") {
|
|
111
117
|
throw new Error(`Invalid identifer: ${pathStr} -> ${str}`);
|
|
112
118
|
}
|