Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix llms and chat tests failing, rework llms accordingly to new Watsonx #31

Merged
merged 55 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
317a6af
Fix llms and chat tests failing, rework llms accordingly to new Watso…
FilipZmijewski Nov 13, 2024
933c90f
Fixed missing tool_choice in call options of chat (#30)
FilipZmijewski Nov 12, 2024
d4e5bc4
Remove unused import
FilipZmijewski Nov 13, 2024
ebbeaa6
Fix
FilipZmijewski Nov 13, 2024
b7b980b
fix[community]: Fixed missing tool_choice in call options of chat IBM…
FilipZmijewski Nov 12, 2024
4a712a8
fix(anthropic, bedrock): Remove message merging logic (#7196)
bracesproul Nov 13, 2024
65a6f51
feat(community): Release 0.3.14 (#7197)
bracesproul Nov 13, 2024
9b312bd
feat(anthropic): Release 0.3.8 (#7198)
bracesproul Nov 13, 2024
30bdafd
fix(google-genai): Force tool usage in WSO (#7213)
bracesproul Nov 16, 2024
1e9908f
fix(google-genai): Release 0.1.4 (#7215)
bracesproul Nov 16, 2024
7bf0eaf
feat(community): Adds an HTML loader for URLS (#7184)
philnash Nov 17, 2024
d939328
feat(community): allow metadata generics to flow through LibSQLVector…
cdierkens Nov 17, 2024
157e1d6
feat(community): replace `vectordb` package with new `@lancedb/lanced…
wjones127 Nov 17, 2024
2aac482
feat(cosmosdbnosql): Add Chat History Integration (#7057)
aditishree1 Nov 17, 2024
9b2de04
chore(azure-cosmosdb): Release 0.2.2 (#7219)
jacoblee93 Nov 17, 2024
d6a0663
feat(community): add filters to LibSQLVectorStore (#7209)
cdierkens Nov 17, 2024
ebb06ef
chore(community): Release 0.3.15 (#7221)
jacoblee93 Nov 17, 2024
d65690a
fix(langchain): Fix structured parser with triple backticks, adds tes…
johnguirgis Nov 17, 2024
67193c1
chore(langchain): add throw err for JsonOutputFunctionsParser.parse (…
Makoq Nov 17, 2024
5fcc0c4
fix(langchain): Fix serialization for initChatModel (#7222)
jacoblee93 Nov 17, 2024
6d7398e
chore(langchain): Release 0.3.6 (#7223)
jacoblee93 Nov 17, 2024
c37d90e
feat(pinecone): Add support for Pinecone `/embed` endpoint (#7203)
aulorbe Nov 17, 2024
70206f0
chore(pinecone): Release 0.1.3 (#7224)
jacoblee93 Nov 17, 2024
6ab8bcc
fix(openai): Support o1 streaming (#7229)
bracesproul Nov 18, 2024
27d0adc
chore(openai): Release 0.3.14 (#7230)
jacoblee93 Nov 18, 2024
105461f
docs: Add missing streaming concept (#7228)
eyurtsev Nov 20, 2024
d5e616d
fix(ci): Update release script to be more lenient (#7234)
bracesproul Nov 22, 2024
2c071da
feat(mistral): Mistral 1.3.1 migration (#7218)
CarterMorris Nov 22, 2024
3f9dfd0
chore(mistral): Release 0.2.0 (#7239)
jacoblee93 Nov 22, 2024
0c18758
feat(azurecosmosdb): Vector Store Add DiskANN index for CosmosDB (#7225)
crisjc-e Nov 22, 2024
661c9e2
chore(azure-cosmosdb): Release 0.2.3 (#7241)
jacoblee93 Nov 22, 2024
6b42b80
fix(community): bedrock parsing array content/tool blocks (#7244)
bracesproul Nov 22, 2024
f555135
fix(ci): Fix release workspace (#7245)
bracesproul Nov 22, 2024
552d054
feat(community): Incorporate BM25 score in the results (#7236)
felipediel Nov 25, 2024
b40f981
feat(community): Stagehand tools integration (#7177)
filip-michalsky Nov 25, 2024
c62a644
Update Pinecone indexing example to show use of deletionProtection (#…
aulorbe Nov 25, 2024
d28b74a
feat(community): Add rerank solution to existing IBM community implem…
FilipZmijewski Nov 25, 2024
080e0c7
fix(core): Fix issue in .d.ts typing for protected type (#7259)
jacoblee93 Nov 25, 2024
256f2a8
fix(community): PrismaVectorStore handle empty array in filter (#7254)
shan-mx Nov 25, 2024
87f7283
fix(core): Move type (#7246)
jacoblee93 Nov 25, 2024
ccf278f
chore(core): Release 0.3.19 (#7260)
jacoblee93 Nov 25, 2024
a8c3927
chore(community): Release 0.3.16 (#7261)
jacoblee93 Nov 25, 2024
4ddb593
fix(google-common): Anthropic util using getType instead of _getType …
bracesproul Nov 26, 2024
85d56f3
release(google-common): 0.1.3 (#7265)
bracesproul Nov 26, 2024
0f0ccd5
fix(google-gauth/webauth): Bump Google common dep (#7266)
bracesproul Nov 26, 2024
27b34b2
release(google-webauth): 0.1.3 (#7267)
bracesproul Nov 26, 2024
8a59fdc
fix(google-vertexai/web): Bump Google auth deps (#7269)
bracesproul Nov 26, 2024
f90dac0
release(google-vertexai): 0.1.3 (#7270)
bracesproul Nov 26, 2024
7b05e28
release(google-gauth): 0.1.3 (#7271)
bracesproul Nov 26, 2024
018a4f6
release(google-vertexai-web): 0.1.3 (#7272)
bracesproul Nov 26, 2024
c7ed778
Main ibm community update to main (#34)
FilipZmijewski Nov 26, 2024
e2078ba
Change compressDocuments() method, add tests regarding changes"
FilipZmijewski Nov 27, 2024
5e6b43b
Remove unused import
FilipZmijewski Nov 27, 2024
24e0b0b
Merge branch 'main' into fix/ibm_implementation
FilipZmijewski Nov 27, 2024
87363cb
Update ibm.ts
FilipZmijewski Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(community): replace vectordb package with new `@lancedb/lanced…
…b` (langchain-ai#7202)

Co-authored-by: jacoblee93 <jacoblee93@gmail.com>
  • Loading branch information
2 people authored and FilipZmijewski committed Nov 27, 2024
commit 157e1d6aad75e4e1074ddc27aa14c9a767343efb
4 changes: 2 additions & 2 deletions docs/core_docs/docs/integrations/vectorstores/lancedb.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ LanceDB datasets are persisted to disk and can be shared between Node.js and Pyt

## Setup

Install the [LanceDB](https://github.com/lancedb/lancedb) [Node.js bindings](https://www.npmjs.com/package/vectordb):
Install the [LanceDB](https://github.com/lancedb/lancedb) [Node.js bindings](https://www.npmjs.com/package/@lancedb/lancedb):

```bash npm2yarn
npm install -S vectordb
npm install -S @lancedb/lancedb
```

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
Expand Down
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@getzep/zep-js": "^0.9.0",
"@gomomento/sdk": "^1.51.1",
"@google/generative-ai": "^0.7.0",
"@lancedb/lancedb": "^0.13.0",
"@langchain/anthropic": "workspace:*",
"@langchain/aws": "workspace:*",
"@langchain/azure-cosmosdb": "workspace:*",
Expand Down Expand Up @@ -102,7 +103,6 @@
"typeorm": "^0.3.20",
"typesense": "^1.5.3",
"uuid": "^10.0.0",
"vectordb": "^0.9.0",
"voy-search": "0.6.2",
"weaviate-ts-client": "^2.0.0",
"zod": "^3.22.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/src/indexes/vector_stores/lancedb/load.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LanceDB } from "@langchain/community/vectorstores/lancedb";
import { OpenAIEmbeddings } from "@langchain/openai";
import { connect } from "vectordb";
import { connect } from "@lancedb/lancedb";
import * as fs from "node:fs/promises";
import * as path from "node:path";
import os from "node:os";
Expand Down
10 changes: 5 additions & 5 deletions libs/langchain-community/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@huggingface/inference": "^2.6.4",
"@ibm-cloud/watsonx-ai": "^1.1.0",
"@jest/globals": "^29.5.0",
"@lancedb/lancedb": "^0.13.0",
"@langchain/core": "workspace:*",
"@langchain/scripts": ">=0.1.0 <0.2.0",
"@langchain/standard-tests": "0.0.0",
Expand Down Expand Up @@ -210,7 +211,6 @@
"typescript": "~5.1.6",
"typesense": "^1.5.3",
"usearch": "^1.1.1",
"vectordb": "^0.9.0",
"voy-search": "0.6.2",
"weaviate-ts-client": "^1.4.0",
"web-auth-library": "^1.0.3",
Expand Down Expand Up @@ -246,6 +246,7 @@
"@gradientai/nodejs-sdk": "^1.2.0",
"@huggingface/inference": "^2.6.4",
"@ibm-cloud/watsonx-ai": "*",
"@lancedb/lancedb": "^0.12.0",
"@langchain/core": ">=0.2.21 <0.4.0",
"@layerup/layerup-security": "^1.5.12",
"@libsql/client": "^0.14.0",
Expand Down Expand Up @@ -334,7 +335,6 @@
"typeorm": "^0.3.20",
"typesense": "^1.5.3",
"usearch": "^1.1.1",
"vectordb": "^0.1.4",
"voy-search": "0.6.2",
"weaviate-ts-client": "*",
"web-auth-library": "^1.0.3",
Expand Down Expand Up @@ -424,6 +424,9 @@
"@huggingface/inference": {
"optional": true
},
"@lancedb/lancedb": {
"optional": true
},
"@layerup/layerup-security": {
"optional": true
},
Expand Down Expand Up @@ -682,9 +685,6 @@
"usearch": {
"optional": true
},
"vectordb": {
"optional": true
},
"voy-search": {
"optional": true
},
Expand Down
16 changes: 10 additions & 6 deletions libs/langchain-community/src/vectorstores/lancedb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { connect, Table, Connection, WriteMode } from "vectordb";
import { connect, Table, Connection } from "@lancedb/lancedb";
import type { EmbeddingsInterface } from "@langchain/core/embeddings";
import { VectorStore } from "@langchain/core/vectorstores";
import { Document } from "@langchain/core/documents";
Expand All @@ -12,7 +12,7 @@ export type LanceDBArgs = {
textKey?: string;
uri?: string;
tableName?: string;
mode?: WriteMode;
mode?: "create" | "overwrite";
};

/**
Expand All @@ -29,7 +29,7 @@ export class LanceDB extends VectorStore {

private tableName: string;

private mode?: WriteMode;
private mode?: "create" | "overwrite";

constructor(embeddings: EmbeddingsInterface, args?: LanceDBArgs) {
super(embeddings, args || {});
Expand All @@ -38,7 +38,7 @@ export class LanceDB extends VectorStore {
this.textKey = args?.textKey || "text";
this.uri = args?.uri || "~/lancedb";
this.tableName = args?.tableName || "langchain";
this.mode = args?.mode || WriteMode.Overwrite;
this.mode = args?.mode || "overwrite";
}

/**
Expand Down Expand Up @@ -86,7 +86,7 @@ export class LanceDB extends VectorStore {
if (!this.table) {
const db: Connection = await connect(this.uri);
this.table = await db.createTable(this.tableName, data, {
writeMode: this.mode,
mode: this.mode,
});

return;
Expand All @@ -110,7 +110,11 @@ export class LanceDB extends VectorStore {
"Table not found. Please add vectors to the table first."
);
}
const results = await this.table.search(query).limit(k).execute();
const results = await this.table
.query()
.nearestTo(query)
.limit(k)
.toArray();

const docsAndScore: [Document, number][] = [];
results.forEach((item) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { beforeEach, describe, expect, test } from "@jest/globals";
import * as fs from "node:fs/promises";
import * as path from "node:path";
import * as os from "node:os";
import { connect, Table } from "vectordb";
import { connect, Table } from "@lancedb/lancedb";

import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
Expand Down
109 changes: 50 additions & 59 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11126,41 +11126,68 @@ __metadata:
languageName: node
linkType: hard

"@lancedb/vectordb-darwin-arm64@npm:0.4.20":
version: 0.4.20
resolution: "@lancedb/vectordb-darwin-arm64@npm:0.4.20"
"@lancedb/lancedb-darwin-arm64@npm:0.13.0":
version: 0.13.0
resolution: "@lancedb/lancedb-darwin-arm64@npm:0.13.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@lancedb/vectordb-darwin-x64@npm:0.4.20":
version: 0.4.20
resolution: "@lancedb/vectordb-darwin-x64@npm:0.4.20"
"@lancedb/lancedb-darwin-x64@npm:0.13.0":
version: 0.13.0
resolution: "@lancedb/lancedb-darwin-x64@npm:0.13.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@lancedb/vectordb-linux-arm64-gnu@npm:0.4.20":
version: 0.4.20
resolution: "@lancedb/vectordb-linux-arm64-gnu@npm:0.4.20"
conditions: os=linux & cpu=arm64
"@lancedb/lancedb-linux-arm64-gnu@npm:0.13.0":
version: 0.13.0
resolution: "@lancedb/lancedb-linux-arm64-gnu@npm:0.13.0"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@lancedb/vectordb-linux-x64-gnu@npm:0.4.20":
version: 0.4.20
resolution: "@lancedb/vectordb-linux-x64-gnu@npm:0.4.20"
conditions: os=linux & cpu=x64
"@lancedb/lancedb-linux-x64-gnu@npm:0.13.0":
version: 0.13.0
resolution: "@lancedb/lancedb-linux-x64-gnu@npm:0.13.0"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@lancedb/vectordb-win32-x64-msvc@npm:0.4.20":
version: 0.4.20
resolution: "@lancedb/vectordb-win32-x64-msvc@npm:0.4.20"
"@lancedb/lancedb-win32-x64-msvc@npm:0.13.0":
version: 0.13.0
resolution: "@lancedb/lancedb-win32-x64-msvc@npm:0.13.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@lancedb/lancedb@npm:^0.13.0":
version: 0.13.0
resolution: "@lancedb/lancedb@npm:0.13.0"
dependencies:
"@lancedb/lancedb-darwin-arm64": 0.13.0
"@lancedb/lancedb-darwin-x64": 0.13.0
"@lancedb/lancedb-linux-arm64-gnu": 0.13.0
"@lancedb/lancedb-linux-x64-gnu": 0.13.0
"@lancedb/lancedb-win32-x64-msvc": 0.13.0
reflect-metadata: ^0.2.2
peerDependencies:
apache-arrow: ">=13.0.0 <=17.0.0"
dependenciesMeta:
"@lancedb/lancedb-darwin-arm64":
optional: true
"@lancedb/lancedb-darwin-x64":
optional: true
"@lancedb/lancedb-linux-arm64-gnu":
optional: true
"@lancedb/lancedb-linux-x64-gnu":
optional: true
"@lancedb/lancedb-win32-x64-msvc":
optional: true
conditions: (os=darwin | os=linux | os=win32) & (cpu=x64 | cpu=arm64)
languageName: node
linkType: hard

"@langchain/anthropic@*, @langchain/anthropic@workspace:*, @langchain/anthropic@workspace:libs/langchain-anthropic":
version: 0.0.0-use.local
resolution: "@langchain/anthropic@workspace:libs/langchain-anthropic"
Expand Down Expand Up @@ -11490,6 +11517,7 @@ __metadata:
"@huggingface/inference": ^2.6.4
"@ibm-cloud/watsonx-ai": ^1.1.0
"@jest/globals": ^29.5.0
"@lancedb/lancedb": ^0.13.0
"@langchain/core": "workspace:*"
"@langchain/openai": ">=0.2.0 <0.4.0"
"@langchain/scripts": ">=0.1.0 <0.2.0"
Expand Down Expand Up @@ -11629,7 +11657,6 @@ __metadata:
typesense: ^1.5.3
usearch: ^1.1.1
uuid: ^10.0.0
vectordb: ^0.9.0
voy-search: 0.6.2
weaviate-ts-client: ^1.4.0
web-auth-library: ^1.0.3
Expand Down Expand Up @@ -11666,6 +11693,7 @@ __metadata:
"@gradientai/nodejs-sdk": ^1.2.0
"@huggingface/inference": ^2.6.4
"@ibm-cloud/watsonx-ai": "*"
"@lancedb/lancedb": ^0.12.0
"@langchain/core": ">=0.2.21 <0.4.0"
"@layerup/layerup-security": ^1.5.12
"@libsql/client": ^0.14.0
Expand Down Expand Up @@ -11754,7 +11782,6 @@ __metadata:
typeorm: ^0.3.20
typesense: ^1.5.3
usearch: ^1.1.1
vectordb: ^0.1.4
voy-search: 0.6.2
weaviate-ts-client: "*"
web-auth-library: ^1.0.3
Expand Down Expand Up @@ -11816,6 +11843,8 @@ __metadata:
optional: true
"@huggingface/inference":
optional: true
"@lancedb/lancedb":
optional: true
"@layerup/layerup-security":
optional: true
"@libsql/client":
Expand Down Expand Up @@ -11988,8 +12017,6 @@ __metadata:
optional: true
usearch:
optional: true
vectordb:
optional: true
voy-search:
optional: true
weaviate-ts-client:
Expand Down Expand Up @@ -13234,13 +13261,6 @@ __metadata:
languageName: node
linkType: hard

"@neon-rs/load@npm:^0.0.74":
version: 0.0.74
resolution: "@neon-rs/load@npm:0.0.74"
checksum: d26ec9b08cdf1a7c5aeefe98f77112d205d11b4005a7934b21fe8fd27528847e08e4749e7e6c3fc05ae9f701175a58c11a095ae6af449634df3991a2c82e1dfa
languageName: node
linkType: hard

"@neondatabase/serverless@npm:0.6.0":
version: 0.6.0
resolution: "@neondatabase/serverless@npm:0.6.0"
Expand Down Expand Up @@ -27373,6 +27393,7 @@ __metadata:
"@getzep/zep-js": ^0.9.0
"@gomomento/sdk": ^1.51.1
"@google/generative-ai": ^0.7.0
"@lancedb/lancedb": ^0.13.0
"@langchain/anthropic": "workspace:*"
"@langchain/aws": "workspace:*"
"@langchain/azure-cosmosdb": "workspace:*"
Expand Down Expand Up @@ -27457,7 +27478,6 @@ __metadata:
typescript: ~5.1.6
typesense: ^1.5.3
uuid: ^10.0.0
vectordb: ^0.9.0
voy-search: 0.6.2
weaviate-ts-client: ^2.0.0
zod: ^3.22.4
Expand Down Expand Up @@ -38701,7 +38721,7 @@ __metadata:
languageName: node
linkType: hard

"reflect-metadata@npm:^0.2.1":
"reflect-metadata@npm:^0.2.1, reflect-metadata@npm:^0.2.2":
version: 0.2.2
resolution: "reflect-metadata@npm:0.2.2"
checksum: a66c7b583e4efdd8f3c3124fbff33da2d0c86d8280617516308b32b2159af7a3698c961db3246387f56f6316b1d33a608f39bb2b49d813316dfc58f6d3bf3210
Expand Down Expand Up @@ -43229,35 +43249,6 @@ __metadata:
languageName: node
linkType: hard

"vectordb@npm:^0.9.0":
version: 0.9.0
resolution: "vectordb@npm:0.9.0"
dependencies:
"@lancedb/vectordb-darwin-arm64": 0.4.20
"@lancedb/vectordb-darwin-x64": 0.4.20
"@lancedb/vectordb-linux-arm64-gnu": 0.4.20
"@lancedb/vectordb-linux-x64-gnu": 0.4.20
"@lancedb/vectordb-win32-x64-msvc": 0.4.20
"@neon-rs/load": ^0.0.74
axios: ^1.4.0
peerDependencies:
"@apache-arrow/ts": ^14.0.2
apache-arrow: ^14.0.2
dependenciesMeta:
"@lancedb/vectordb-darwin-arm64":
optional: true
"@lancedb/vectordb-darwin-x64":
optional: true
"@lancedb/vectordb-linux-arm64-gnu":
optional: true
"@lancedb/vectordb-linux-x64-gnu":
optional: true
"@lancedb/vectordb-win32-x64-msvc":
optional: true
conditions: (os=darwin | os=linux | os=win32) & (cpu=x64 | cpu=arm64)
languageName: node
linkType: hard

"vfile-location@npm:^3.0.0, vfile-location@npm:^3.2.0":
version: 3.2.0
resolution: "vfile-location@npm:3.2.0"
Expand Down