@teamlearners/clawops 0.11.0 → 0.13.0

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.
@@ -759,6 +759,10 @@ interface GeminiRealtimeOptions {
759
759
  language?: string;
760
760
  /** Send initial greeting. Default: true */
761
761
  greeting?: boolean;
762
+ /** Gemini VAD config. @google/genai RealtimeInputConfig 구조 그대로 전달. */
763
+ realtimeInputConfig?: Record<string, unknown>;
764
+ /** Input audio transcription config. @google/genai AudioTranscriptionConfig 구조 그대로 전달. */
765
+ inputAudioTranscription?: Record<string, unknown>;
762
766
  }
763
767
  declare class GeminiRealtime implements Session {
764
768
  private _apiKey;
@@ -767,6 +771,8 @@ declare class GeminiRealtime implements Session {
767
771
  private _voice;
768
772
  private _language;
769
773
  private _greeting;
774
+ private _realtimeInputConfig;
775
+ private _inputAudioTranscription;
770
776
  private _session;
771
777
  private _call;
772
778
  private _tools;
@@ -759,6 +759,10 @@ interface GeminiRealtimeOptions {
759
759
  language?: string;
760
760
  /** Send initial greeting. Default: true */
761
761
  greeting?: boolean;
762
+ /** Gemini VAD config. @google/genai RealtimeInputConfig 구조 그대로 전달. */
763
+ realtimeInputConfig?: Record<string, unknown>;
764
+ /** Input audio transcription config. @google/genai AudioTranscriptionConfig 구조 그대로 전달. */
765
+ inputAudioTranscription?: Record<string, unknown>;
762
766
  }
763
767
  declare class GeminiRealtime implements Session {
764
768
  private _apiKey;
@@ -767,6 +771,8 @@ declare class GeminiRealtime implements Session {
767
771
  private _voice;
768
772
  private _language;
769
773
  private _greeting;
774
+ private _realtimeInputConfig;
775
+ private _inputAudioTranscription;
770
776
  private _session;
771
777
  private _call;
772
778
  private _tools;
@@ -1,4 +1,4 @@
1
- import { DEFAULT_BASE_URL, AgentError, AgentConnectionError, VERSION } from '../chunk-5IY2ZR3F.js';
1
+ import { DEFAULT_BASE_URL, AgentError, AgentConnectionError, VERSION } from '../chunk-WH65DGWI.js';
2
2
  import pino from 'pino';
3
3
  import * as fs from 'fs';
4
4
  import * as path from 'path';
@@ -2986,6 +2986,8 @@ var GeminiRealtime = class _GeminiRealtime {
2986
2986
  _voice;
2987
2987
  _language;
2988
2988
  _greeting;
2989
+ _realtimeInputConfig;
2990
+ _inputAudioTranscription;
2989
2991
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2990
2992
  _session = null;
2991
2993
  _call = null;
@@ -3007,6 +3009,8 @@ var GeminiRealtime = class _GeminiRealtime {
3007
3009
  this._voice = options.voice ?? "Kore";
3008
3010
  this._language = options.language ?? "ko";
3009
3011
  this._greeting = options.greeting ?? true;
3012
+ this._realtimeInputConfig = options.realtimeInputConfig ?? null;
3013
+ this._inputAudioTranscription = options.inputAudioTranscription ?? {};
3010
3014
  }
3011
3015
  /** Inject per-call ToolRegistry. */
3012
3016
  setToolRegistry(registry) {
@@ -3047,11 +3051,8 @@ var GeminiRealtime = class _GeminiRealtime {
3047
3051
  this._closed = false;
3048
3052
  this._sentAudioChunks = 0;
3049
3053
  this._audioRemainder = Buffer.alloc(0);
3050
- if (!this._apiKey) {
3051
- throw new Error("Google API key is required. Set GOOGLE_API_KEY or pass apiKey option.");
3052
- }
3053
3054
  const { GoogleGenAI } = await import('@google/genai/node');
3054
- const client = new GoogleGenAI({ apiKey: this._apiKey });
3055
+ const client = this._apiKey ? new GoogleGenAI({ apiKey: this._apiKey }) : new GoogleGenAI({});
3055
3056
  const config = {
3056
3057
  responseModalities: ["AUDIO"],
3057
3058
  speechConfig: {
@@ -3061,9 +3062,12 @@ var GeminiRealtime = class _GeminiRealtime {
3061
3062
  }
3062
3063
  }
3063
3064
  },
3064
- inputAudioTranscription: {},
3065
+ inputAudioTranscription: this._inputAudioTranscription,
3065
3066
  outputAudioTranscription: {}
3066
3067
  };
3068
+ if (this._realtimeInputConfig) {
3069
+ config["realtimeInputConfig"] = this._realtimeInputConfig;
3070
+ }
3067
3071
  if (this._systemPrompt) {
3068
3072
  config["systemInstruction"] = {
3069
3073
  parts: [{ text: this._systemPrompt }]
@@ -3073,6 +3077,7 @@ var GeminiRealtime = class _GeminiRealtime {
3073
3077
  if (toolSchemas.length > 0) {
3074
3078
  config["tools"] = [{ functionDeclarations: toolSchemas }];
3075
3079
  }
3080
+ this._log.debug({ config }, "Gemini SDK final config");
3076
3081
  this._session = await client.live.connect({
3077
3082
  model: this._model,
3078
3083
  config,
@@ -3818,9 +3823,8 @@ var GeminiLLM = class {
3818
3823
  }
3819
3824
  async *generate(messages, options) {
3820
3825
  const { GoogleGenAI } = await import('@google/genai');
3821
- const client = new GoogleGenAI({
3822
- apiKey: this._options.apiKey ?? process.env["GOOGLE_API_KEY"]
3823
- });
3826
+ const apiKey = this._options.apiKey ?? process.env["GOOGLE_API_KEY"];
3827
+ const client = apiKey ? new GoogleGenAI({ apiKey }) : new GoogleGenAI();
3824
3828
  let systemInstruction;
3825
3829
  const contents = [];
3826
3830
  for (const msg of messages) {