@posthog/ai 8.16.3 → 8.17.1
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/README.md +8 -0
- package/dist/adk/index.cjs +1 -1
- package/dist/adk/index.mjs +1 -1
- package/dist/anthropic/index.cjs +16 -1
- package/dist/anthropic/index.cjs.map +1 -1
- package/dist/anthropic/index.mjs +16 -1
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/claude-agent-sdk/index.cjs +1 -1
- package/dist/claude-agent-sdk/index.mjs +1 -1
- package/dist/evaluations/index.cjs +2 -0
- package/dist/evaluations/index.cjs.map +1 -1
- package/dist/evaluations/index.d.ts +3 -0
- package/dist/evaluations/index.mjs +2 -0
- package/dist/evaluations/index.mjs.map +1 -1
- package/dist/gemini/index.cjs +1 -1
- package/dist/gemini/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/langchain/index.cjs +1 -1
- package/dist/langchain/index.mjs +1 -1
- package/dist/langchain/middleware/index.cjs +1 -1
- package/dist/langchain/middleware/index.mjs +1 -1
- package/dist/openai/index.cjs +41 -1
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.mjs +41 -1
- package/dist/openai/index.mjs.map +1 -1
- package/dist/openai-agents/index.cjs +1 -1
- package/dist/openai-agents/index.mjs +1 -1
- package/dist/vercel/index.cjs +1 -1
- package/dist/vercel/index.mjs +1 -1
- package/package.json +3 -3
package/dist/gemini/index.cjs
CHANGED
package/dist/gemini/index.mjs
CHANGED
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/langchain/index.cjs
CHANGED
package/dist/langchain/index.mjs
CHANGED
package/dist/openai/index.cjs
CHANGED
|
@@ -552,7 +552,7 @@ function formatOpenAIResponsesInput(input, instructions) {
|
|
|
552
552
|
}
|
|
553
553
|
//#endregion
|
|
554
554
|
//#region package.json
|
|
555
|
-
var version = "8.
|
|
555
|
+
var version = "8.17.1";
|
|
556
556
|
//#endregion
|
|
557
557
|
//#region src/serializeError.ts
|
|
558
558
|
const DEFAULT_MAX_DEPTH = 3;
|
|
@@ -1771,6 +1771,16 @@ var WrappedCompletions$1 = class extends openai.AzureOpenAI.Chat.Completions {
|
|
|
1771
1771
|
return stream2;
|
|
1772
1772
|
}
|
|
1773
1773
|
return value;
|
|
1774
|
+
}).catch(async (error) => {
|
|
1775
|
+
await captureAiGeneration(this.phClient, buildChatErrorOptions({
|
|
1776
|
+
client: this.phClient,
|
|
1777
|
+
provider: "azure",
|
|
1778
|
+
baseURL: this.baseURL,
|
|
1779
|
+
params: openAIParams,
|
|
1780
|
+
monitoring: posthogParams,
|
|
1781
|
+
modelParametersSource: body
|
|
1782
|
+
}, error, { latency: (Date.now() - startTime) / 1e3 }));
|
|
1783
|
+
throw error;
|
|
1774
1784
|
}));
|
|
1775
1785
|
else return preserveProviderPromise(parentPromise, parentPromise.then(async (result) => {
|
|
1776
1786
|
if ("choices" in result) await captureAiGenerationAfterSuccess(this.phClient, buildChatSuccessOptions({
|
|
@@ -1889,6 +1899,16 @@ var WrappedResponses$1 = class extends openai.AzureOpenAI.Responses {
|
|
|
1889
1899
|
return stream2;
|
|
1890
1900
|
}
|
|
1891
1901
|
return value;
|
|
1902
|
+
}).catch(async (error) => {
|
|
1903
|
+
await captureAiGeneration(this.phClient, buildResponsesErrorOptions({
|
|
1904
|
+
client: this.phClient,
|
|
1905
|
+
provider: "azure",
|
|
1906
|
+
baseURL: this.baseURL,
|
|
1907
|
+
params: openAIParams,
|
|
1908
|
+
monitoring: posthogParams,
|
|
1909
|
+
modelParametersSource: body
|
|
1910
|
+
}, error, { latency: (Date.now() - startTime) / 1e3 }));
|
|
1911
|
+
throw error;
|
|
1892
1912
|
}));
|
|
1893
1913
|
else return preserveProviderPromise(parentPromise, parentPromise.then(async (result) => {
|
|
1894
1914
|
if ("output" in result) {
|
|
@@ -2099,6 +2119,16 @@ var WrappedCompletions = class extends Completions {
|
|
|
2099
2119
|
return stream2;
|
|
2100
2120
|
}
|
|
2101
2121
|
return value;
|
|
2122
|
+
}).catch(async (error) => {
|
|
2123
|
+
await captureAiGeneration(this.phClient, buildChatErrorOptions({
|
|
2124
|
+
client: this.phClient,
|
|
2125
|
+
provider: "openai",
|
|
2126
|
+
baseURL: this.baseURL,
|
|
2127
|
+
params: openAIParams,
|
|
2128
|
+
monitoring: posthogParams,
|
|
2129
|
+
modelParametersSource: body
|
|
2130
|
+
}, error, { latency: (Date.now() - startTime) / 1e3 }));
|
|
2131
|
+
throw error;
|
|
2102
2132
|
}));
|
|
2103
2133
|
else return preserveProviderPromise(parentPromise, parentPromise.then(async (result) => {
|
|
2104
2134
|
if ("choices" in result) await captureAiGenerationAfterSuccess(this.phClient, buildChatSuccessOptions({
|
|
@@ -2217,6 +2247,16 @@ var WrappedResponses = class extends Responses {
|
|
|
2217
2247
|
return stream2;
|
|
2218
2248
|
}
|
|
2219
2249
|
return value;
|
|
2250
|
+
}).catch(async (error) => {
|
|
2251
|
+
await captureAiGeneration(this.phClient, buildResponsesErrorOptions({
|
|
2252
|
+
client: this.phClient,
|
|
2253
|
+
provider: "openai",
|
|
2254
|
+
baseURL: this.baseURL,
|
|
2255
|
+
params: openAIParams,
|
|
2256
|
+
monitoring: posthogParams,
|
|
2257
|
+
modelParametersSource: body
|
|
2258
|
+
}, error, { latency: (Date.now() - startTime) / 1e3 }));
|
|
2259
|
+
throw error;
|
|
2220
2260
|
}));
|
|
2221
2261
|
else return preserveProviderPromise(parentPromise, parentPromise.then(async (result) => {
|
|
2222
2262
|
if ("output" in result) {
|