File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } ) ;
Original file line number Diff line number Diff line change 11export 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 ( / ^ ( u s | e u ) \. p o s t h o g \. c o m $ / )
12- const region = regionMatch ? regionMatch [ 1 ] : "us"
11+ const regionMatch = hostname . match ( / ^ ( u s | e u ) \. p o s t h o g \. c o m $ / ) ;
12+ const region = regionMatch ? regionMatch [ 1 ] : "us" ;
1313
14- return `https://gateway.${ region } .posthog.com`
14+ return `https://gateway.${ region } .posthog.com` ;
1515}
You can’t perform that action at this time.
0 commit comments