Hey Paul,
Great question. Iām pleased to say that the cohere libraries are available in n8n and you can use it the langchain code node like so:
(Example taken from: Cohere Rerank | š¦ļøš Langchain)
const { CohereRerank } = require("@langchain/cohere");
const cohereRerank = new CohereRerank({
apiKey: '...', // You'll have to hardcode your key here
model: "rerank-english-v2.0", // Default
});
To use it in the example from my other post on using Langchain code node, we can do:
[Deleted]
Hope this helps!
Edit: Sorry, that was a bad example!