modality-ai 0.7.2 → 0.7.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
@@ -126898,6 +126898,12 @@ ${contentString}
126898
126898
  }
126899
126899
  }
126900
126900
 
126901
+ // src/const.ts
126902
+ var GeminiDefaultModels = [
126903
+ "gemini-3.1-flash-lite",
126904
+ "gemini-3.1-flash-lite-preview"
126905
+ ];
126906
+
126901
126907
  // src/util_ai_model.ts
126902
126908
  var evictKey = [];
126903
126909
  function getRandomApiKey(baseKeyName, keyCount) {
@@ -126965,18 +126971,13 @@ class OllamaProvider {
126965
126971
  toolCalls: result.toolCalls,
126966
126972
  toolResults: result.toolResults,
126967
126973
  steps: result.steps,
126968
- messageId: result.response?.id || undefined
126974
+ messageId: result.finalStep?.response?.id || undefined
126969
126975
  };
126970
126976
  } catch (error53) {
126971
126977
  throw new Error(`Failed to generate chat response with Ollama: ${error53 instanceof Error ? error53.message : "Unknown error"}`);
126972
126978
  }
126973
126979
  }
126974
126980
  }
126975
- var GeminiDefaultModels = [
126976
- "gemini-2.5-flash",
126977
- "gemini-2.5-flash-lite",
126978
- "gemini-flash-latest"
126979
- ];
126980
126981
 
126981
126982
  class GeminiProvider {
126982
126983
  config;
@@ -127036,7 +127037,7 @@ class GeminiProvider {
127036
127037
  toolCalls: result.toolCalls,
127037
127038
  toolResults: result.toolResults,
127038
127039
  steps: result.steps,
127039
- messageId: result.response?.id || undefined
127040
+ messageId: result.finalStep?.response?.id || undefined
127040
127041
  };
127041
127042
  } catch (error53) {
127042
127043
  throw new Error(`Failed to generate chat response with Gemini: ${error53 instanceof Error ? error53.message : "Unknown error"}`);
@@ -127086,7 +127087,7 @@ class VsCodeProvider {
127086
127087
  toolCalls: result.toolCalls,
127087
127088
  toolResults: result.toolResults,
127088
127089
  steps: result.steps,
127089
- messageId: result.response?.id || undefined
127090
+ messageId: result.finalStep?.response?.id || undefined
127090
127091
  };
127091
127092
  } catch (error53) {
127092
127093
  throw new Error(`Failed to generate chat response with VS Code: ${error53 instanceof Error ? error53.message : "Unknown error"}`);
@@ -127210,7 +127211,7 @@ async function callGenerateText({
127210
127211
  const { system, contentMessages } = extractSystemMessage(messages);
127211
127212
  const result = await generateText({
127212
127213
  model,
127213
- system,
127214
+ instructions: system,
127214
127215
  messages: contentMessages,
127215
127216
  temperature: options?.temperature,
127216
127217
  maxOutputTokens: options?.maxOutputTokens,
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Shared Constants
3
+ */
4
+ export declare const GeminiDefaultModels: string[];
@@ -63,6 +63,9 @@ export declare class OllamaProvider implements AIProviderInterface {
63
63
  */
64
64
  chat(messages: ModelMessage[], options?: ChatOptions): Promise<ChatResponse>;
65
65
  }
66
+ /**
67
+ * Gemini AI Provider Implementation
68
+ */
66
69
  export declare class GeminiProvider implements AIProviderInterface {
67
70
  private config;
68
71
  private model;
@@ -148,7 +151,7 @@ export declare function mergeToolCallsAndResults(response: any): {
148
151
  result: any;
149
152
  }[];
150
153
  /**
151
- * AI SDK v7 standard: system instructions are a separate `system` parameter,
154
+ * AI SDK v7 standard: system instructions are a separate `instructions` parameter,
152
155
  * not embedded in the messages array. Google Gemini rejects system messages in `contents`.
153
156
  */
154
157
  export declare function extractSystemMessage(messages: ModelMessage[]): {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.2",
2
+ "version": "0.7.4",
3
3
  "name": "modality-ai",
4
4
  "repository": {
5
5
  "type": "git",