@teamlearners/clawops 0.16.4 → 0.16.5
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/agent/index.cjs +29 -23
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.js +21 -15
- package/dist/agent/index.js.map +1 -1
- package/dist/{chunk-B3SD2KKR.js → chunk-BHGDB52N.js} +3 -3
- package/dist/{chunk-B3SD2KKR.js.map → chunk-BHGDB52N.js.map} +1 -1
- package/dist/{chunk-GTXJFMHN.cjs → chunk-TFYE5DWP.cjs} +3 -3
- package/dist/{chunk-GTXJFMHN.cjs.map → chunk-TFYE5DWP.cjs.map} +1 -1
- package/dist/index.cjs +35 -35
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/agent/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_BASE_URL, AgentError, AgentConnectionError, VERSION } from '../chunk-
|
|
1
|
+
import { DEFAULT_BASE_URL, AgentError, AgentConnectionError, VERSION } from '../chunk-BHGDB52N.js';
|
|
2
2
|
import pino from 'pino';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import * as path from 'path';
|
|
@@ -2689,8 +2689,7 @@ var OpenAIRealtime = class {
|
|
|
2689
2689
|
const url = `${OPENAI_REALTIME_URL}${this._model}`;
|
|
2690
2690
|
this._ws = new WebSocket(url, {
|
|
2691
2691
|
headers: {
|
|
2692
|
-
Authorization: `Bearer ${this._apiKey}
|
|
2693
|
-
"OpenAI-Beta": "realtime=v1"
|
|
2692
|
+
Authorization: `Bearer ${this._apiKey}`
|
|
2694
2693
|
}
|
|
2695
2694
|
});
|
|
2696
2695
|
return new Promise((resolve, reject) => {
|
|
@@ -2760,17 +2759,24 @@ var OpenAIRealtime = class {
|
|
|
2760
2759
|
this._send({
|
|
2761
2760
|
type: "session.update",
|
|
2762
2761
|
session: {
|
|
2763
|
-
|
|
2764
|
-
|
|
2762
|
+
type: "realtime",
|
|
2763
|
+
output_modalities: ["audio"],
|
|
2765
2764
|
instructions: this._systemPrompt,
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2765
|
+
audio: {
|
|
2766
|
+
input: {
|
|
2767
|
+
format: { type: "audio/pcmu" },
|
|
2768
|
+
noise_reduction: { type: "far_field" },
|
|
2769
|
+
transcription: {
|
|
2770
|
+
model: "gpt-realtime-whisper",
|
|
2771
|
+
language: this._language
|
|
2772
|
+
},
|
|
2773
|
+
turn_detection: this._turnDetection
|
|
2774
|
+
},
|
|
2775
|
+
output: {
|
|
2776
|
+
format: { type: "audio/pcmu" },
|
|
2777
|
+
voice: this._voice
|
|
2778
|
+
}
|
|
2771
2779
|
},
|
|
2772
|
-
input_audio_noise_reduction: { type: "far_field" },
|
|
2773
|
-
turn_detection: this._turnDetection,
|
|
2774
2780
|
tools: toolSchemas
|
|
2775
2781
|
}
|
|
2776
2782
|
});
|
|
@@ -2778,11 +2784,11 @@ var OpenAIRealtime = class {
|
|
|
2778
2784
|
_handleMessage(msg) {
|
|
2779
2785
|
const type = msg["type"];
|
|
2780
2786
|
switch (type) {
|
|
2781
|
-
case "response.
|
|
2787
|
+
case "response.output_audio.delta": {
|
|
2782
2788
|
this._handleAudioDelta(msg);
|
|
2783
2789
|
break;
|
|
2784
2790
|
}
|
|
2785
|
-
case "response.
|
|
2791
|
+
case "response.output_audio.done": {
|
|
2786
2792
|
if (this._playback) {
|
|
2787
2793
|
this._playback.generating = false;
|
|
2788
2794
|
if (this._playback.audioRemainder.length > 0) {
|
|
@@ -2816,7 +2822,7 @@ var OpenAIRealtime = class {
|
|
|
2816
2822
|
}
|
|
2817
2823
|
break;
|
|
2818
2824
|
}
|
|
2819
|
-
case "response.
|
|
2825
|
+
case "response.output_audio_transcript.done": {
|
|
2820
2826
|
if (this._call) {
|
|
2821
2827
|
this._call._emit("transcript", "assistant", msg["transcript"] ?? "");
|
|
2822
2828
|
}
|