@contentgrowth/llm-service 0.7.7 → 0.7.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentgrowth/llm-service",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "Unified LLM Service for Content Growth",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -16,11 +16,11 @@ export const MODEL_CONFIGS = {
16
16
  free: 'gpt-4o-mini',
17
17
  },
18
18
  gemini: {
19
- default: 'gemini-2.5-flash',
20
- edge: 'gemini-2.5-pro',
21
- fast: 'gemini-2.5-flash-lite',
22
- cost: 'gemini-2.5-flash-lite',
23
- free: 'gemini-2.0-flash-lite',
19
+ default: 'gemini-3-flash-preview', // 'gemini-2.5-flash',
20
+ edge: 'gemini-3-pro-preview', // 'gemini-2.5-pro',
21
+ fast: 'gemini-3-flash-preview', // 'gemini-2.5-flash-lite',
22
+ cost: 'gemini-3-flash-preview', // 'gemini-2.5-flash-lite',
23
+ free: 'gemini-3-flash-preview', // 'gemini-2.0-flash-lite',
24
24
  video: 'veo',
25
25
  },
26
26
  };
@@ -113,12 +113,24 @@ export class GeminiProvider extends BaseLLMProvider {
113
113
  break;
114
114
  case 'assistant':
115
115
  role = 'model';
116
+ parts = [];
117
+
118
+ // Always include text if present (Thought)
119
+ if (msg.content) {
120
+ parts.push({ text: msg.content });
121
+ }
122
+
123
+ // Append tool calls if present (Call)
116
124
  if (msg.tool_calls) {
117
- parts = msg.tool_calls.map(tc => ({
125
+ const callParts = msg.tool_calls.map(tc => ({
118
126
  functionCall: { name: tc.function.name, args: tc.function.arguments }
119
127
  }));
120
- } else {
121
- parts = [{ text: msg.content || '' }];
128
+ parts.push(...callParts);
129
+ }
130
+
131
+ // Safety fallback: if nothing was added, ensure valid structure
132
+ if (parts.length === 0) {
133
+ parts.push({ text: '' });
122
134
  }
123
135
  break;
124
136
  case 'tool':