@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.
- package/dist/anthropic/index.cjs +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/gemini/index.cjs +1 -1
- package/dist/gemini/index.mjs +1 -1
- package/dist/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15 -5
- package/dist/index.mjs.map +1 -1
- package/dist/langchain/index.cjs +5 -3
- package/dist/langchain/index.cjs.map +1 -1
- package/dist/langchain/index.mjs +5 -3
- package/dist/langchain/index.mjs.map +1 -1
- package/dist/openai/index.cjs +1 -1
- package/dist/openai/index.mjs +1 -1
- package/dist/vercel/index.cjs +11 -3
- package/dist/vercel/index.cjs.map +1 -1
- package/dist/vercel/index.mjs +11 -3
- package/dist/vercel/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { wrapLanguageModel } from 'ai';
|
|
|
6
6
|
import AnthropicOriginal from '@anthropic-ai/sdk';
|
|
7
7
|
import { GoogleGenAI } from '@google/genai';
|
|
8
8
|
|
|
9
|
-
var version = "6.
|
|
9
|
+
var version = "6.5.0";
|
|
10
10
|
|
|
11
11
|
// Type guards for safer type checking
|
|
12
12
|
const isString = value => {
|
|
@@ -1818,7 +1818,11 @@ const createInstrumentationMiddleware = (phClient, model, options) => {
|
|
|
1818
1818
|
const startTime = Date.now();
|
|
1819
1819
|
const mergedParams = {
|
|
1820
1820
|
...options,
|
|
1821
|
-
...mapVercelParams(params)
|
|
1821
|
+
...mapVercelParams(params),
|
|
1822
|
+
posthogProperties: {
|
|
1823
|
+
...options.posthogProperties,
|
|
1824
|
+
$ai_framework: 'vercel'
|
|
1825
|
+
}
|
|
1822
1826
|
};
|
|
1823
1827
|
const availableTools = extractAvailableToolCalls('vercel', params);
|
|
1824
1828
|
try {
|
|
@@ -1894,7 +1898,11 @@ const createInstrumentationMiddleware = (phClient, model, options) => {
|
|
|
1894
1898
|
let usage = {};
|
|
1895
1899
|
const mergedParams = {
|
|
1896
1900
|
...options,
|
|
1897
|
-
...mapVercelParams(params)
|
|
1901
|
+
...mapVercelParams(params),
|
|
1902
|
+
posthogProperties: {
|
|
1903
|
+
...options.posthogProperties,
|
|
1904
|
+
$ai_framework: 'vercel'
|
|
1905
|
+
}
|
|
1898
1906
|
};
|
|
1899
1907
|
const modelId = options.posthogModelOverride ?? model.modelId;
|
|
1900
1908
|
const provider = options.posthogProviderOverride ?? extractProvider(model);
|
|
@@ -3328,7 +3336,8 @@ class LangChainCallbackHandler extends BaseCallbackHandler {
|
|
|
3328
3336
|
$ai_input_state: withPrivacyMode(this.client, this.privacyMode, run.input),
|
|
3329
3337
|
$ai_latency: latency,
|
|
3330
3338
|
$ai_span_name: run.name,
|
|
3331
|
-
$ai_span_id: runId
|
|
3339
|
+
$ai_span_id: runId,
|
|
3340
|
+
$ai_framework: 'langchain'
|
|
3332
3341
|
};
|
|
3333
3342
|
if (parentRunId) {
|
|
3334
3343
|
eventProperties['$ai_parent_id'] = parentRunId;
|
|
@@ -3376,7 +3385,8 @@ class LangChainCallbackHandler extends BaseCallbackHandler {
|
|
|
3376
3385
|
$ai_input: withPrivacyMode(this.client, this.privacyMode, run.input),
|
|
3377
3386
|
$ai_http_status: 200,
|
|
3378
3387
|
$ai_latency: latency,
|
|
3379
|
-
$ai_base_url: run.baseUrl
|
|
3388
|
+
$ai_base_url: run.baseUrl,
|
|
3389
|
+
$ai_framework: 'langchain'
|
|
3380
3390
|
};
|
|
3381
3391
|
if (run.tools) {
|
|
3382
3392
|
eventProperties['$ai_tools'] = run.tools;
|