@posthog/ai 8.22.5 → 8.23.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 +10 -1
- package/dist/adk/index.cjs +1 -1
- package/dist/adk/index.mjs +1 -1
- package/dist/anthropic/index.cjs +1 -1
- package/dist/anthropic/index.mjs +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 +87 -24
- package/dist/evaluations/index.cjs.map +1 -1
- package/dist/evaluations/index.d.ts +39 -7
- package/dist/evaluations/index.mjs +87 -24
- package/dist/evaluations/index.mjs.map +1 -1
- package/dist/gemini/index.cjs +1 -1
- package/dist/gemini/index.mjs +1 -1
- package/dist/genkit/index.cjs +1 -1
- package/dist/genkit/index.mjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +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 +1 -1
- package/dist/openai/index.mjs +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/genkit/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let _posthog_core = require("@posthog/core");
|
|
3
3
|
let uuid = require("uuid");
|
|
4
4
|
//#region package.json
|
|
5
|
-
var version = "8.
|
|
5
|
+
var version = "8.23.1";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/captureAiEvent.ts
|
|
8
8
|
/** @internal */
|
package/dist/genkit/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { acceptsEventOptions, eventOptionsAsLegacyProperties, toJsonSafeValue, uuidv7 } from "@posthog/core";
|
|
2
2
|
import { v4 } from "uuid";
|
|
3
3
|
//#region package.json
|
|
4
|
-
var version = "8.
|
|
4
|
+
var version = "8.23.1";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/captureAiEvent.ts
|
|
7
7
|
/** @internal */
|
package/dist/index.cjs
CHANGED
|
@@ -604,7 +604,7 @@ function sanitizeValues(obj) {
|
|
|
604
604
|
}
|
|
605
605
|
//#endregion
|
|
606
606
|
//#region package.json
|
|
607
|
-
var version = "8.
|
|
607
|
+
var version = "8.23.1";
|
|
608
608
|
//#endregion
|
|
609
609
|
//#region src/serializeError.ts
|
|
610
610
|
const DEFAULT_MAX_DEPTH = 3;
|
|
@@ -1836,7 +1836,7 @@ var Prompts = class {
|
|
|
1836
1836
|
if (pages >= MAX_PROMPT_LIST_PAGES) throw new Error(`[PostHog Prompts] ${reference} spans more than ${MAX_PROMPT_LIST_PAGES} pages. Refusing to return an incomplete result.`);
|
|
1837
1837
|
const { response, data } = await fetchJsonWithTimeout(url, this.personalApiKey, reference);
|
|
1838
1838
|
if (!response.ok) {
|
|
1839
|
-
if (response.status === 403) throw new Error(`[PostHog Prompts] Access denied for ${reference}. Check that
|
|
1839
|
+
if (response.status === 403) throw new Error(`[PostHog Prompts] Access denied for ${reference}. Check that the key in personalApiKey has the llm_prompt:read scope and the LLM prompts feature is enabled.`);
|
|
1840
1840
|
throw new PromptFetchError(`[PostHog Prompts] Failed to fetch ${reference}: HTTP ${response.status}`, response.status === 429 ? parseRetryAfterSeconds(response.headers?.get("Retry-After")) : void 0);
|
|
1841
1841
|
}
|
|
1842
1842
|
if (typeof data !== "object" || data === null || !Array.isArray(data.results)) throw new Error(`[PostHog Prompts] Invalid response format for ${reference}`);
|
|
@@ -1858,7 +1858,7 @@ var Prompts = class {
|
|
|
1858
1858
|
const { response, data } = await fetchJsonWithTimeout(`${this.host}/api/environments/@current/llm_prompts/name/${encodedPromptName}/?token=${encodedProjectApiKey}${versionQuery}${labelQuery}`, this.personalApiKey, `prompt ${promptReference}`);
|
|
1859
1859
|
if (!response.ok) {
|
|
1860
1860
|
if (response.status === 404) throw new Error(`[PostHog Prompts] Prompt ${promptReference} not found`);
|
|
1861
|
-
if (response.status === 403) throw new Error(`[PostHog Prompts] Access denied for prompt ${promptReference}. Check that
|
|
1861
|
+
if (response.status === 403) throw new Error(`[PostHog Prompts] Access denied for prompt ${promptReference}. Check that the key in personalApiKey has the llm_prompt:read scope and the LLM prompts feature is enabled.`);
|
|
1862
1862
|
throw new PromptFetchError(`[PostHog Prompts] Failed to fetch prompt ${promptReference}: HTTP ${response.status}`, response.status === 429 ? parseRetryAfterSeconds(response.headers?.get("Retry-After")) : void 0);
|
|
1863
1863
|
}
|
|
1864
1864
|
if (!isPromptApiResponse(data)) throw new Error(`[PostHog Prompts] Invalid response format for prompt ${promptReference}`);
|