-
Notifications
You must be signed in to change notification settings - Fork 91
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
OPENAI embeddings API Integration #177
Comments
You'll have to update the
import { OpenAIEmbeddings } from "@langchain/openai";
// load documents into vector store
vectorStore = new EnhancedMemoryVectorStore(
new OpenAIEmbeddings({
apiKey: "YOUR-API-KEY", // In Node.js defaults to process.env.OPENAI_API_KEY
batchSize: 512, // Default value if omitted is 512. Max is 2048
model: "text-embedding-3-large",
});
);
That's it! Let me know if that helps. |
Thank you so much, this helped me a lot! In addition, I would like to ask if there is a way that I could integrate and call the openAI API instead of using Ollama models with Lumos itself because using the Ollama models on my local system is making my system way slower, so I would like to use the complete RAG using openAI option. Kindly help me out with the same. Thank you, |
Again, you'll have to update the
import { ChatOpenAI } from "@langchain/openai";
import { OpenAI } from "@langchain/openai";
const getChatModel = (options: LumosOptions): Runnable => {
return new ChatOpenAI({
apiKey: "YOUR-API-KEY",
callbacks: [new ConsoleCallbackHandler()],
}).bind({
signal: controller.signal,
});
};
const classifyPrompt = async (
options: LumosOptions,
type: string,
originalPrompt: string,
classifcationPrompt: string,
prefixTrigger?: string,
): Promise<boolean> => {
...
// otherwise, attempt to classify prompt
const openai = new OpenAI({
apiKey: "YOUR-API-KEY",
temperature: 0,
stop: [".", ","],
}).bind({
signal: controller.signal,
});
...
};
|
Closing this issue for now. @arhaang13, let me know if you need more help. |
Can you please help me navigating how to change and experiment the same application with the openAI embeddings API.
The text was updated successfully, but these errors were encountered: