@contentgrowth/llm-service 1.0.3 → 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
@@ -554,11 +554,13 @@ var GeminiProvider = class extends BaseLLMProvider {
554
554
  return { text: response.content };
555
555
  }
556
556
  async chatCompletion(messages, systemPrompt, tools = null, options = {}) {
557
+ const tier = options.tier || "default";
558
+ const modelName = this.models[tier] || this.defaultModel;
557
559
  return this._chatCompletionWithModel(
558
560
  messages,
559
561
  systemPrompt,
560
562
  tools,
561
- this.defaultModel,
563
+ modelName,
562
564
  this.config.maxTokens,
563
565
  this.config.temperature,
564
566
  options
@@ -1495,9 +1497,17 @@ var TranscriptionService = class {
1495
1497
  const apiEndpoint = location === "global" ? "https://speech.googleapis.com" : `https://${location}-speech.googleapis.com`;
1496
1498
  const url = `${apiEndpoint}/v2/${recognizer}:recognize`;
1497
1499
  const languageCodes = language ? [language] : ["en-US"];
1500
+ let decodingConfig = { autoDecodingConfig: {} };
1501
+ if (audioFile.type && audioFile.type.includes("webm")) {
1502
+ decodingConfig = {
1503
+ explicitDecodingConfig: {
1504
+ encoding: "WEBM_OPUS"
1505
+ }
1506
+ };
1507
+ }
1498
1508
  const body = {
1499
1509
  config: {
1500
- autoDecodingConfig: {},
1510
+ ...decodingConfig,
1501
1511
  languageCodes,
1502
1512
  // Sanitize model: Strict allowlist for Google v2 models
1503
1513
  model: model || "chirp_3"