openlayer 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -16,7 +16,6 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
16
16
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- const node_fetch_1 = require("node-fetch");
20
19
  const openai_1 = require("openai");
21
20
  const request_1 = require("./utils/request");
22
21
  class OpenAIMonitor {
@@ -34,7 +33,7 @@ class OpenAIMonitor {
34
33
  const uploadToInferencePipeline = (id) => __awaiter(this, void 0, void 0, function* () {
35
34
  const dataStreamEndpoint = `/inference-pipelines/${id}/data-stream`;
36
35
  const dataStreamQuery = this.resolvedQuery(dataStreamEndpoint);
37
- const response = yield (0, node_fetch_1.default)(dataStreamQuery, {
36
+ const response = yield fetch(dataStreamQuery, {
38
37
  body: JSON.stringify({
39
38
  config: {
40
39
  inferenceIdColumnName: 'inference_id',
@@ -67,7 +66,7 @@ class OpenAIMonitor {
67
66
  name: this.openlayerProjectName,
68
67
  };
69
68
  const projectsQuery = this.resolvedQuery(projectsEndpoint, projectsQueryParameters);
70
- const projectsResponse = yield (0, node_fetch_1.default)(projectsQuery, {
69
+ const projectsResponse = yield fetch(projectsQuery, {
71
70
  headers: {
72
71
  Authorization: `Bearer ${this.openlayerApiKey}`,
73
72
  'Content-Type': 'application/json',
@@ -87,7 +86,7 @@ class OpenAIMonitor {
87
86
  name: this.openlayerInferencePipelineName,
88
87
  };
89
88
  const inferencePipelineQuery = this.resolvedQuery(inferencePipelineEndpoint, inferencePipelineQueryParameters);
90
- const inferencePipelineResponse = yield (0, node_fetch_1.default)(inferencePipelineQuery, {
89
+ const inferencePipelineResponse = yield fetch(inferencePipelineQuery, {
91
90
  headers: {
92
91
  Authorization: `Bearer ${this.openlayerApiKey}`,
93
92
  'Content-Type': 'application/json',
@@ -106,7 +105,7 @@ class OpenAIMonitor {
106
105
  else {
107
106
  const createInferencePipelineEndpoint = `/projects/${project.id}/inference-pipelines`;
108
107
  const createInferencePipelineQuery = this.resolvedQuery(createInferencePipelineEndpoint);
109
- const createInferencePipelineResponse = yield (0, node_fetch_1.default)(createInferencePipelineQuery, {
108
+ const createInferencePipelineResponse = yield fetch(createInferencePipelineQuery, {
110
109
  body: JSON.stringify({
111
110
  description: '',
112
111
  name: typeof this.openlayerInferencePipelineName === 'undefined'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openlayer",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "The Openlayer TypeScript client",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",