embeddings.js 630 B

1234567891011121314151617181920
  1. import { AsyncCaller } from "./utils/async_caller.js";
  2. /**
  3. * An abstract class that provides methods for embedding documents and
  4. * queries using LangChain.
  5. */
  6. export class Embeddings {
  7. constructor(params) {
  8. /**
  9. * The async caller should be used by subclasses to make any async calls,
  10. * which will thus benefit from the concurrency and retry logic.
  11. */
  12. Object.defineProperty(this, "caller", {
  13. enumerable: true,
  14. configurable: true,
  15. writable: true,
  16. value: void 0
  17. });
  18. this.caller = new AsyncCaller(params ?? {});
  19. }
  20. }