Skip to content

Commit 21e94b9

Browse files
committed
formatting
1 parent d38c357 commit 21e94b9

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

packages/agent/example.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ async function testAgent() {
144144
POSTHOG_AUTH_HEADER: `Bearer ${process.env.POSTHOG_API_KEY}`,
145145
ANTHROPIC_API_KEY: process.env.POSTHOG_API_KEY,
146146
ANTHROPIC_AUTH_TOKEN: process.env.POSTHOG_API_KEY,
147-
ANTHROPIC_BASE_URL: getLlmGatewayUrl(process.env.POSTHOG_API_URL || ""),
147+
ANTHROPIC_BASE_URL: getLlmGatewayUrl(
148+
process.env.POSTHOG_API_URL || "",
149+
),
148150
},
149151
},
150152
});
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
export function getLlmGatewayUrl(posthogHost: string): string {
2-
const url = new URL(posthogHost)
3-
const hostname = url.hostname
2+
const url = new URL(posthogHost);
3+
const hostname = url.hostname;
44

55
if (hostname === "localhost" || hostname === "127.0.0.1") {
6-
return `${url.protocol}//localhost:3308`
6+
return `${url.protocol}//localhost:3308`;
77
}
88

99
// Extract region from hostname (us.posthog.com, eu.posthog.com)
1010
// app.posthog.com is legacy US
11-
const regionMatch = hostname.match(/^(us|eu)\.posthog\.com$/)
12-
const region = regionMatch ? regionMatch[1] : "us"
11+
const regionMatch = hostname.match(/^(us|eu)\.posthog\.com$/);
12+
const region = regionMatch ? regionMatch[1] : "us";
1313

14-
return `https://gateway.${region}.posthog.com`
14+
return `https://gateway.${region}.posthog.com`;
1515
}

0 commit comments

Comments
 (0)