A class that translates or converts data into a format that can be used
with Weaviate, a vector search engine. It extends the BaseTranslator
class and provides specific implementation for Weaviate.
class WeaviateTranslatorconst selfQueryRetriever = new SelfQueryRetriever({
llm: new ChatOpenAI({ model: "gpt-4o-mini" }),
vectorStore: new WeaviateStore(),
documentContents: "Brief summary of a movie",
attributeInfo: [],
structuredQueryTranslator: new WeaviateTranslator(),
});
const relevantDocuments = await selfQueryRetriever.getRelevantDocuments(
"Which movies are rated higher than 8.5?",
);