registry.mjs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. export let auto = false;
  2. export let kind = undefined;
  3. export let fetch = undefined;
  4. export let Request = undefined;
  5. export let Response = undefined;
  6. export let Headers = undefined;
  7. export let FormData = undefined;
  8. export let Blob = undefined;
  9. export let File = undefined;
  10. export let ReadableStream = undefined;
  11. export let getMultipartRequestOptions = undefined;
  12. export let getDefaultAgent = undefined;
  13. export let fileFromPath = undefined;
  14. export let isFsReadStream = undefined;
  15. export function setShims(shims, options = { auto: false }) {
  16. if (auto) {
  17. throw new Error(`you must \`import 'openai/shims/${shims.kind}'\` before importing anything else from openai`);
  18. }
  19. if (kind) {
  20. throw new Error(`can't \`import 'openai/shims/${shims.kind}'\` after \`import 'openai/shims/${kind}'\``);
  21. }
  22. auto = options.auto;
  23. kind = shims.kind;
  24. fetch = shims.fetch;
  25. Request = shims.Request;
  26. Response = shims.Response;
  27. Headers = shims.Headers;
  28. FormData = shims.FormData;
  29. Blob = shims.Blob;
  30. File = shims.File;
  31. ReadableStream = shims.ReadableStream;
  32. getMultipartRequestOptions = shims.getMultipartRequestOptions;
  33. getDefaultAgent = shims.getDefaultAgent;
  34. fileFromPath = shims.fileFromPath;
  35. isFsReadStream = shims.isFsReadStream;
  36. }
  37. //# sourceMappingURL=registry.mjs.map