@posthog/ai 7.16.1 → 7.16.2

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.mjs CHANGED
@@ -5,7 +5,7 @@ import { uuidv7 } from '@posthog/core';
5
5
  import AnthropicOriginal from '@anthropic-ai/sdk';
6
6
  import { GoogleGenAI } from '@google/genai';
7
7
 
8
- var version = "7.16.1";
8
+ var version = "7.16.2";
9
9
 
10
10
  // Type guards for safer type checking
11
11
  const isString = value => {
@@ -2189,12 +2189,14 @@ const mapVercelOutput = result => {
2189
2189
  };
2190
2190
  }
2191
2191
  if (item.type === 'tool-call') {
2192
+ const toolCall = item;
2193
+ const rawArgs = toolCall.input ?? toolCall.args ?? toolCall.arguments ?? {};
2192
2194
  return {
2193
2195
  type: 'tool-call',
2194
2196
  id: item.toolCallId,
2195
2197
  function: {
2196
2198
  name: item.toolName,
2197
- arguments: item.args || JSON.stringify(item.arguments || {})
2199
+ arguments: typeof rawArgs === 'string' ? rawArgs : JSON.stringify(rawArgs)
2198
2200
  }
2199
2201
  };
2200
2202
  }