@posthog/ai 7.16.0 → 7.16.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/dist/anthropic/index.cjs +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/gemini/index.cjs +1 -1
- package/dist/gemini/index.mjs +1 -1
- package/dist/index.cjs +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/dist/langchain/index.cjs +1 -1
- package/dist/langchain/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/otel/index.cjs +24 -6
- package/dist/otel/index.cjs.map +1 -1
- package/dist/otel/index.mjs +24 -6
- 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 +3 -3
package/dist/anthropic/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
10
10
|
|
|
11
11
|
var AnthropicOriginal__default = /*#__PURE__*/_interopDefault(AnthropicOriginal);
|
|
12
12
|
|
|
13
|
-
var version = "7.16.
|
|
13
|
+
var version = "7.16.1";
|
|
14
14
|
|
|
15
15
|
// Type guards for safer type checking
|
|
16
16
|
|
package/dist/anthropic/index.mjs
CHANGED
package/dist/gemini/index.cjs
CHANGED
package/dist/gemini/index.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -29,7 +29,7 @@ function _interopNamespace(e) {
|
|
|
29
29
|
var uuid__namespace = /*#__PURE__*/_interopNamespace(uuid);
|
|
30
30
|
var AnthropicOriginal__default = /*#__PURE__*/_interopDefault(AnthropicOriginal);
|
|
31
31
|
|
|
32
|
-
var version = "7.16.
|
|
32
|
+
var version = "7.16.1";
|
|
33
33
|
|
|
34
34
|
// Type guards for safer type checking
|
|
35
35
|
const isString = value => {
|
|
@@ -4460,6 +4460,14 @@ class LangChainCallbackHandler extends BaseCallbackHandler {
|
|
|
4460
4460
|
|
|
4461
4461
|
/// <reference lib="dom" />
|
|
4462
4462
|
const DEFAULT_CACHE_TTL_SECONDS = 300; // 5 minutes
|
|
4463
|
+
const DEFAULT_PROMPTS_HOST = 'https://us.posthog.com';
|
|
4464
|
+
function normalizeApiKey(value) {
|
|
4465
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
4466
|
+
}
|
|
4467
|
+
function normalizeHost(value) {
|
|
4468
|
+
const normalizedHost = typeof value === 'string' ? value.trim() : '';
|
|
4469
|
+
return (normalizedHost || DEFAULT_PROMPTS_HOST).replace(/\/+$/, '');
|
|
4470
|
+
}
|
|
4463
4471
|
function isPromptApiResponse(data) {
|
|
4464
4472
|
if (typeof data !== 'object' || data === null) {
|
|
4465
4473
|
return false;
|
|
@@ -4510,13 +4518,13 @@ class Prompts {
|
|
|
4510
4518
|
this.defaultCacheTtlSeconds = options.defaultCacheTtlSeconds ?? DEFAULT_CACHE_TTL_SECONDS;
|
|
4511
4519
|
if (isPromptsWithPostHog(options)) {
|
|
4512
4520
|
this.personalApiKey = options.posthog.options.personalApiKey ?? '';
|
|
4513
|
-
this.projectApiKey = options.posthog.apiKey
|
|
4521
|
+
this.projectApiKey = options.posthog.apiKey;
|
|
4514
4522
|
this.host = options.posthog.host;
|
|
4515
4523
|
} else {
|
|
4516
4524
|
// Direct options
|
|
4517
|
-
this.personalApiKey = options.personalApiKey;
|
|
4518
|
-
this.projectApiKey = options.projectApiKey;
|
|
4519
|
-
this.host = options.host
|
|
4525
|
+
this.personalApiKey = normalizeApiKey(options.personalApiKey);
|
|
4526
|
+
this.projectApiKey = normalizeApiKey(options.projectApiKey);
|
|
4527
|
+
this.host = normalizeHost(options.host);
|
|
4520
4528
|
}
|
|
4521
4529
|
}
|
|
4522
4530
|
getPromptCache(name) {
|