@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.cjs CHANGED
@@ -602,11 +602,13 @@ var GeminiProvider = class extends BaseLLMProvider {
602
602
  return { text: response.content };
603
603
  }
604
604
  async chatCompletion(messages, systemPrompt, tools = null, options = {}) {
605
+ const tier = options.tier || "default";
606
+ const modelName = this.models[tier] || this.defaultModel;
605
607
  return this._chatCompletionWithModel(
606
608
  messages,
607
609
  systemPrompt,
608
610
  tools,
609
- this.defaultModel,
611
+ modelName,
610
612
  this.config.maxTokens,
611
613
  this.config.temperature,
612
614
  options
@@ -1543,9 +1545,17 @@ var TranscriptionService = class {
1543
1545
  const apiEndpoint = location === "global" ? "https://speech.googleapis.com" : `https://${location}-speech.googleapis.com`;
1544
1546
  const url = `${apiEndpoint}/v2/${recognizer}:recognize`;
1545
1547
  const languageCodes = language ? [language] : ["en-US"];
1548
+ let decodingConfig = { autoDecodingConfig: {} };
1549
+ if (audioFile.type && audioFile.type.includes("webm")) {
1550
+ decodingConfig = {
1551
+ explicitDecodingConfig: {
1552
+ encoding: "WEBM_OPUS"
1553
+ }
1554
+ };
1555
+ }
1546
1556
  const body = {
1547
1557
  config: {
1548
- autoDecodingConfig: {},
1558
+ ...decodingConfig,
1549
1559
  languageCodes,
1550
1560
  // Sanitize model: Strict allowlist for Google v2 models
1551
1561
  model: model || "chirp_3"