1
2
3
4
5
6
7
8
9
10
11
12
13
import { CohereCommon } from "https://esm.town/v/rlesser/CohereCommon";
export let CohereEmbed = (key: string, texts: Array<string>, options = {}) => {
// see endpoint options here: https://docs.cohere.ai/reference/embed
const defaultOptions = {
truncate: "END",
};
return CohereCommon(key, "embed", {
...defaultOptions,
...options,
texts,
});
};
1
Next