Skip to content

Commit f5719f3

Browse files
authored
fix(llma): default prompts url (#423)
1 parent d4f2d6d commit f5719f3

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 7.8.2 - 2026-02-04
2+
3+
fix(llma): fix prompts default url
4+
15
# 7.8.1 - 2026-02-03
26

37
fix(llma): small fixes for prompt management

posthog/ai/prompts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
log = logging.getLogger("posthog")
1717

18-
APP_ENDPOINT = "https://app.posthog.com"
18+
APP_ENDPOINT = "https://us.posthog.com"
1919
DEFAULT_CACHE_TTL_SECONDS = 300 # 5 minutes
2020

2121
PromptVariables = Dict[str, Union[str, int, float, bool]]
@@ -50,11 +50,11 @@ class Prompts:
5050
from posthog.ai.prompts import Prompts
5151
5252
# With PostHog client
53-
posthog = Posthog('phc_xxx', host='https://app.posthog.com', personal_api_key='phx_xxx')
53+
posthog = Posthog('phc_xxx', host='https://us.posthog.com', personal_api_key='phx_xxx')
5454
prompts = Prompts(posthog)
5555
5656
# Or with direct options (no PostHog client needed)
57-
prompts = Prompts(personal_api_key='phx_xxx', host='https://app.posthog.com')
57+
prompts = Prompts(personal_api_key='phx_xxx', host='https://us.posthog.com')
5858
5959
# Fetch with caching and fallback
6060
template = prompts.get('support-system-prompt', fallback='You are a helpful assistant.')

posthog/test/ai/test_prompts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class TestPrompts(unittest.TestCase):
3333
}
3434

3535
def create_mock_posthog(
36-
self, personal_api_key="phx_test_key", host="https://app.posthog.com"
36+
self, personal_api_key="phx_test_key", host="https://us.posthog.com"
3737
):
3838
"""Create a mock PostHog client."""
3939
mock = MagicMock()
@@ -61,7 +61,7 @@ def test_successfully_fetch_a_prompt(self, mock_get_session):
6161
call_args = mock_get.call_args
6262
self.assertEqual(
6363
call_args[0][0],
64-
"https://app.posthog.com/api/environments/@current/llm_prompts/name/test-prompt/",
64+
"https://us.posthog.com/api/environments/@current/llm_prompts/name/test-prompt/",
6565
)
6666
self.assertIn("Authorization", call_args[1]["headers"])
6767
self.assertEqual(
@@ -333,7 +333,7 @@ def test_url_encode_prompt_names_with_special_characters(self, mock_get_session)
333333
call_args = mock_get.call_args
334334
self.assertEqual(
335335
call_args[0][0],
336-
"https://app.posthog.com/api/environments/@current/llm_prompts/name/prompt%20with%20spaces%2Fand%2Fslashes/",
336+
"https://us.posthog.com/api/environments/@current/llm_prompts/name/prompt%20with%20spaces%2Fand%2Fslashes/",
337337
)
338338

339339
@patch("posthog.ai.prompts._get_session")
@@ -350,7 +350,7 @@ def test_work_with_direct_options_no_posthog_client(self, mock_get_session):
350350
call_args = mock_get.call_args
351351
self.assertEqual(
352352
call_args[0][0],
353-
"https://app.posthog.com/api/environments/@current/llm_prompts/name/test-prompt/",
353+
"https://us.posthog.com/api/environments/@current/llm_prompts/name/test-prompt/",
354354
)
355355
self.assertEqual(
356356
call_args[1]["headers"]["Authorization"], "Bearer phx_direct_key"

posthog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "7.8.1"
1+
VERSION = "7.8.2"
22

33
if __name__ == "__main__":
44
print(VERSION, end="") # noqa: T201

0 commit comments

Comments
 (0)