|
1 | 1 | import { test } from "@jest/globals";
|
2 | 2 | import { Document } from "@langchain/core/documents";
|
3 |
| -import { OpenAIEmbeddings, OpenAI } from "@langchain/openai"; |
| 3 | +import { OpenAIEmbeddings, ChatOpenAI } from "@langchain/openai"; |
4 | 4 | import { AttributeInfo } from "../../../chains/query_constructor/index.js";
|
5 | 5 | import { SelfQueryRetriever } from "../index.js";
|
6 | 6 | import { FunctionalTranslator } from "../functional.js";
|
@@ -73,8 +73,8 @@ test("Memory Vector Store Self Query Retriever Test", async () => {
|
73 | 73 | ];
|
74 | 74 |
|
75 | 75 | const embeddings = new OpenAIEmbeddings();
|
76 |
| - const llm = new OpenAI({ |
77 |
| - modelName: "gpt-3.5-turbo", |
| 76 | + const llm = new ChatOpenAI({ |
| 77 | + model: "gpt-4o-mini", |
78 | 78 | });
|
79 | 79 | const documentContents = "Brief summary of a movie";
|
80 | 80 | const vectorStore = await MemoryVectorStore.fromDocuments(docs, embeddings);
|
@@ -203,8 +203,8 @@ test("Memory Vector Store Self Query Retriever Test With Default Filter Or Merge
|
203 | 203 | ];
|
204 | 204 |
|
205 | 205 | const embeddings = new OpenAIEmbeddings();
|
206 |
| - const llm = new OpenAI({ |
207 |
| - modelName: "gpt-3.5-turbo", |
| 206 | + const llm = new ChatOpenAI({ |
| 207 | + model: "gpt-4o-mini", |
208 | 208 | });
|
209 | 209 | const documentContents = "Brief summary of a movie";
|
210 | 210 | const vectorStore = await MemoryVectorStore.fromDocuments(docs, embeddings);
|
@@ -344,8 +344,8 @@ test("Memory Vector Store Self Query Retriever Test With Default Filter And Merg
|
344 | 344 | ];
|
345 | 345 |
|
346 | 346 | const embeddings = new OpenAIEmbeddings();
|
347 |
| - const llm = new OpenAI({ |
348 |
| - modelName: "gpt-3.5-turbo", |
| 347 | + const llm = new ChatOpenAI({ |
| 348 | + model: "gpt-4o-mini", |
349 | 349 | });
|
350 | 350 | const documentContents = "Brief summary of a movie";
|
351 | 351 | const vectorStore = await MemoryVectorStore.fromDocuments(docs, embeddings);
|
@@ -384,5 +384,5 @@ test("Memory Vector Store Self Query Retriever Test With Default Filter And Merg
|
384 | 384 | "Awawawa au au au wawawawa hello?"
|
385 | 385 | );
|
386 | 386 | // console.log(query4);
|
387 |
| - expect(query4.length).toEqual(0); // this one should return documents since default filter takes over |
| 387 | + expect(query4.length).toEqual(7); // this one should return documents since default filter takes over |
388 | 388 | });
|
0 commit comments