agrasya-voice-sdk 1.0.2 → 1.0.4

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.
package/dist/index.js CHANGED
@@ -34,8 +34,6 @@ __export(index_exports, {
34
34
  });
35
35
  module.exports = __toCommonJS(index_exports);
36
36
  var import_socket = __toESM(require("socket.io-client"));
37
- var import_dotenv = __toESM(require("dotenv"));
38
- import_dotenv.default.config();
39
37
  var AgrasyaVoiceSDK = class {
40
38
  config;
41
39
  events;
@@ -49,7 +47,7 @@ var AgrasyaVoiceSDK = class {
49
47
  durationInterval = null;
50
48
  constructor(config, events = {}) {
51
49
  this.config = {
52
- baseUrl: process.env.API_BASE_URL,
50
+ baseUrl: "http://localhost:4001",
53
51
  language: "",
54
52
  debug: false,
55
53
  ...config
@@ -127,8 +125,8 @@ var AgrasyaVoiceSDK = class {
127
125
  }
128
126
  const offer = await this.peerConnection.createOffer();
129
127
  await this.peerConnection.setLocalDescription(offer);
130
- const baseUrl = process.env.API_URL;
131
- const model = process.env.MODEL_NAME;
128
+ const baseUrl = "https://api.openai.com/v1/realtime/calls";
129
+ const model = "gpt-realtime";
132
130
  const sdpResponse = await fetch(`${baseUrl}?model=${model}`, {
133
131
  method: "POST",
134
132
  body: offer.sdp,
package/dist/index.mjs CHANGED
@@ -1,7 +1,5 @@
1
1
  // src/index.ts
2
2
  import io from "socket.io-client";
3
- import dotenv from "dotenv";
4
- dotenv.config();
5
3
  var AgrasyaVoiceSDK = class {
6
4
  config;
7
5
  events;
@@ -15,7 +13,7 @@ var AgrasyaVoiceSDK = class {
15
13
  durationInterval = null;
16
14
  constructor(config, events = {}) {
17
15
  this.config = {
18
- baseUrl: process.env.API_BASE_URL,
16
+ baseUrl: "http://localhost:4001",
19
17
  language: "",
20
18
  debug: false,
21
19
  ...config
@@ -93,8 +91,8 @@ var AgrasyaVoiceSDK = class {
93
91
  }
94
92
  const offer = await this.peerConnection.createOffer();
95
93
  await this.peerConnection.setLocalDescription(offer);
96
- const baseUrl = process.env.API_URL;
97
- const model = process.env.MODEL_NAME;
94
+ const baseUrl = "https://api.openai.com/v1/realtime/calls";
95
+ const model = "gpt-realtime";
98
96
  const sdpResponse = await fetch(`${baseUrl}?model=${model}`, {
99
97
  method: "POST",
100
98
  body: offer.sdp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrasya-voice-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,6 @@
26
26
  "typescript": "^5.0.0"
27
27
  },
28
28
  "dependencies": {
29
- "dotenv": "^17.3.1",
30
29
  "react-native-webrtc": "^124.0.7",
31
30
  "socket.io-client": "^4.8.3"
32
31
  }