@posthog/ai 8.17.0 → 8.17.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/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/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/otel/index.cjs +16 -2
- package/dist/otel/index.cjs.map +1 -1
- package/dist/otel/index.d.ts +12 -3
- package/dist/otel/index.mjs +16 -2
- package/dist/otel/index.mjs.map +1 -1
- package/dist/vercel/index.cjs +1 -1
- package/dist/vercel/index.mjs +1 -1
- package/package.json +8 -3
package/dist/openai/index.mjs
CHANGED
|
@@ -548,7 +548,7 @@ function formatOpenAIResponsesInput(input, instructions) {
|
|
|
548
548
|
}
|
|
549
549
|
//#endregion
|
|
550
550
|
//#region package.json
|
|
551
|
-
var version = "8.17.
|
|
551
|
+
var version = "8.17.2";
|
|
552
552
|
//#endregion
|
|
553
553
|
//#region src/serializeError.ts
|
|
554
554
|
const DEFAULT_MAX_DEPTH = 3;
|
|
@@ -1767,6 +1767,16 @@ var WrappedCompletions$1 = class extends AzureOpenAI.Chat.Completions {
|
|
|
1767
1767
|
return stream2;
|
|
1768
1768
|
}
|
|
1769
1769
|
return value;
|
|
1770
|
+
}).catch(async (error) => {
|
|
1771
|
+
await captureAiGeneration(this.phClient, buildChatErrorOptions({
|
|
1772
|
+
client: this.phClient,
|
|
1773
|
+
provider: "azure",
|
|
1774
|
+
baseURL: this.baseURL,
|
|
1775
|
+
params: openAIParams,
|
|
1776
|
+
monitoring: posthogParams,
|
|
1777
|
+
modelParametersSource: body
|
|
1778
|
+
}, error, { latency: (Date.now() - startTime) / 1e3 }));
|
|
1779
|
+
throw error;
|
|
1770
1780
|
}));
|
|
1771
1781
|
else return preserveProviderPromise(parentPromise, parentPromise.then(async (result) => {
|
|
1772
1782
|
if ("choices" in result) await captureAiGenerationAfterSuccess(this.phClient, buildChatSuccessOptions({
|
|
@@ -1885,6 +1895,16 @@ var WrappedResponses$1 = class extends AzureOpenAI.Responses {
|
|
|
1885
1895
|
return stream2;
|
|
1886
1896
|
}
|
|
1887
1897
|
return value;
|
|
1898
|
+
}).catch(async (error) => {
|
|
1899
|
+
await captureAiGeneration(this.phClient, buildResponsesErrorOptions({
|
|
1900
|
+
client: this.phClient,
|
|
1901
|
+
provider: "azure",
|
|
1902
|
+
baseURL: this.baseURL,
|
|
1903
|
+
params: openAIParams,
|
|
1904
|
+
monitoring: posthogParams,
|
|
1905
|
+
modelParametersSource: body
|
|
1906
|
+
}, error, { latency: (Date.now() - startTime) / 1e3 }));
|
|
1907
|
+
throw error;
|
|
1888
1908
|
}));
|
|
1889
1909
|
else return preserveProviderPromise(parentPromise, parentPromise.then(async (result) => {
|
|
1890
1910
|
if ("output" in result) {
|
|
@@ -2095,6 +2115,16 @@ var WrappedCompletions = class extends Completions {
|
|
|
2095
2115
|
return stream2;
|
|
2096
2116
|
}
|
|
2097
2117
|
return value;
|
|
2118
|
+
}).catch(async (error) => {
|
|
2119
|
+
await captureAiGeneration(this.phClient, buildChatErrorOptions({
|
|
2120
|
+
client: this.phClient,
|
|
2121
|
+
provider: "openai",
|
|
2122
|
+
baseURL: this.baseURL,
|
|
2123
|
+
params: openAIParams,
|
|
2124
|
+
monitoring: posthogParams,
|
|
2125
|
+
modelParametersSource: body
|
|
2126
|
+
}, error, { latency: (Date.now() - startTime) / 1e3 }));
|
|
2127
|
+
throw error;
|
|
2098
2128
|
}));
|
|
2099
2129
|
else return preserveProviderPromise(parentPromise, parentPromise.then(async (result) => {
|
|
2100
2130
|
if ("choices" in result) await captureAiGenerationAfterSuccess(this.phClient, buildChatSuccessOptions({
|
|
@@ -2213,6 +2243,16 @@ var WrappedResponses = class extends Responses {
|
|
|
2213
2243
|
return stream2;
|
|
2214
2244
|
}
|
|
2215
2245
|
return value;
|
|
2246
|
+
}).catch(async (error) => {
|
|
2247
|
+
await captureAiGeneration(this.phClient, buildResponsesErrorOptions({
|
|
2248
|
+
client: this.phClient,
|
|
2249
|
+
provider: "openai",
|
|
2250
|
+
baseURL: this.baseURL,
|
|
2251
|
+
params: openAIParams,
|
|
2252
|
+
monitoring: posthogParams,
|
|
2253
|
+
modelParametersSource: body
|
|
2254
|
+
}, error, { latency: (Date.now() - startTime) / 1e3 }));
|
|
2255
|
+
throw error;
|
|
2216
2256
|
}));
|
|
2217
2257
|
else return preserveProviderPromise(parentPromise, parentPromise.then(async (result) => {
|
|
2218
2258
|
if ("output" in result) {
|