@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.
@@ -651,7 +651,7 @@ function addDefaults(params) {
651
651
  }
652
652
  //#endregion
653
653
  //#region package.json
654
- var version = "8.22.5";
654
+ var version = "8.23.1";
655
655
  //#endregion
656
656
  //#region src/serializeError.ts
657
657
  const DEFAULT_MAX_DEPTH = 3;
@@ -647,7 +647,7 @@ function addDefaults(params) {
647
647
  }
648
648
  //#endregion
649
649
  //#region package.json
650
- var version = "8.22.5";
650
+ var version = "8.23.1";
651
651
  //#endregion
652
652
  //#region src/serializeError.ts
653
653
  const DEFAULT_MAX_DEPTH = 3;
@@ -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.22.5";
5
+ var version = "8.23.1";
6
6
  //#endregion
7
7
  //#region src/captureAiEvent.ts
8
8
  /** @internal */
@@ -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.22.5";
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.22.5";
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 your personalApiKey has the correct permissions and the LLM prompts feature is enabled.`);
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 your personalApiKey has the correct permissions and the LLM prompts feature is enabled.`);
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}`);