@posthog/ai 8.10.0 → 8.10.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 +908 -1198
- package/dist/adk/index.cjs.map +1 -1
- package/dist/adk/index.d.ts +109 -109
- package/dist/adk/index.mjs +907 -1196
- package/dist/adk/index.mjs.map +1 -1
- package/dist/anthropic/index.cjs +927 -1111
- package/dist/anthropic/index.cjs.map +1 -1
- package/dist/anthropic/index.d.ts +34 -33
- package/dist/anthropic/index.mjs +899 -1102
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/gemini/index.cjs +863 -1108
- package/dist/gemini/index.cjs.map +1 -1
- package/dist/gemini/index.d.ts +38 -35
- package/dist/gemini/index.mjs +858 -1103
- package/dist/gemini/index.mjs.map +1 -1
- package/dist/index.cjs +1218 -1546
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +170 -163
- package/dist/index.mjs +1216 -1544
- package/dist/index.mjs.map +1 -1
- package/dist/langchain/index.cjs +851 -1029
- package/dist/langchain/index.cjs.map +1 -1
- package/dist/langchain/index.d.ts +75 -75
- package/dist/langchain/index.mjs +850 -1027
- package/dist/langchain/index.mjs.map +1 -1
- package/dist/langchain/middleware/index.cjs +1016 -1225
- package/dist/langchain/middleware/index.cjs.map +1 -1
- package/dist/langchain/middleware/index.d.ts +29 -25
- package/dist/langchain/middleware/index.mjs +1015 -1223
- package/dist/langchain/middleware/index.mjs.map +1 -1
- package/dist/openai/index.cjs +1990 -2523
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.d.ts +106 -104
- package/dist/openai/index.mjs +1985 -2518
- package/dist/openai/index.mjs.map +1 -1
- package/dist/openai-agents/index.cjs +745 -827
- package/dist/openai-agents/index.cjs.map +1 -1
- package/dist/openai-agents/index.d.ts +48 -47
- package/dist/openai-agents/index.mjs +744 -825
- package/dist/openai-agents/index.mjs.map +1 -1
- package/dist/otel/index.cjs +427 -486
- package/dist/otel/index.cjs.map +1 -1
- package/dist/otel/index.d.ts +36 -35
- package/dist/otel/index.mjs +426 -484
- package/dist/otel/index.mjs.map +1 -1
- package/dist/vercel/index.cjs +992 -1343
- package/dist/vercel/index.cjs.map +1 -1
- package/dist/vercel/index.d.ts +21 -16
- package/dist/vercel/index.mjs +991 -1341
- package/dist/vercel/index.mjs.map +1 -1
- package/package.json +15 -14
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import "@langchain/core/messages";
|
|
2
|
+
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
|
|
5
|
+
import { PostHog } from "posthog-node";
|
|
6
|
+
import "@langchain/core/load/serializable";
|
|
7
|
+
import "@langchain/core/outputs";
|
|
8
|
+
import "@langchain/core/agents";
|
|
9
|
+
import "@langchain/core/documents";
|
|
10
|
+
//#region src/langchain/callbacks.d.ts
|
|
8
11
|
interface LangChainCallbackHandlerOptions {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
client: PostHog;
|
|
13
|
+
distinctId?: string | number;
|
|
14
|
+
traceId?: string | number;
|
|
15
|
+
properties?: Record<string, any>;
|
|
16
|
+
privacyMode?: boolean;
|
|
17
|
+
groups?: Record<string, any>;
|
|
18
|
+
debug?: boolean;
|
|
16
19
|
}
|
|
17
|
-
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/langchain/middleware/index.d.ts
|
|
18
22
|
/** Options shared with the LangChain callback integration. */
|
|
19
23
|
type PostHogLangChainMiddlewareOptions = LangChainCallbackHandlerOptions & {
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
/** The custom Zod state schema supplied to `createAgent`, included in captured trace state. */
|
|
25
|
+
stateSchema?: InteropZodObject;
|
|
22
26
|
};
|
|
23
27
|
/**
|
|
24
28
|
* Creates PostHog AI observability middleware for LangChain v1 agents.
|
|
@@ -29,11 +33,11 @@ type PostHogLangChainMiddlewareOptions = LangChainCallbackHandlerOptions & {
|
|
|
29
33
|
* LangChain only invokes `afterAgent` for completed runs. A terminal agent
|
|
30
34
|
* failure still captures the failed model or tool call, but not a root trace.
|
|
31
35
|
*/
|
|
32
|
-
declare const createPostHogMiddleware: (options: PostHogLangChainMiddlewareOptions) => langchain.AgentMiddleware<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, z.core.$strip>, undefined, unknown, readonly (
|
|
37
|
-
|
|
38
|
-
export { createPostHogMiddleware };
|
|
39
|
-
|
|
36
|
+
declare const createPostHogMiddleware: (options: PostHogLangChainMiddlewareOptions) => import("langchain").AgentMiddleware<import("@langchain/core/utils/types").ZodV3ObjectLike | import("@langchain/core/utils/types").ZodV4ObjectLike | z.ZodObject<{
|
|
37
|
+
_posthogRunId: z.ZodOptional<z.ZodString>;
|
|
38
|
+
_posthogStartTime: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
_posthogInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
40
|
+
}, z.core.$strip>, undefined, unknown, readonly (import("@langchain/core/tools").ClientTool | import("@langchain/core/tools").ServerTool)[], readonly []>;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { PostHogLangChainMiddlewareOptions, createPostHogMiddleware };
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|