@posthog/ai 6.4.4 → 6.5.0

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.
@@ -6,7 +6,7 @@ var AnthropicOriginal = require('@anthropic-ai/sdk');
6
6
  var buffer = require('buffer');
7
7
  var uuid = require('uuid');
8
8
 
9
- var version = "6.4.4";
9
+ var version = "6.5.0";
10
10
 
11
11
  // Type guards for safer type checking
12
12
 
@@ -2,7 +2,7 @@ import AnthropicOriginal from '@anthropic-ai/sdk';
2
2
  import { Buffer } from 'buffer';
3
3
  import { v4 } from 'uuid';
4
4
 
5
- var version = "6.4.4";
5
+ var version = "6.5.0";
6
6
 
7
7
  // Type guards for safer type checking
8
8
 
@@ -6,7 +6,7 @@ var genai = require('@google/genai');
6
6
  var buffer = require('buffer');
7
7
  var uuid = require('uuid');
8
8
 
9
- var version = "6.4.4";
9
+ var version = "6.5.0";
10
10
 
11
11
  // Type guards for safer type checking
12
12
 
@@ -2,7 +2,7 @@ import { GoogleGenAI } from '@google/genai';
2
2
  import { Buffer } from 'buffer';
3
3
  import { v4 } from 'uuid';
4
4
 
5
- var version = "6.4.4";
5
+ var version = "6.5.0";
6
6
 
7
7
  // Type guards for safer type checking
8
8
 
package/dist/index.cjs CHANGED
@@ -26,7 +26,7 @@ function _interopNamespaceDefault(e) {
26
26
 
27
27
  var uuid__namespace = /*#__PURE__*/_interopNamespaceDefault(uuid);
28
28
 
29
- var version = "6.4.4";
29
+ var version = "6.5.0";
30
30
 
31
31
  // Type guards for safer type checking
32
32
  const isString = value => {
@@ -1838,7 +1838,11 @@ const createInstrumentationMiddleware = (phClient, model, options) => {
1838
1838
  const startTime = Date.now();
1839
1839
  const mergedParams = {
1840
1840
  ...options,
1841
- ...mapVercelParams(params)
1841
+ ...mapVercelParams(params),
1842
+ posthogProperties: {
1843
+ ...options.posthogProperties,
1844
+ $ai_framework: 'vercel'
1845
+ }
1842
1846
  };
1843
1847
  const availableTools = extractAvailableToolCalls('vercel', params);
1844
1848
  try {
@@ -1914,7 +1918,11 @@ const createInstrumentationMiddleware = (phClient, model, options) => {
1914
1918
  let usage = {};
1915
1919
  const mergedParams = {
1916
1920
  ...options,
1917
- ...mapVercelParams(params)
1921
+ ...mapVercelParams(params),
1922
+ posthogProperties: {
1923
+ ...options.posthogProperties,
1924
+ $ai_framework: 'vercel'
1925
+ }
1918
1926
  };
1919
1927
  const modelId = options.posthogModelOverride ?? model.modelId;
1920
1928
  const provider = options.posthogProviderOverride ?? extractProvider(model);
@@ -3348,7 +3356,8 @@ class LangChainCallbackHandler extends BaseCallbackHandler {
3348
3356
  $ai_input_state: withPrivacyMode(this.client, this.privacyMode, run.input),
3349
3357
  $ai_latency: latency,
3350
3358
  $ai_span_name: run.name,
3351
- $ai_span_id: runId
3359
+ $ai_span_id: runId,
3360
+ $ai_framework: 'langchain'
3352
3361
  };
3353
3362
  if (parentRunId) {
3354
3363
  eventProperties['$ai_parent_id'] = parentRunId;
@@ -3396,7 +3405,8 @@ class LangChainCallbackHandler extends BaseCallbackHandler {
3396
3405
  $ai_input: withPrivacyMode(this.client, this.privacyMode, run.input),
3397
3406
  $ai_http_status: 200,
3398
3407
  $ai_latency: latency,
3399
- $ai_base_url: run.baseUrl
3408
+ $ai_base_url: run.baseUrl,
3409
+ $ai_framework: 'langchain'
3400
3410
  };
3401
3411
  if (run.tools) {
3402
3412
  eventProperties['$ai_tools'] = run.tools;