@posthog/ai 8.9.2 → 8.10.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/adk/index.cjs +1267 -0
- package/dist/adk/index.cjs.map +1 -0
- package/dist/adk/index.d.ts +149 -0
- package/dist/adk/index.mjs +1265 -0
- package/dist/adk/index.mjs.map +1 -0
- package/dist/anthropic/index.cjs +9 -2
- package/dist/anthropic/index.cjs.map +1 -1
- package/dist/anthropic/index.mjs +9 -2
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/gemini/index.cjs +51 -51
- package/dist/gemini/index.cjs.map +1 -1
- package/dist/gemini/index.mjs +51 -51
- package/dist/gemini/index.mjs.map +1 -1
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +9 -2
- package/dist/index.mjs.map +1 -1
- package/dist/langchain/index.cjs +6 -2
- package/dist/langchain/index.cjs.map +1 -1
- package/dist/langchain/index.mjs +6 -2
- package/dist/langchain/index.mjs.map +1 -1
- package/dist/langchain/middleware/index.cjs +6 -2
- package/dist/langchain/middleware/index.cjs.map +1 -1
- package/dist/langchain/middleware/index.mjs +6 -2
- package/dist/langchain/middleware/index.mjs.map +1 -1
- package/dist/openai/index.cjs +9 -2
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.mjs +9 -2
- package/dist/openai/index.mjs.map +1 -1
- package/dist/openai-agents/index.cjs +1 -1
- package/dist/openai-agents/index.cjs.map +1 -1
- package/dist/openai-agents/index.mjs +1 -1
- package/dist/openai-agents/index.mjs.map +1 -1
- package/dist/vercel/index.cjs +9 -2
- package/dist/vercel/index.cjs.map +1 -1
- package/dist/vercel/index.mjs +9 -2
- package/dist/vercel/index.mjs.map +1 -1
- package/package.json +13 -3
package/dist/openai/index.cjs
CHANGED
|
@@ -581,7 +581,7 @@ function formatOpenAIResponsesInput(input, instructions) {
|
|
|
581
581
|
return messages;
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
-
var version = "8.
|
|
584
|
+
var version = "8.10.0";
|
|
585
585
|
|
|
586
586
|
const DEFAULT_MAX_DEPTH = 3;
|
|
587
587
|
const MAX_STACK_LINES = 20;
|
|
@@ -811,7 +811,9 @@ const captureAiGeneration$1 = async (client, options) => {
|
|
|
811
811
|
$ai_time_to_first_token: options.timeToFirstToken
|
|
812
812
|
} : {}),
|
|
813
813
|
$ai_trace_id: traceId,
|
|
814
|
-
|
|
814
|
+
...(options.baseURL === null ? {} : {
|
|
815
|
+
$ai_base_url: options.baseURL ?? ''
|
|
816
|
+
}),
|
|
815
817
|
...options.properties,
|
|
816
818
|
$ai_tokens_source: getTokensSource(options.properties),
|
|
817
819
|
...(options.distinctId ? {} : {
|
|
@@ -845,6 +847,11 @@ const captureAiGeneration$1 = async (client, options) => {
|
|
|
845
847
|
}
|
|
846
848
|
} catch (error) {
|
|
847
849
|
// Telemetry failures must never affect the instrumented provider call.
|
|
850
|
+
try {
|
|
851
|
+
options.onError?.(error);
|
|
852
|
+
} catch {
|
|
853
|
+
// Error reporting must not affect the instrumented provider call either.
|
|
854
|
+
}
|
|
848
855
|
console.warn('[PostHog AI] Failed to capture generation telemetry:', error);
|
|
849
856
|
}
|
|
850
857
|
};
|