@langchain/community
Advanced tools
Comparing version 0.3.7 to 0.3.8
@@ -21,5 +21,5 @@ import { type DocumentInterface } from "@langchain/core/documents"; | ||
/** | ||
* Mode of operation. Can be either "crawl" or "scrape". If not provided, the default value is "crawl". | ||
* Mode of operation. Can be "crawl", "scrape", or "map". If not provided, the default value is "crawl". | ||
*/ | ||
mode?: "crawl" | "scrape"; | ||
mode?: "crawl" | "scrape" | "map"; | ||
params?: Record<string, unknown>; | ||
@@ -26,0 +26,0 @@ } |
@@ -76,2 +76,3 @@ import FirecrawlApp from "@mendable/firecrawl-js"; | ||
if (this.mode === "scrape") { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const response = await app.scrapeUrl(this.url, this.params); | ||
@@ -81,8 +82,21 @@ if (!response.success) { | ||
} | ||
firecrawlDocs = [response.data]; | ||
firecrawlDocs = [response]; | ||
} | ||
else if (this.mode === "crawl") { | ||
const response = await app.crawlUrl(this.url, this.params, true); | ||
firecrawlDocs = response; | ||
const response = await app.crawlUrl(this.url, this.params); | ||
if (!response.success) { | ||
throw new Error(`Firecrawl: Failed to crawl URL. Error: ${response.error}`); | ||
} | ||
firecrawlDocs = response.data; | ||
} | ||
else if (this.mode === "map") { | ||
const response = await app.mapUrl(this.url, this.params); | ||
if (!response.success) { | ||
throw new Error(`Firecrawl: Failed to map URL. Error: ${response.error}`); | ||
} | ||
firecrawlDocs = response.links; | ||
return firecrawlDocs.map((doc) => new Document({ | ||
pageContent: JSON.stringify(doc), | ||
})); | ||
} | ||
else { | ||
@@ -92,3 +106,3 @@ throw new Error(`Unrecognized mode '${this.mode}'. Expected one of 'crawl', 'scrape'.`); | ||
return firecrawlDocs.map((doc) => new Document({ | ||
pageContent: doc.markdown || "", | ||
pageContent: doc.markdown || doc.html || doc.rawHtml || "", | ||
metadata: doc.metadata || {}, | ||
@@ -95,0 +109,0 @@ })); |
@@ -6,2 +6,3 @@ import { type BaseLLMCallOptions, type BaseLLMParams, LLM } from "@langchain/core/language_models/llms"; | ||
*/ | ||
/** @deprecated Please use newer implementation @langchain/community/llms/ibm instead */ | ||
export interface WatsonxAIParams extends BaseLLMParams { | ||
@@ -8,0 +9,0 @@ /** |
@@ -16,2 +16,3 @@ // Auto-generated by `scripts/create-entrypoints.js`. Do not edit manually. | ||
"langchain_community/embeddings/hf_transformers", | ||
"langchain_community/embeddings/ibm", | ||
"langchain_community/embeddings/jina", | ||
@@ -30,2 +31,3 @@ "langchain_community/embeddings/llama_cpp", | ||
"langchain_community/llms/hf", | ||
"langchain_community/llms/ibm", | ||
"langchain_community/llms/llama_cpp", | ||
@@ -86,2 +88,3 @@ "langchain_community/llms/portkey", | ||
"langchain_community/chat_models/bedrock/web", | ||
"langchain_community/chat_models/ibm", | ||
"langchain_community/chat_models/iflytek_xinghuo", | ||
@@ -88,0 +91,0 @@ "langchain_community/chat_models/iflytek_xinghuo/web", |
@@ -5,2 +5,3 @@ export interface OptionalImportMap { | ||
ALIBABA_API_KEY?: string; | ||
AUTHENTICATOR?: string; | ||
AWS_ACCESS_KEY_ID?: string; | ||
@@ -62,2 +63,8 @@ AWS_SECRETE_ACCESS_KEY?: string; | ||
VECTARA_CUSTOMER_ID?: string; | ||
WATSONX_AI_APIKEY?: string; | ||
WATSONX_AI_AUTH_TYPE?: string; | ||
WATSONX_AI_BEARER_TOKEN?: string; | ||
WATSONX_AI_PASSWORD?: string; | ||
WATSONX_AI_URL?: string; | ||
WATSONX_AI_USERNAME?: string; | ||
WATSONX_PROJECT_ID?: string; | ||
@@ -64,0 +71,0 @@ WRITER_API_KEY?: string; |
@@ -269,2 +269,9 @@ import * as uuid from "uuid"; | ||
} | ||
else if (condition.operator === "not_exists") { | ||
must_not.push({ | ||
exists: { | ||
field: metadataField, | ||
}, | ||
}); | ||
} | ||
else if (condition.operator === "exclude") { | ||
@@ -271,0 +278,0 @@ const toExclude = { [metadataField]: condition.value }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5350078
1986
132510
133
169