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

Upgrade xata client to 0.28.0 and apply required change #3553

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/core_docs/docs/integrations/vectorstores/xata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm install @xata.io/cli -g
In the [Xata UI](https://app.xata.io) create a new database. You can name it whatever you want, but for this example we'll use `langchain`.
Create a table, again you can name it anything, but we will use `vectors`. Add the following columns via the UI:

- `content` of type "Long text". This is used to store the `Document.pageContent` values.
- `content` of type "Text". This is used to store the `Document.pageContent` values.
- `embedding` of type "Vector". Use the dimension used by the model you plan to use (1536 for OpenAI).
- any other columns you want to use as metadata. They are populated from the `Document.metadata` object. For example, if in the `Document.metadata` object you have a `title` property, you can create a `title` column in the table and it will be populated.

Expand Down
4 changes: 2 additions & 2 deletions langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@
"@vercel/kv": "^0.2.3",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there! 👋 I noticed the update to "@xata.io/client" from "^0.25.1" to "^0.28.0" in the package.json. This seems to be a change in the hard dependency, so I'm flagging it for the maintainers to review. Keep up the great work! 🚀

"@vercel/postgres": "^0.5.0",
"@writerai/writer-sdk": "^0.40.2",
"@xata.io/client": "^0.25.1",
"@xata.io/client": "^0.28.0",
"@xenova/transformers": "^2.5.4",
"@zilliz/milvus2-sdk-node": ">=2.2.11",
"apify-client": "^2.7.1",
Expand Down Expand Up @@ -1066,7 +1066,7 @@
"@vercel/kv": "^0.2.3",
"@vercel/postgres": "^0.5.0",
"@writerai/writer-sdk": "^0.40.2",
"@xata.io/client": "^0.25.1",
"@xata.io/client": "^0.28.0",
"@xenova/transformers": "^2.5.4",
"@zilliz/milvus2-sdk-node": ">=2.2.7",
"apify-client": "^2.7.1",
Expand Down
5 changes: 5 additions & 0 deletions langchain/src/vectorstores/tests/xata.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { XataVectorSearch } from "../xata.js";
import { OpenAIEmbeddings } from "../../embeddings/openai.js";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey team, I've flagged a change in the XataVectorSearch integration test that requires the XATA_API_KEY environment variable to be set. This is important for maintainers to review as it indicates a dependency on this environment variable for the test to run successfully.

import { Document } from "../../document.js";

// Tests require a DB with a table called "docs" with:
// * a column name content of type Text
// * a column named embedding of type Vector
// * a column named a of type Integer

test.skip("XataVectorSearch integration", async () => {
if (!process.env.XATA_API_KEY) {
throw new Error("XATA_API_KEY not set");
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/vectorstores/xata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class XataVectorSearch<
k: number,
filter?: XataFilter | undefined
): Promise<[Document, number][]> {
const records = await this.client.db[this.table].vectorSearch(
const { records } = await this.client.db[this.table].vectorSearch(
"embedding",
query,
{
Expand Down
13 changes: 11 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12665,6 +12665,15 @@ __metadata:
languageName: node
linkType: hard

"@xata.io/client@npm:^0.28.0":
version: 0.28.0
resolution: "@xata.io/client@npm:0.28.0"
peerDependencies:
typescript: ">=4.5"
checksum: 39dbf590c320ba49623f44ab1124fb084f08f2820d04bc1f7c20459304ac4008227964ce4e5d9bf1ab34828c7d3fa3afb50f3455a1f37a981238463ae4289036
languageName: node
linkType: hard

"@xenova/transformers@npm:^2.5.4":
version: 2.5.4
resolution: "@xenova/transformers@npm:2.5.4"
Expand Down Expand Up @@ -22690,7 +22699,7 @@ __metadata:
"@vercel/kv": ^0.2.3
"@vercel/postgres": ^0.5.0
"@writerai/writer-sdk": ^0.40.2
"@xata.io/client": ^0.25.1
"@xata.io/client": ^0.28.0
"@xenova/transformers": ^2.5.4
"@zilliz/milvus2-sdk-node": ">=2.2.11"
apify-client: ^2.7.1
Expand Down Expand Up @@ -22827,7 +22836,7 @@ __metadata:
"@vercel/kv": ^0.2.3
"@vercel/postgres": ^0.5.0
"@writerai/writer-sdk": ^0.40.2
"@xata.io/client": ^0.25.1
"@xata.io/client": ^0.28.0
"@xenova/transformers": ^2.5.4
"@zilliz/milvus2-sdk-node": ">=2.2.7"
apify-client: ^2.7.1
Expand Down